From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: electric-buffer-list family-size trailing whitespace Date: Fri, 01 Oct 2004 10:33:25 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <415D86D5.8090100@yahoo.com> References: <415AD04A.9010509@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1096648453 16356 80.91.229.6 (1 Oct 2004 16:34:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Oct 2004 16:34:13 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 01 18:33:59 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CDQM1-0007ap-00 for ; Fri, 01 Oct 2004 18:33:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDQST-0003JS-3C for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Oct 2004 12:40:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CDQSQ-0003IV-1a for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2004 12:40:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CDQSP-0003Ho-6m for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2004 12:40:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDQSO-0003HJ-UQ for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2004 12:40:33 -0400 Original-Received: from [216.168.1.22] (helo=trinity.supernews.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CDQLV-0001Yc-Pn for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2004 12:33:26 -0400 Original-Received: from mail.fu-berlin.de ([130.133.1.2]:1812) by trinity.supernews.net with esmtp (Exim 4.42 (FreeBSD)) id 1CDQLU-000BMU-HO for gnu-emacs-bug@moderators.isc.org; Fri, 01 Oct 2004 16:33:24 +0000 Original-Received: by Mail.FU-Berlin.DE (Exim 4.42) from curry.zedat.fu-berlin.de ([160.45.10.36]) for gnu-emacs-bug@moderators.isc.org with esmtp id <1CDQLM-0000mP-BH>; Fri, 01 Oct 2004 18:33:16 +0200 Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Fri, 1 Oct 2004 18:33:16 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 192 X-Orig-X-Trace: news.uni-berlin.de 9UC61LsCSFYIb7+iluQgHwSWIyLwP3sDBSjRfBkZGGTZ1fBAg= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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 Xref: main.gmane.org gmane.emacs.bugs:9161 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9161 Dan Jacobson wrote: >>>Note that buffers with names starting with spaces are omitted. >>> >>Well, mention there how to list them too. Sizes and all. >> > K> Do you mean `electric-buffer-list'? > > electric-buffer-list doesn't list them either. But it does list their size, mode, and file -- just like list-buffers. > electric-buffer-list is an interactive compiled Lisp function in `ebuff-menu'. > (electric-buffer-list ARG) > And then the docstring forgets to mention what ARG is. It works just like list-buffers: Non-null optional arg FILES-ONLY means mention only file buffers. > And whatever > it is it doesn't show buffers starting with spaces, nor does I bet > its docstring mention how. Try the patches below, for both list-buffers and electric-buffer-list. 2004-10-04 Kevin Rodgers * buff-menu.el (list-internal-buffers): New option. (list-internal-buffers): New command. (list-buffers, list-buffers-noselect): Document and respect new option. 2004-10-04 Kevin Rodgers * ebuff-menu.el (electric-buffer-list): Rename and document optional FILES-ONLY prefix arg; document new list-internal-buffers option. > Most annoying is if one uses electric-buffer-list with > (setq show-trailing-whitespace t) > The loads of trailing whitespace were obviously not caught in the > review phase of the electric-buffer-list project. It behaves the same as list-buffers. Try this: (add-hook 'buffer-menu-mode-hook (lambda () (set (make-local-variable show-trailing-whitespace) nil))) > Nope, too electric for me. Plus banging C-h tells you to hit a "?" > when a second C-h would work just as well. Emacs is the extensible, customizable, self-documenting real-time display editor: (define-key electric-buffer-menu-mode-map "\C-h" 'Helper-describe-bindings) -- Kevin Rodgers *** emacs-21.3/lisp/buff-menu.el~ Wed Aug 29 08:53:31 2001 --- emacs-21.3/lisp/buff-menu.el Fri Oct 1 10:00:42 2004 *************** *** 463,472 **** (define-key ctl-x-map "\C-b" 'list-buffers) (defun list-buffers (&optional files-only) "Display a list of names of existing buffers. The list is displayed in a buffer named `*Buffer List*'. ! Note that buffers with names starting with spaces are omitted. Non-null optional arg FILES-ONLY means mention only file buffers. The M column contains a * for buffers that are modified. --- 463,486 ---- (define-key ctl-x-map "\C-b" 'list-buffers) + (defvar list-internal-buffers nil + "*If non-nil, `list-buffers' displays buffers whose names start with a space. + If non-nil and not t, it only displays buffers whose names start with a space. + See `list-buffers-no-select'.") + + (defun list-internal-buffers () + "Display a list of names of existing buffers whose names start with a space. + See `list-buffers'." + (interactive) + (display-buffer (let ((list-internal-buffers 'only)) + (list-buffers-noselect nil)))) + + (defun list-buffers (&optional files-only) "Display a list of names of existing buffers. The list is displayed in a buffer named `*Buffer List*'. ! Note that buffers with names starting with spaces are omitted ! unless `list-internal-buffers' is non-nil. Non-null optional arg FILES-ONLY means mention only file buffers. The M column contains a * for buffers that are modified. *************** *** 477,483 **** (defun list-buffers-noselect (&optional files-only) "Create and return a buffer with a list of names of existing buffers. The buffer is named `*Buffer List*'. ! Note that buffers with names starting with spaces are omitted. Non-null optional arg FILES-ONLY means mention only file buffers. The M column contains a * for buffers that are modified. --- 491,500 ---- (defun list-buffers-noselect (&optional files-only) "Create and return a buffer with a list of names of existing buffers. The buffer is named `*Buffer List*'. ! Note that buffers with names starting with spaces are omitted ! unless `list-internal-buffers' is non-nil. If `list-internal-buffers' ! is non-nil and not t, only buffers whose names start with a space ! are displayed. Non-null optional arg FILES-ONLY means mention only file buffers. The M column contains a * for buffers that are modified. *************** *** 514,521 **** list-buffers-directory) (setq this-buffer-directory list-buffers-directory)))) (cond ! ;; Don't mention internal buffers. ! ((string= (substring name 0 1) " ")) ;; Maybe don't mention buffers without files. ((and files-only (not file))) ((string= name "*Buffer List*")) --- 531,543 ---- list-buffers-directory) (setq this-buffer-directory list-buffers-directory)))) (cond ! ;; Maybe don't mention internal buffers. ! ((and (null list-internal-buffers) ! (equal (string-to-char name) ?\ )) ! ;; Maybe mention only internal buffers. ! ((and list-internal-buffers ! (not (eq list-internal-buffers t)) ! (not (equal (string-to-char name) ?\ ))) ;; Maybe don't mention buffers without files. ((and files-only (not file))) ((string= name "*Buffer List*")) *** emacs-21.3/lisp/ebuff-menu.el~ Thu Aug 23 16:17:34 2001 --- emacs-21.3/lisp/ebuff-menu.el Fri Oct 1 10:12:10 2004 *************** *** 39,45 **** (defvar electric-buffer-menu-mode-map nil) ;;;###autoload ! (defun electric-buffer-list (arg) "Pops up a buffer describing the set of Emacs buffers. Vaguely like ITS lunar select buffer; combining typeoutoid buffer listing with menuoid buffer selection. --- 39,45 ---- (defvar electric-buffer-menu-mode-map nil) ;;;###autoload ! (defun electric-buffer-list (&optional files-only) "Pops up a buffer describing the set of Emacs buffers. Vaguely like ITS lunar select buffer; combining typeoutoid buffer listing with menuoid buffer selection. *************** *** 54,64 **** Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil. \\{electric-buffer-menu-mode-map}" (interactive "P") (let (select buffer) (save-window-excursion ! (setq buffer (list-buffers-noselect arg)) (Electric-pop-up-window buffer) (unwind-protect (progn --- 54,68 ---- Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil. + Note that buffers with names starting with spaces are omitted + unless `list-internal-buffers' is non-nil. + Non-null optional files-only FILES-ONLY means mention only file buffers. + \\{electric-buffer-menu-mode-map}" (interactive "P") (let (select buffer) (save-window-excursion ! (setq buffer (list-buffers-noselect files-only)) (Electric-pop-up-window buffer) (unwind-protect (progn