bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18300: erc-format-target-and/or-network: do not rename server buffer


From: Ivan Shmakov
Subject: bug#18300: erc-format-target-and/or-network: do not rename server buffers unconditionally
Date: Wed, 20 Aug 2014 14:49:49 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Package:  emacs
Severity: wishlist
X-Debbugs-Cc: Kelvin White <address@hidden>

        Some two weeks ago, erc-format-target-and/or-network was patched
        to unconditionally rename server buffers according to the name
        of the associated IRC network (see below.)

        I find this new behavior mildly confusing, and would rather
        prefer an option to turn it off; or the change be reverted
        altogether.  An option may allow for a function value, to be
        used as in the following cond clause:

          ((and network-name
                (if (functionp erc-XXX-new-option)
                    (funcall erc-XXX-new-option)
                  erc-XXX-new-option)
                (not (get-buffer (or (funcall erc-XXX-new-option)
                                     network-name))))
           (rename-buffer (or (funcall erc-XXX-new-option)
                              network-name))
           network-name)

        Naturally, the result of (funcall erc-XXX-new-option) should be
        preserved rather than recomputed thrice.

        (FWIW, I’ve simply commented out this part of the code to get
        the old behavior.)

        TIA.

PS.  JFTR, these few new ERC patches have added a few trailing blanks to
        the code for no good reason.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
commit 342b156cbe06c099a982d1e2fd9a01b074dff222
Author:     Kelvin White <address@hidden>
AuthorDate: Thu Aug 7 12:44:19 2014 -0400

    * lisp/erc/erc.el: rename server buffers and fix variable names

@@ -6233,7 +6233,10 @@ shortened server name instead."
     (cond ((erc-default-target)
            (concat (erc-string-no-properties (erc-default-target))
                    "@" network-name))
-          (network-name network-name)
+          ((and network-name 
+                (not (string-equal network-name (buffer-name))))
+           (rename-buffer network-name)
+           network-name)
           (t (buffer-name (current-buffer))))))
 
 (defun erc-format-away-status ()

reply via email to

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