all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#8539: default value of Buffer-menu-buffer-column hard-coded in places
@ 2011-04-23  2:42 Alp Aker
  2011-05-28 19:13 ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Alp Aker @ 2011-04-23  2:42 UTC (permalink / raw)
  To: 8539

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-28 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-23  2:42 bug#8539: default value of Buffer-menu-buffer-column hard-coded in places Alp Aker
2011-05-28 19:13 ` Chong Yidong
2011-05-28 19:40   ` Alp Aker
2011-05-28 20:08     ` Chong Yidong

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.