Last active
November 12, 2021 15:04
-
-
Save TauPan/6e14ba7059598e721c2874a8f0ac9207 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq weechat-timestamp-regex | |
"\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)?[[:blank:]]?\\([0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)") | |
(setq weechat-timestamp-prefix-regex | |
(format "^[[:blank:]]*%s" | |
weechat-timestamp-regex)) | |
(setq weechat-info-line-regex | |
(format "%s[[:blank:]]+\\(<?-->?\\)[[:blank:]]+\\(.+\\)" | |
weechat-timestamp-prefix-regex)) | |
(setq weechat-msg-line-regex | |
(format "%s[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.+\\)" | |
weechat-timestamp-prefix-regex)) | |
(setq weechat-log-mode-keywords | |
`((,weechat-timestamp-regex 1 font-lock-function-name-face t t) | |
(,weechat-timestamp-regex 2 font-lock-function-name-face t t) | |
(,weechat-info-line-regex 3 font-lock-warning-face t t) | |
(,weechat-info-line-regex 4 font-lock-comment-face t t) | |
(,weechat-msg-line-regex 3 font-lock-keyword-face nil t) | |
(,weechat-msg-line-regex 4 bold nil t))) | |
(define-derived-mode weechat-log-mode fundamental-mode "weechat-log" | |
"major mode for viewing weechat logfiles" | |
(setq | |
font-lock-defaults '(weechat-log-mode-keywords t))) | |
(provide 'weechat-log-mode) |
I've made some progress in the current revision but some lines do not match.
http://ergoemacs.org/emacs/elisp_font_lock_mode.html helped a lot here.
Looking better now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've made some progress in the current revision but some lines do not match.
http://ergoemacs.org/emacs/elisp_font_lock_mode.html helped a lot here.