Subject: erc-format-target-and/or-network: do not rename server buffers unconditionally

From: Ivan Shmakov <[email-masked]>
Date: Wed, 20 Aug 2014 14:49:49 +0000

Package:  emacs
Severity: wishlist
X-Debbugs-Cc: Kelvin White <[email-masked]>

	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 <[email-masked]>
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 ()