[Top][All Lists]

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

Re: save-buffer when directory doesn't exist

From: Jason Spiro
Subject: Re: save-buffer when directory doesn't exist
Date: Tue, 20 Mar 2007 08:09:13 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

martin rudalics <rudalics <at> gmx.at> writes:
> Assume I modify *scratch* and try to `save-buffer' it as ".../bar/foo".
> (I know `write-file' should be used for this purpose but `save-buffer'
> offers the service as well.)  Assume further, I mistype the name as
> ".../baz/foo" where the subdirectory "baz" does not exist.  Emacs will
> complain as:
> basic-save-buffer-2: .../baz/foo: no such directory
> which is misleading since ".../baz/foo" is supposed to be a file.
> Assume now I notice my mistake and want to `save-buffer' *scratch* in
> the existing directory ".../bar/".  Emacs will insist on storing my
> buffer as ".../baz/foo" and continue telling me that such a directory
> doesn't exist.
> After a while `auto-save-mode' may kick in and add to my confusion by
> complaining
> Auto-saving foo: Opening output file: no such file or directory, .../baz/#foo#
> This confusion could be relieved by the attached patch.

I am not an Emacs developer, and I have not tested the patch (I am on a Windows
machine without Cygwin or patch(1) right now).  But Martin's problem seems to be
valid, and his patch seems like it will fix it.  Would it be helpful if I tested
the patch on my Linux PC?  I could check that it works and see if it does
something about the auto-save errors too.


reply via email to

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