From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
> From: =E7=BA=AA=E7=A7=80=E5=B3=B0 <jixiuf@qq.com>
> Date: Sat, 31 Mar 2018 00:59:19 +0800
> Feedback-ID: esmtp:qq.com:bgforeign:bgforeign1
>
> When I enable=C2=A0 auto-save-visited-mode and start an ediff merge se= ssion
> It always prompt me save "*ediff-merge*=E2=80=9D to a file.
Why is that a problem?=C2=A0 *ediff-merge* is a buffer where you prepare
the merge, and that merge will eventually be saved to some file,
right?=C2=A0 So it doesn't sound wrong to offer to save it.However, auto-saving should probably not prompt fo= r filenames. That's at least the intention of the :noprompt argument he= re.=C2=A0
>=C2=A0 =C2=A0(setq auto-save--timer
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when auto-save-visited-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(run-with-idle-timer
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto-save-visited-interval :r= epeat
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'save-some-buffers :no-p= rompt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda ()=C2=A0 ;;<=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94how about make this customable
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (not (and buffer-auto-= save-file-name
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 auto-save-visited-file-name)))))))
Letting users customize a non-trivial function is not the best way of
affecting this behavior.=C2=A0 I think you can have what you want by adding=
a function to ediff-startup-hook, and in that function set
buffer-auto-save-file-name of the *ediff-merge* buffer to nil.
I agree that customization isn't t= he best solution here. However, I'm suprised that `save-some-buffers= 9; still prompts even if :noprompt is passed.The issue might be = in `save-some-buffers': Its docstring says "If PRED is t, then cer= tain non-file buffers will also be considered.", but later it only che= cks whether PRED is non-nil:=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (or=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(b= uffer-file-name buffer)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-current-buffer buffer= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(or (eq buffer-offer-save 'always)=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(and pred buffer-offer-save (> (buffer-size) 0)))))Maybe instead of `pred' here we should say (eq pre= d t). Alternative, the predicate lambda should check whether `buffer-file-n= ame' is non-nil.