[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make pred customable in auto-save-visited-mode
From: |
Eli Zaretskii |
Subject: |
Re: make pred customable in auto-save-visited-mode |
Date: |
Sat, 31 Mar 2018 13:45:24 +0300 |
> From: Philipp Stephani <address@hidden>
> Date: Sat, 31 Mar 2018 10:28:58 +0000
> Cc: 纪秀峰 <address@hidden>, address@hidden
>
> I agree that customization isn't the best solution here. However, I'm
> suprised that `save-some-buffers'
> still prompts even if :noprompt is passed.
> The issue might be in `save-some-buffers': Its docstring says "If PRED is t,
> then certain non-file buffers
> will also be considered.", but later it only checks whether PRED is non-nil:
>
> (or
> (buffer-file-name buffer)
> (with-current-buffer buffer
> (or (eq buffer-offer-save 'always)
> (and pred buffer-offer-save (> (buffer-size)
> 0)))))
>
> Maybe instead of `pred' here we should say (eq pred t). Alternative, the
> predicate lambda should check
> whether `buffer-file-name' is non-nil.
>
> Probably the second option is better because the first option would prevent
> PRED from running for
> non-file-visiting buffers. Patch attached.
AFAIU, this will unconditionally disable auto-saving in *ediff-merge*
and all the similar buffers, when auto-save-visited-mode is turned
on. Is that what we want? And if that's going to be the default, how
are users supposed to override it if they want?