GNU bug report logs - #24962
26.0.50; list-buffers doesn't show buffers w/ name " "... visiting a file

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Fri, 18 Nov 2016 11:17:02 UTC

Severity: minor

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24962 in the body.
You can then email your comments to 24962 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Fri, 18 Nov 2016 11:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 18 Nov 2016 11:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Tino Calancha <tino.calancha <at> gmail.com>
Subject: 26.0.50; list-buffers doesn't show buffers w/ name " "... visiting
 a file
Date: Fri, 18 Nov 2016 20:15:52 +0900 (JST)
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 <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Fri, 18 Nov 2016 12:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 24962 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24962 <at> debbugs.gnu.org
Cc: Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#24962: 26.0.50;
 list-buffers doesn't show buffers w/ name " "... visiting a file
Date: Fri, 18 Nov 2016 21:41:33 +0900
Tino Calancha <tino.calancha <at> gmail.com> writes:

> 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.
The order in expand-file-name arguments is inverted;  it should be:
(expand-file-name "foo" temporary-file-directory)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Fri, 18 Nov 2016 14:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 24962 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 24962 <at> debbugs.gnu.org
Subject: Re: bug#24962: 26.0.50;
 list-buffers doesn't show buffers w/ name " "... visiting a file
Date: Fri, 18 Nov 2016 16:31:48 +0200
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Fri, 18 Nov 2016 20:15:52 +0900 (JST)
> Cc: Tino Calancha <tino.calancha <at> gmail.com>
> 
> 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).

Thank.  Please add a test for this to the test suite.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Fri, 18 Nov 2016 16:49:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#24962: 26.0.50; list-buffers doesn't show buffers w/ name "
 "... visiting a file
Date: Fri, 18 Nov 2016 11:48:07 -0500
[Message part 1 (text/plain, inline)]
On 2016-11-18 09:31, Eli Zaretskii wrote:
>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Fri, 18 Nov 2016 20:15:52 +0900 (JST)
>> Cc: Tino Calancha <tino.calancha <at> gmail.com>
>>
>> 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).
> 
> Thank.  Please add a test for this to the test suite.

Could we fix the manual instead? Or do we have evidence that all modes that use temporary buffers visiting files set buffer-file-name to nil to prevent these buffers from being listed?

Clément.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Fri, 18 Nov 2016 17:10:02 GMT) Full text and rfc822 format available.

Message #17 received at 24962 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: 24962 <at> debbugs.gnu.org
Subject: Re: bug#24962: 26.0.50;
 list-buffers doesn't show buffers w/ name " "... visiting a file
Date: Fri, 18 Nov 2016 19:09:44 +0200
> From: Clément Pit--Claudel <clement.pit <at> gmail.com>
> Date: Fri, 18 Nov 2016 11:48:07 -0500
> 
> >> >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).
> > 
> > Thank.  Please add a test for this to the test suite.
> 
> Could we fix the manual instead? Or do we have evidence that all modes that use temporary buffers visiting files set buffer-file-name to nil to prevent these buffers from being listed?

I'm not sure what use case you have in mind.  Usually, temporary
buffers don't visit files, those files are inserted into temporary
buffers without affecting buffer-file-name.  But maybe you are talking
about some scenario I'm missing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Wed, 30 Nov 2016 03:00:03 GMT) Full text and rfc822 format available.

Message #20 received at 24962 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24962 <at> debbugs.gnu.org
Subject: Re: bug#24962: 26.0.50;
 list-buffers doesn't show buffers w/ name " "... visiting a file
Date: Wed, 30 Nov 2016 11:59:40 +0900
Clément Pit--Claudel <clement.pit <at> gmail.com> writes:

> Could we fix the manual instead? Or do we have evidence that all modes
> that use temporary buffers visiting files set buffer-file-name to nil
> to prevent these buffers from being listed?
They shouln't automatically set `buffer-file-name', that is up to the
user.  Indeed, as Eli said, temporary buffers has such variable set to nil.

Ibuffer doesn't show the buffer ' foo' visiting a file by default.
Well, that is customizable using `ibuffer-maybe-show-predicates'.
A prefix argument in `ibuffer-update' toggle this variable.

One user might intentionally or accidentaly change the name
of a buffer visiting a file.  If we don't show it in `list-buffers'
the user might believe that the file has being deleted.
IMO one buffer visiting a file is always relevant; it's better if
we show it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24962; Package emacs. (Wed, 30 Nov 2016 03:23:02 GMT) Full text and rfc822 format available.

Message #23 received at 24962 <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24962 <at> debbugs.gnu.org
Subject: Re: bug#24962: 26.0.50; list-buffers doesn't show buffers w/ name "
 "... visiting a file
Date: Tue, 29 Nov 2016 22:22:01 -0500
[Message part 1 (text/plain, inline)]
On 2016-11-18 12:09, Eli Zaretskii wrote:
>> From: Clément Pit--Claudel <clement.pit <at> gmail.com>
>> Date: Fri, 18 Nov 2016 11:48:07 -0500
>>
>>>> >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).
>>>
>>> Thank.  Please add a test for this to the test suite.
>>
>> Could we fix the manual instead? Or do we have evidence that all modes that use temporary buffers visiting files set buffer-file-name to nil to prevent these buffers from being listed?
> 
> I'm not sure what use case you have in mind.  Usually, temporary
> buffers don't visit files, those files are inserted into temporary
> buffers without affecting buffer-file-name.  But maybe you are talking
> about some scenario I'm missing.

Just a vague worry; no special scenario.

[signature.asc (application/pgp-signature, attachment)]

Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Thu, 08 Dec 2016 04:55:01 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Thu, 08 Dec 2016 04:55:02 GMT) Full text and rfc822 format available.

Message #28 received at 24962-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24962-done <at> debbugs.gnu.org
Subject: Re: bug#24962: 26.0.50;
 list-buffers doesn't show buffers w/ name " "... visiting a file
Date: Thu, 08 Dec 2016 13:54:00 +0900
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Fri, 18 Nov 2016 20:15:52 +0900 (JST)
>> Cc: Tino Calancha <tino.calancha <at> gmail.com>
>> 
>> 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).
>
> Thank.  Please add a test for this to the test suite.
I don't see further comments so i've pushed a fix to the
master branch as commit af96803.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 05 Jan 2017 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 119 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.