On Tue, Sep 19, 2017 at 8:08 AM Stefan Monnier <
address@hidden> wrote:
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)))))
That is the old code pre-commit 9b980e2[1]. That worked fine.
does " *Code-Fontify*" have buffer-file-name non-nil or does it have
buffer-offer-save non-nil?
No, but write-contents-functions is non-nil in " *Code-Fontify*" buffer (see below).
If not, I can't see how you could get
prompted, but maybe I'm missing something.
Post-commit 9b980e2[1], the newly-added 3rd segment to that OR starting evalling true for my use case:
(or
(buffer-file-name buffer)
(and pred
(progn
(set-buffer buffer)
(and buffer-offer-save (> (buffer-size) 0))))
(buffer-local-value ;THIS was the newly added condition
'write-contents-functions buffer))
> 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.
How about changing the location of that internal-buffer check?
i.e. change:
(buffer-local-value
'write-contents-functions buffer)
to:
(and (buffer-local-value
'write-contents-functions buffer)
(not (eq (aref (buffer-name buffer) 0) ?\s)))
@Eric: That makes me wonder.. is it possible to not add this 3rd condition in the or and instead just set buffer-offer-save in the special buffers in your use-case?