From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: Re: Alerts for saves to non-existent files Date: Fri, 31 Aug 2012 15:19:33 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346423377 29891 80.91.229.3 (31 Aug 2012 14:29:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Aug 2012 14:29:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 31 16:29:36 2012 Return-path: Envelope-to: geh-help-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 1T7SE4-0004jk-Kg for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Aug 2012 16:29:36 +0200 Original-Received: from localhost ([::1]:53885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7S5i-0007Rl-RP for geh-help-gnu-emacs@m.gmane.org; Fri, 31 Aug 2012 10:20:58 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net kQs8JVqZTBF6f/9QHXl9EQ8D1feAqBn8IO5ZBBzmS4ViNC2AsWiKMw7+j/ueOlywKQ Cancel-Lock: sha1:XnfWSnIXJNsMP2s0Y7Crq2PRQUg= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: Original-Xref: usenet.stanford.edu gnu.emacs.help:194262 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86607 Archived-At: On 31/08/12 13:35, kj wrote: > In Joost Kremers 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