[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal: move write-contents-functions higher up in basic-save-buff
Re: Proposal: move write-contents-functions higher up in basic-save-buffer
Thu, 25 May 2017 15:42:04 +0800
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
Stefan Monnier <address@hidden> writes:
> I haven't looked at basic-save-buffer recently, but in the worst case we
> could keep the current code and add a
> (if (null buffer-file-name)
> (run-hook-... 'write-contents-functions)
> but admittedly, it's better if we can move the single call to
> write-contents-functions so it's shared by the file and the
> non-file cases.
Eli Zaretskii <address@hidden> writes:
>> From: Eric Abrahamsen <address@hidden>
>> Date: Wed, 24 May 2017 12:55:53 +0800
>> I can try to produce a patch, if this is acceptable in principle.
> Yes, please.
Richard Stallman <address@hidden> writes:
> Please try using write-contents-functions for this, and you'll see if it
> does the job. If not, you'll see what more change is needed.
Okay, here's a first stab at it. I think it should work correctly: all
the short-circuit hooks get a chance to run in all cases, but the
function only insists on the presence of a file if
`write-contents-functions' are not present, or if they fail with a nil
value. I'd like to specify in the docs that those functions should fail
with an error.
If this looks okay I'll spend a bit more time testing it, then make
docstring and manual edits.
Description: Text Data