GNU bug report logs - #18300
erc-format-target-and/or-network: do not rename server buffers unconditionally

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Wed, 20 Aug 2014 14:51:01 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: erc-format-target-and/or-network: do not rename server buffers
 unconditionally 
Date: Wed, 20 Aug 2014 14:49:49 +0000
[Message part 1 (text/plain, inline)]
Package:  emacs
Severity: wishlist
X-Debbugs-Cc: Kelvin White <kwhite <at> gnu.org>

	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
[Message part 2 (text/plain, inline)]
commit 342b156cbe06c099a982d1e2fd9a01b074dff222
Author:     Kelvin White <kwhite <at> gnu.org>
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 ()

This bug report was last modified 9 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.