emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: move write-contents-functions higher up in basic-save-buff


From: Eli Zaretskii
Subject: Re: Proposal: move write-contents-functions higher up in basic-save-buffer
Date: Wed, 24 May 2017 05:38:55 +0300

> From: Eric Abrahamsen <address@hidden>
> Date: Wed, 24 May 2017 07:09:07 +0800
> 
> Eli Zaretskii <address@hidden> writes:
> 
> >> From: Eric Abrahamsen <address@hidden>
> >> Date: Tue, 23 May 2017 15:19:11 +0800
> >> 
> >> Most special-mode buffers aren't visiting a file, and thus they miss out
> >> on all the `do-auto-save' and `save-some-buffers' mechanisms. I'd guess
> >> a fair number of packages that use special-mode *do* have some concept
> >> of saving, or persisting data in some other way.
> >> 
> >> I think the `write-contents-functions' hook would be an ideal way of
> >> solving this problem, except that the way `basic-save-buffer' is
> >> written, it won't let you get that far without having a file name.
> >> 
> >> My proposal is to declare `write-contents-functions' as *explicitly* a
> >> hook for buffers that don't have any file associated with them at all
> >> (this would be in contrast to `write-file-functions'). Then we'd move it
> >> up higher in the process: either earlier in `basic-save-buffer', or all
> >> the way up to `save-buffer' -- that way `basic-save-buffer' could only
> >> be for buffers that have a file.
> >
> > Did you investigate the alternative -- teach basic-save-buffer to save
> > buffers that don't visit files?  If that's possible, it should be
> > easier.
> 
> I thought that's what I was doing!

I was referring specifically to this party of your description:

> I think the `write-contents-functions' hook would be an ideal way of
> solving this problem, except that the way `basic-save-buffer' is
> written, it won't let you get that far without having a file name.

My thinking was that by somehow overcoming this obstacle, you can
allow users to easily use write-contents-functions as they need.

Does this make sense?  If not, can you tell what is the difficulty in
this regard?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]