unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alp Aker <aker@pitt.edu>
To: 8539@debbugs.gnu.org
Subject: bug#8539: default value of Buffer-menu-buffer-column hard-coded in places
Date: Fri, 22 Apr 2011 22:42:49 -0400 (EDT)	[thread overview]
Message-ID: <Pine.GSO.4.63.1104222153060.6388@unixs1.cis.pitt.edu> (raw)

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





             reply	other threads:[~2011-04-23  2:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-23  2:42 Alp Aker [this message]
2011-05-28 19:13 ` bug#8539: default value of Buffer-menu-buffer-column hard-coded in places Chong Yidong
2011-05-28 19:40   ` Alp Aker
2011-05-28 20:08     ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.63.1104222153060.6388@unixs1.cis.pitt.edu \
    --to=aker@pitt.edu \
    --cc=8539@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).