unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24962: 26.0.50; list-buffers doesn't show buffers w/ name " "... visiting a file
@ 2016-11-18 11:15 Tino Calancha
  2016-11-18 12:41 ` Tino Calancha
  2016-11-18 14:31 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Tino Calancha @ 2016-11-18 11:15 UTC (permalink / raw)
  To: 24962; +Cc: Tino Calancha


emacs -Q -eval '(write-region "foo" nil (expand-file-name temporary-file-directory "foo"))'
  M-: (find-file (expand-file-name temporary-file-directory "foo")) RET
  M-: (rename-buffer " foo") RET
  C-x C-b
  ;; Buffer " foo" not listed.

From the Emacs manual:
doc/lispref/buffers.texi (Buffer Names):
Buffers that are ephemeral and generally uninteresting to the user
have names starting with a space, so that the @code{list-buffers} and
@code{buffer-menu} commands don't mention them (but if such a buffer
visits a file, it @strong{is} mentioned).

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 5f86fb83f6dcb65a3cbb03b3a09306f0375deb5a Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Fri, 18 Nov 2016 20:07:15 +0900
Subject: [PATCH] List buffers with name starting with " " if they visit a file

* lisp/buff-menu.el (list-buffers--refresh)
---
  lisp/buff-menu.el | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 4742628..2949409 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -633,7 +633,8 @@ list-buffers--refresh
  	       (file buffer-file-name))
  	  (when (and (buffer-live-p buffer)
  		     (or buffer-list
-			 (and (not (string= (substring name 0 1) " "))
+			 (and (or (not (string= (substring name 0 1) " "))
+                                  file)
  			      (not (eq buffer buffer-menu-buffer))
  			      (or file show-non-file))))
  	    (push (list buffer
-- 
2.10.2

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.3)
  of 2016-11-16
Repository revision: 6653bb45d3697c9372cc77773c49f52399740b51





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

end of thread, other threads:[~2016-12-08  4:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18 11:15 bug#24962: 26.0.50; list-buffers doesn't show buffers w/ name " "... visiting a file Tino Calancha
2016-11-18 12:41 ` Tino Calancha
2016-11-18 14:31 ` Eli Zaretskii
2016-11-18 16:48   ` Clément Pit--Claudel
2016-11-18 17:09     ` Eli Zaretskii
2016-11-30  3:22       ` Clément Pit--Claudel
2016-11-30  2:59     ` Tino Calancha
2016-12-08  4:54   ` Tino Calancha

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).