GNU bug report logs - #8539
default value of Buffer-menu-buffer-column hard-coded in places

Previous Next

Package: emacs;

Reported by: Alp Aker <aker <at> pitt.edu>

Date: Sat, 23 Apr 2011 02:44:01 UTC

Severity: minor

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8539 in the body.
You can then email your comments to 8539 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8539; Package emacs. (Sat, 23 Apr 2011 02:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alp Aker <aker <at> pitt.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 23 Apr 2011 02:44:02 GMT) Full text and rfc822 format available.

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

From: Alp Aker <aker <at> pitt.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: default value of Buffer-menu-buffer-column hard-coded in places
Date: Fri, 22 Apr 2011 22:42:49 -0400 (EDT)
Buffer-menu-buffer-column's default value of 4 is hard-coded into several 
functions from buff-menu.el.  As of 24.0.50, this is true of 
Buffer-menu-sort and Buffer-menu-revert-function.

This is not strictly speaking a bug, but it is an anti-pattern, and it can 
unexpectedly bite someone hacking on buff-menu.el.  So it would perhaps be 
good practice to make the following changes:

=== modified file 'lisp/buff-menu.el'
--- lisp/buff-menu.el	2011-04-19 13:44:55 +0000
+++ lisp/buff-menu.el	2011-04-23 02:30:41 +0000
@@ -278,7 +278,7 @@
   (let ((opoint (point))
 	(eobp (eobp))
 	(ocol (current-column))
-	(oline (progn (move-to-column 4)
+	(oline (progn (move-to-column Buffer-menu-buffer-column)
 		      (get-text-property (point) 'buffer)))
 	(prop (point-min))
 	;; do not make undo records for the reversion.
@@ -703,7 +703,7 @@
     (save-excursion
       (Buffer-menu-beginning)
       (while (not (eobp))
-	(when (buffer-live-p (setq buf (get-text-property (+ (point) 4) 'buffer)))
+	(when (buffer-live-p (setq buf (get-text-property (+ (point) Buffer-menu-buffer-column) 'buffer)))
 	  (setq m1 (char-after)
 		m1 (if (memq m1 '(?> ?D)) m1)
 		m2 (char-after (+ (point) 2))
@@ -715,7 +715,7 @@
     (save-excursion
       (Buffer-menu-beginning)
       (while (not (eobp))
-	(when (setq buf (assq (get-text-property (+ (point) 4) 'buffer) l))
+	(when (setq buf (assq (get-text-property (+ (point) Buffer-menu-buffer-column) 'buffer) l))
 	  (setq m1 (cadr buf)
 		m2 (cadr (cdr buf)))
 	  (when m1




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8539; Package emacs. (Sat, 28 May 2011 19:14:01 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Alp Aker <aker <at> pitt.edu>
Cc: 8539 <at> debbugs.gnu.org
Subject: Re: bug#8539: default value of Buffer-menu-buffer-column hard-coded
	in places
Date: Sat, 28 May 2011 15:13:13 -0400
Alp Aker <aker <at> pitt.edu> writes:

> Buffer-menu-buffer-column's default value of 4 is hard-coded into
> several functions from buff-menu.el.  As of 24.0.50, this is true of
> Buffer-menu-sort and Buffer-menu-revert-function.

Thanks, committed.




bug closed, send any further explanations to 8539 <at> debbugs.gnu.org and Alp Aker <aker <at> pitt.edu> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 28 May 2011 19:14:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8539; Package emacs. (Sat, 28 May 2011 19:41:02 GMT) Full text and rfc822 format available.

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

From: Alp Aker <aker <at> pitt.edu>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 8539 <at> debbugs.gnu.org
Subject: Re: bug#8539: default value of Buffer-menu-buffer-column hard-coded in
	places
Date: Sat, 28 May 2011 15:40:47 -0400 (EDT)
Just a quick follow-up:  After posting the bug report I noticed the same 
problem in Buffer-menu-buffer+size.  In the display spec

  (space :align-to ,(+ 4 name+space-width)

at the end of the function, that "4" should also be replaced with 
"Buffer-menu-buffer-column".

On Sat, 28 May 2011, Chong Yidong wrote:

> Alp Aker <aker <at> pitt.edu> writes:
>
>> Buffer-menu-buffer-column's default value of 4 is hard-coded into
>> several functions from buff-menu.el.  As of 24.0.50, this is true of
>> Buffer-menu-sort and Buffer-menu-revert-function.
>
> Thanks, committed.
>




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8539; Package emacs. (Sat, 28 May 2011 20:09:01 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Alp Aker <aker <at> pitt.edu>
Cc: 8539 <at> debbugs.gnu.org
Subject: Re: bug#8539: default value of Buffer-menu-buffer-column hard-coded
	in places
Date: Sat, 28 May 2011 16:08:11 -0400
Alp Aker <aker <at> pitt.edu> writes:

> Just a quick follow-up:  After posting the bug report I noticed the
> same problem in Buffer-menu-buffer+size.  In the display spec
>
>   (space :align-to ,(+ 4 name+space-width)
>
> at the end of the function, that "4" should also be replaced with
> "Buffer-menu-buffer-column".

Thanks, applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Jun 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 56 days ago.

Previous Next


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