[Top][All Lists]

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

bug#3016:; offer to make a directory when saving if it is need

From: Kazuhiro Ito
Subject: bug#3016:; offer to make a directory when saving if it is needed
Date: Thu, 21 Feb 2013 18:52:55 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 EasyPG/1.0.0 Emacs/24.3.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO)

At Wed, 20 Feb 2013 16:28:21 -0500,
Glenn Morris wrote:
> Kazuhiro Ito wrote:
> > I want this check is done more later.  Because, in draft buffers of
> > Wanderlust (a message user agent), buffer-file-name does not indicate
> > actual file name and saving file is done via hook functions (such as
> > write-contents-functions, local-write-file-hooks,
> > write-file-functions).  In such case, this offer could make incorrect
> > directory.
> My initial reaction is to ask why you can't just set buffer-file-name to
> the right value (or to nil, so that basic-save-buffer will prompt for
> it); or at least to something whose parent directory exists, and then do
> whatever checks you want in your hook functions?

In Wanderlust, the file name (represented by message number) for the
draft is decided when buffer is made.  But Wanderlust updates it to
make the latest saved draft have largest number.  So, Wanderlust needs
to check and modify the file name at saving for the case that another
draft is saved while editing the draft.  Setting buffer-file-name to
existing directory could avoid the present problem, but I think that
is very ad hoc.

> By doing it the way you do, it sounds like you must already be missing
> the other checks that basic-save-buffer does (overwriting an existing
> file, saving to a directory rather than a file, verify file modtime),
> though they may not be relevant in your case.

Thank you for pointing it out.  It seems that Emacs does not expect
buffer-file-name is modified while hook functions.  Additionally, I
noticed that Wanderlust could save draft into non-local file, i.e.
remote imap4 server.  If basic-save-buffer really does not support
such cases, Wanderlust would need the workaround or to have own draft
saving function.

Kazuhiro Ito

reply via email to

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