emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/rcirc-update ade9653 1/3: Add new option rcirc-track-abbrevate-f


From: Philip Kaludercic
Subject: feature/rcirc-update ade9653 1/3: Add new option rcirc-track-abbrevate-flag
Date: Sat, 4 Sep 2021 19:40:11 -0400 (EDT)

branch: feature/rcirc-update
commit ade9653108a5d89300db25662bc942a643309c46
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    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 629b51d..378a5e5 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'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]