unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: electric-buffer-list family-size trailing whitespace
Date: Fri, 01 Oct 2004 10:33:25 -0600	[thread overview]
Message-ID: <415D86D5.8090100@yahoo.com> (raw)
In-Reply-To: mailman.444.1096517435.2017.bug-gnu-emacs@gnu.org

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  <ihs_4664@yahoo.com>

             * 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  <ihs_4664@yahoo.com>

             * 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

  parent reply	other threads:[~2004-10-01 16:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.194.1096415922.2017.bug-gnu-emacs@gnu.org>
2004-09-29 15:10 ` list-buffers' docstring should mention how to list all Kevin Rodgers
2004-09-30  1:08   ` electric-buffer-list family-size trailing whitespace Dan Jacobson
     [not found]   ` <mailman.444.1096517435.2017.bug-gnu-emacs@gnu.org>
2004-10-01 16:33     ` Kevin Rodgers [this message]
2004-10-06  1:48       ` Dan Jacobson
2004-10-07 12:27         ` John Paul Wallington

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=415D86D5.8090100@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /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).