From ade9653108a5d89300db25662bc942a643309c46 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 6 Aug 2021 20:01:38 +0200 Subject: [PATCH] Add new option rcirc-track-abbrevate-flag * rcirc.el (rcirc-track-abbrevate-flag): Add option (rcirc-short-buffer-name): Respect rcirc-track-abbrevate-flag --- lisp/net/rcirc.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 629b51d7c35..378a5e5db7b 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2116,6 +2116,11 @@ This function does not alter the INPUT string." map) "Keymap for rcirc track minor mode.") +(defcustom rcirc-track-abbrevate-flag t + "If non-nil, abbreviate names for `rcirc-track-minor-mode'." + :version "28.1" + :type 'boolean) + ;;;###autoload (define-minor-mode rcirc-track-minor-mode "Global minor mode for tracking activity in rcirc buffers." @@ -2296,7 +2301,11 @@ activity. Only run if the buffer is not visible and (defun rcirc-short-buffer-name (buffer) "Return a short name for BUFFER to use in the mode line indicator." (with-current-buffer buffer - (or rcirc-short-buffer-name (buffer-name)))) + (replace-regexp-in-string + "@.*?\\'" "" + (or (and rcirc-track-abbrevate-flag + rcirc-short-buffer-name) + (buffer-name))))) (defun rcirc-visible-buffers () "Return a list of the visible buffers that are in `rcirc-mode'." -- 2.39.5