From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kazuhiro Ito Newsgroups: gmane.emacs.bugs 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 Message-ID: <87wqu2ro20.wl%%xmue@d1.dion.ne.jp> References: <766594.81278.qm@web53212.mail.re2.yahoo.com> <87621n0zm1.wl%%xmue@d1.dion.ne.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1361440438 2003 80.91.229.3 (21 Feb 2013 09:53:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Feb 2013 09:53:58 +0000 (UTC) Cc: dcl441-bugs@yahoo.com, 3016@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 21 10:54:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U8Sr4-0000Sz-IH for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Feb 2013 10:54:18 +0100 Original-Received: from localhost ([::1]:60944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Sqk-0007A7-B8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Feb 2013 04:53:58 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Sqb-0006wS-JB for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2013 04:53:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8SqZ-0007yq-If for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2013 04:53:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8SqZ-0007yb-G1 for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2013 04:53:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U8Srm-0003Bz-3I for bug-gnu-emacs@gnu.org; Thu, 21 Feb 2013 04:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Feb 2013 09:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3016 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 3016-submit@debbugs.gnu.org id=B3016.136144046512227 (code B ref 3016); Thu, 21 Feb 2013 09:55:01 +0000 Original-Received: (at 3016) by debbugs.gnu.org; 21 Feb 2013 09:54:25 +0000 Original-Received: from localhost ([127.0.0.1]:41407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8SrA-0003B8-7y for submit@debbugs.gnu.org; Thu, 21 Feb 2013 04:54:25 -0500 Original-Received: from msa103.auone-net.jp ([61.117.18.163]:34849) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8Sr5-0003Ax-Ef for 3016@debbugs.gnu.org; Thu, 21 Feb 2013 04:54:22 -0500 Original-Received: from GUNGNIR.med.osaka-cu.ac.jp (unknown [114.179.36.76]) by msa103.auone-net.jp (au one net msa) with ESMTP id 4FC6134803B; Thu, 21 Feb 2013 18:53:01 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.3.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71588 Archived-At: 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