[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins wit
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers |
Date: |
Tue, 19 Sep 2017 08:08:33 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
>>>>> "Kaushal" == Kaushal Modi <address@hidden> writes:
> On Mon, Sep 18, 2017, 10:44 PM Stefan Monnier <address@hidden>
> wrote:
>> > Ignore buffers whose name begins with a space in save-some-buffers
>> > * lisp/files.el (save-some-buffers): Consider these buffers
>> > "internal", and don't prompt the user to save them.
>> > * doc/lispref/files.texi: Document.
>>
>> Why? Currently we only prompt for buffers with a leading space
>> in 2 case:
>> - the buffer is associated with a file: rather unlikely, but if it
>> occurs, it's probably a good idea not to ignore this buffer.
>> - the buffer has buffer-offer-save set to a non-nil value: here again if
>> someone bothered to set this, it's a good idea not to ignore this buffer.
> The previous commit that started promoting for file save if
> write-file-functions was non-nil starting breaking my use case (ggtags.el +
> verilog-mode).
> Details here: https://github.com/leoliu/ggtags/issues/157
> Summary:
> - ggtags.el create an internal buffer with name starting with space "
> *Code-Fontify*"
> - verilog-mode is enabled in that buffer
> - verilog-mode sets write-file-functions to a non-nil value
> - So now I was promoted to save that " *Code-Fontify*" each time I quit
> emacs.
But, how does your example satisfy this part of the code:
(or
(buffer-file-name buffer)
(and pred
(progn
(set-buffer buffer)
(and buffer-offer-save (> (buffer-size) 0)))))
does " *Code-Fontify*" have buffer-file-name non-nil or does it have
buffer-offer-save non-nil? If not, I can't see how you could get
prompted, but maybe I'm missing something.
> ANDing the internal buffer check with OR of the 2 cases you mentioned will
> work fine (won't undo the fix that Eric made in this commit).
But it will stop prompting for buffers with a leading space but where
buffer-offer-save is explicitly set to a non-nil value, which I think is
a bug.
Stefan
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, (continued)
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/18
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Stefan Monnier, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Kaushal Modi, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Kaushal Modi, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Stefan Monnier, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Leo Liu, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Stefan Monnier, 2017/09/19
Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Kaushal Modi, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers,
Stefan Monnier <=
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Kaushal Modi, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Kaushal Modi, 2017/09/19
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Andreas Schwab, 2017/09/20
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/20
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eli Zaretskii, 2017/09/21
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/21
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Kaushal Modi, 2017/09/21
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eric Abrahamsen, 2017/09/21
- Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers, Eli Zaretskii, 2017/09/22