all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
To: Glenn Morris <rgm@gnu.org>
Cc: dcl441-bugs@yahoo.com, 3016@debbugs.gnu.org
Subject: bug#3016: 23.0.92.2; offer to make a directory when saving if it is needed
Date: Thu, 21 Feb 2013 18:52:55 +0900	[thread overview]
Message-ID: <87wqu2ro20.wl%%xmue@d1.dion.ne.jp> (raw)
In-Reply-To: <k5hal6u13e.fsf@fencepost.gnu.org>

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	other threads:[~2013-02-21  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 12:37 bug#3016: 23.0.92.2; offer to make a directory when saving if it is needed Daniel Clemente
2013-02-12  8:37 ` Glenn Morris
2013-02-20 15:33   ` Kazuhiro Ito
2013-02-20 21:28     ` Glenn Morris
2013-02-21  9:52       ` Kazuhiro Ito [this message]
2013-02-21 17:05         ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqu2ro20.wl%%xmue@d1.dion.ne.jp \
    --to=kzhr@d1.dion.ne.jp \
    --cc=3016@debbugs.gnu.org \
    --cc=dcl441-bugs@yahoo.com \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.