summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-07-22 21:15:12 -0500
committerCase Duckworth2021-07-22 21:15:34 -0500
commit9534a7ed7f0caff60ccf994fbf9980a12387ebd3 (patch)
tree337f34589a68c65f06352d1db9e6fdf95918718a
parentFix browse-url-browser-function setting (diff)
downloademacs-9534a7ed7f0caff60ccf994fbf9980a12387ebd3.tar.gz
emacs-9534a7ed7f0caff60ccf994fbf9980a12387ebd3.zip
Configure ERC further
-rw-r--r--init.el8
-rw-r--r--lisp/acdw-erc.el21
2 files changed, 26 insertions, 3 deletions
diff --git a/init.el b/init.el index 1cb4e5b..00604d0 100644 --- a/init.el +++ b/init.el
@@ -305,10 +305,11 @@
305 erc-button-url-regexp browse-url-button-regexp 305 erc-button-url-regexp browse-url-button-regexp
306 erc-common-server-suffixes '(("tilde.chat\\'" . "~") 306 erc-common-server-suffixes '(("tilde.chat\\'" . "~")
307 ("libera.chat\\'" . "LC")) 307 ("libera.chat\\'" . "LC"))
308 erc-default-server "irc.tilde.chat" ; fuck freenode. all my friends hate 308 erc-default-server "irc.tilde.chat" ; fuck freenode. all my friends hate
309 ; freenode. 309 ; freenode.
310 erc-fill-function #'erc-fill-static 310 erc-fill-function #'erc-fill-static
311 erc-fill-static-center 14 311 erc-fill-static-center 14
312 erc-format-nick-function #'erc-format-truncate-@nick
312 erc-header-line-face-method #'erc/update-header-line-show-disconnected 313 erc-header-line-face-method #'erc/update-header-line-show-disconnected
313 erc-hide-list '("JOIN" "NICK" "PART" "QUIT" "MODE" 314 erc-hide-list '("JOIN" "NICK" "PART" "QUIT" "MODE"
314 "324" "329" "332" "333" "353" "477") 315 "324" "329" "332" "333" "353" "477")
@@ -319,8 +320,9 @@
319 erc-kill-queries-on-quit t 320 erc-kill-queries-on-quit t
320 erc-kill-server-buffer-on-quit t 321 erc-kill-server-buffer-on-quit t
321 erc-nick "acdw" 322 erc-nick "acdw"
323 erc-nick-truncate (- erc-fill-static-center 2)
322 erc-prompt (lambda () (acdw-erc/prompt)) 324 erc-prompt (lambda () (acdw-erc/prompt))
323 erc-prompt-for-password nil ; use ~/.authinfo 325 erc-prompt-for-password nil ; use ~/.authinfo
324 erc/servers 326 erc/servers
325 (when (boundp 'erc-autojoin-channels-alist) 327 (when (boundp 'erc-autojoin-channels-alist)
326 (mapcar #'car erc-autojoin-channels-alist)) 328 (mapcar #'car erc-autojoin-channels-alist))
@@ -329,7 +331,7 @@
329 '("AWAY")) 331 '("AWAY"))
330 erc-track-exclude-server-buffer t 332 erc-track-exclude-server-buffer t
331 erc-track-position-in-mode-line 'before-modes 333 erc-track-position-in-mode-line 'before-modes
332 erc-track-visibility nil ; only the selected frame 334 erc-track-visibility nil ; only the selected frame
333 ) 335 )
334 336
335 ;; Thanks bpalmer! 337 ;; Thanks bpalmer!
diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 423c4a5..09fa335 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el
@@ -111,6 +111,27 @@ If USE-TLS is non-nil, use TLS."
111 (setq num (1- num))) 111 (setq num (1- num)))
112 (apply #'concat ss)))))) 112 (apply #'concat ss))))))
113 113
114(defcustom erc-nick-truncate nil
115 "The width at which to truncate a nick with `erc-format-truncate-@nick'."
116 :group 'erc
117 :type 'integer)
118
119(defun erc-format-truncate-@nick (&optional user channel-data)
120 "Format the nickname of USER as in `erc-format-@nick', with truncation.
121Truncation is customized using the `erc-nick-truncate' variable.
122See also `erc-format-nick-function'."
123 (when user
124 (let* ((nick (erc-server-user-nickname user))
125 (ellipsis "~")
126 (max-len (- erc-nick-truncate 2 (length ellipsis))))
127 (concat (erc-propertize
128 (erc-get-user-mode-prefix nick)
129 'font-lock-face 'erc-nick-prefix-face)
130 (if (and max-len (> (length nick) max-len))
131 (format "%s%s" (substring nick 0 max-len)
132 ellipsis)
133 nick)))))
134
114 135
115;;; Uh 136;;; Uh
116 137