From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alp Aker Newsgroups: gmane.emacs.bugs Subject: bug#8539: default value of Buffer-menu-buffer-column hard-coded in places Date: Fri, 22 Apr 2011 22:42:49 -0400 (EDT) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Trace: dough.gmane.org 1303528066 6336 80.91.229.12 (23 Apr 2011 03:07:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Apr 2011 03:07:46 +0000 (UTC) To: 8539@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 23 05:07:35 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QDTC2-0004pD-PA for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Apr 2011 05:07:34 +0200 Original-Received: from localhost ([::1]:38190 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDTC2-0002KH-1h for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Apr 2011 23:07:34 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDTBy-0002K1-VM for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 23:07:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDTBy-00040l-1w for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 23:07:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDTBx-00040g-UA for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 23:07:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QDSpF-0004tz-W7; Fri, 22 Apr 2011 22:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alp Aker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Apr 2011 02:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8539 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.130352658218769 (code B ref -1); Sat, 23 Apr 2011 02:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Apr 2011 02:43:02 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QDSoI-0004sg-Ld for submit@debbugs.gnu.org; Fri, 22 Apr 2011 22:43:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QDSoG-0004sE-Nh for submit@debbugs.gnu.org; Fri, 22 Apr 2011 22:43:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDSoA-0000iU-PJ for submit@debbugs.gnu.org; Fri, 22 Apr 2011 22:42:55 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:48632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDSoA-0000iQ-NT for submit@debbugs.gnu.org; Fri, 22 Apr 2011 22:42:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDSoA-0001aa-3I for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 22:42:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDSo9-0000iE-3l for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 22:42:54 -0400 Original-Received: from exprod7og124.obsmtp.com ([64.18.2.26]:39404) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QDSo8-0000i4-QA for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 22:42:53 -0400 Original-Received: from mb2i1.ns.pitt.edu ([136.142.11.153]) by exprod7ob124.postini.com ([64.18.6.12]) with SMTP ID DSNKTbI8qdRrX/7D1jI4Nx2N7XYy0tKX1IWe@postini.com; Fri, 22 Apr 2011 19:42:52 PDT Original-Received: from unixs1.cis.pitt.edu ([136.142.4.246]) by pitt.edu (PMDF V6.3-x11 #31505) with ESMTP id <0LK300HVI3JD78@mb2i1.ns.pitt.edu> for bug-gnu-emacs@gnu.org; Fri, 22 Apr 2011 22:42:49 -0400 (EDT) X-X-Sender: aker@unixs1.cis.pitt.edu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 22 Apr 2011 22:44:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45952 Archived-At: 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