diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-25 20:00:33 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-25 20:00:33 -0500 |
| commit | d37ac96c9e2f2dc7214a353acd947f73008d3a15 (patch) | |
| tree | 0a108d4073c3ed43fb24b19e784b77402ea01e86 | |
| parent | 746cefd4d674bfc6dd9fdfe4aeb79c7e760ec268 (diff) | |
feat:erc-config: add image inline support and simplify hooks
Enable inline image support in ERC by adding 'image' to erc-modules.
Simplify hook usage by removing ERC colorization setup, leveraging
built-in functionality for better color management.
| -rw-r--r-- | modules/erc-config.el | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/modules/erc-config.el b/modules/erc-config.el index 424066b7..1c189fa3 100644 --- a/modules/erc-config.el +++ b/modules/erc-config.el @@ -197,6 +197,7 @@ Auto-adds # prefix if missing. Offers completion from configured channels." button completion fill + image irccontrols list log @@ -207,7 +208,7 @@ Auto-adds # prefix if missing. Offers completion from configured channels." readonly services stamp - track)) ;; Added track module + track)) (erc-autojoin-channels-alist (mapcar (lambda (server) @@ -258,9 +259,8 @@ Auto-adds # prefix if missing. Offers completion from configured channels." erc-track-switch-direction 'importance erc-track-showcount t) - ;; Add hooks for notifications and colorization - (add-hook 'erc-text-matched-hook #'cj/erc-notify-on-mention) - (add-hook 'erc-mode-hook #'cj/erc-colorize-setup)) + ;; Add hooks for notifications + (add-hook 'erc-text-matched-hook #'cj/erc-notify-on-mention)) ;; -------------------------------- ERC Track --------------------------------- ;; Better tracking of activity across channels (already included in modules above) @@ -303,30 +303,13 @@ NICK is the sender and MESSAGE is the message text." :app-name "Emacs ERC" :sound-name 'message)))))) -;; ------------------------------ ERC Colorize ------------------------------- -;; Better color management with built-in functionality - -(defun cj/erc-colorize-setup () - "Setup ERC colorization for nicknames." - (make-local-variable 'erc-nick-color-alist) - (setq erc-nick-color-alist - (cl-loop for i from 0 to 15 - for color in '("blue" "green" "red" "brown" "purple" - "olive" "dark cyan" "light gray" "dark gray" - "light blue" "light green" "light red" - "light brown" "light purple" "yellow" "white") - collect (cons i color))) - (setq erc-nick-color-function #'erc-get-color-for-nick)) - ;; -------------------------------- ERC Image --------------------------------- ;; show inlined images (png/jpg/gif/svg) in erc buffers. (use-package erc-image :after erc :config - (setq erc-image-inline-rescale 300) - (add-to-list 'erc-modules 'image) - (erc-update-modules)) + (setq erc-image-inline-rescale 300)) ;; -------------------------------- ERC Nicks --------------------------------- ;; Nickname highlighting (built-in to Emacs 29+) |
