help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Alerts for saves to non-existent files


From: Raffaele Ricciardi
Subject: Re: Alerts for saves to non-existent files
Date: Fri, 31 Aug 2012 15:19:33 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120824 Thunderbird/15.0

On 31/08/12 13:35, kj wrote:
In <slrnk3sit9.dkp.joostkremers@j.kremers4.news.arnhem.chello.nl> Joost Kremers 
<joostkremers@yahoo.com> writes:

kj wrote:
Is there a way to tell Emacs that, from now on, it should save all
changes to this buffer to the new path (and preferably without
asking for any additional confirmation)?

you can use C-x C-w to save a buffer to another file. that doesn't delete
the original file, but using C-x C-w and then deleting the original file
should cause less vexation than your current scenario. ;-)


No, that doesn't address the problem I tried (but clearly failed)
to describe.  I want to prevent cases in which I *inadvertently*
do C-x C-s, forgetting/not realizing that the current value of
buffer-file-name is a non-existent path.

In fact, I'd be completely satisfied if in such situations Emacs
handled C-x C-s in basically the same way it does for buffers (e.g.
*scratch* or *shell*) whose buffer-file-name is nil, namely by
prompting the user for a "File to save in: ...".  The only difference
between these two cases would be that in the former one, the proposed
path following the prompt would be the (non-existent) path currently
in buffer-file-name, while in the latter it is only directory
prefix, to which the user must add a basename.


C-h v before-save-hook RET


reply via email to

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