From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: auto-save-visited-file-name Date: Fri, 17 Oct 2003 16:46:22 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1066424409 27543 80.91.224.253 (17 Oct 2003 21:00:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Oct 2003 21:00:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Oct 17 23:00:07 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AAbhf-0006hz-00 for ; Fri, 17 Oct 2003 23:00:07 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AAbhf-0000gL-00 for ; Fri, 17 Oct 2003 23:00:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAbbI-0001tX-BY for emacs-devel@quimby.gnus.org; Fri, 17 Oct 2003 16:53:32 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AAbYa-00060r-PD for emacs-devel@gnu.org; Fri, 17 Oct 2003 16:50:44 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AAbXy-0005AT-OS for emacs-devel@gnu.org; Fri, 17 Oct 2003 16:50:37 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAbXy-00059w-9E for emacs-devel@gnu.org; Fri, 17 Oct 2003 16:50:06 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1AAbUM-0000kC-1H; Fri, 17 Oct 2003 16:46:22 -0400 Original-To: Stefan Monnier In-reply-to: (message from Stefan Monnier on 15 Oct 2003 14:59:33 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17226 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17226 Does this solve the problems you found with auto-save-visited-file-name? *** buffer.c.~1.438.~ Thu Sep 11 09:51:05 2003 --- buffer.c Fri Oct 17 11:37:36 2003 *************** *** 1429,1435 **** if (STRINGP (b->auto_save_file_name) && b->auto_save_modified != 0 && BUF_SAVE_MODIFF (b) < b->auto_save_modified ! && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) { Lisp_Object tem; tem = Fsymbol_value (intern ("delete-auto-save-files")); --- 1429,1436 ---- if (STRINGP (b->auto_save_file_name) && b->auto_save_modified != 0 && BUF_SAVE_MODIFF (b) < b->auto_save_modified ! && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) ! && NILP (Fsymbol_value (intern ("auto-save-visited-file-name")))) { Lisp_Object tem; tem = Fsymbol_value (intern ("delete-auto-save-files")); *** fileio.c.~1.494.~ Thu Sep 11 09:51:19 2003 --- fileio.c Fri Oct 17 11:35:48 2003 *************** *** 4684,4690 **** { Lisp_Object val; ! if (auto_saving) { /* We use emacs-mule for auto saving... */ setup_coding_system (Qemacs_mule, coding); --- 4684,4691 ---- { Lisp_Object val; ! if (auto_saving ! && ! NILP (Fsymbol_value (intern ("auto-save-visited-file-name")))) { /* We use emacs-mule for auto saving... */ setup_coding_system (Qemacs_mule, coding); *************** *** 5212,5218 **** error ("IO error writing %s: %s", SDATA (filename), emacs_strerror (save_errno)); ! if (visiting) { SAVE_MODIFF = MODIFF; XSETFASTINT (current_buffer->save_length, Z - BEG); --- 5213,5222 ---- error ("IO error writing %s: %s", SDATA (filename), emacs_strerror (save_errno)); ! if (visiting ! || (auto_saving ! && ! NILP (Fsymbol_value (intern ("auto-save-visited-file-name"))))) ! { SAVE_MODIFF = MODIFF; XSETFASTINT (current_buffer->save_length, Z - BEG); *************** *** 5775,5785 **** minibuffer_auto_raise = 0; auto_saving = 1; ! /* First, save all files which don't have handlers. If Emacs is ! crashing, the handlers may tweak what is causing Emacs to crash ! in the first place, and it would be a shame if Emacs failed to ! autosave perfectly ordinary files because it couldn't handle some ! ange-ftp'd file. */ for (do_handled_files = 0; do_handled_files < 2; do_handled_files++) for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail)) { --- 5779,5792 ---- minibuffer_auto_raise = 0; auto_saving = 1; ! /* On first pass, save all files that don't have handlers. ! On second pass, save all files that do have handlers. ! ! If Emacs is crashing, the handlers may tweak what is causing ! Emacs to crash in the first place, and it would be a shame if ! Emacs failed to autosave perfectly ordinary files because it ! couldn't handle some ange-ftp'd file. */ ! for (do_handled_files = 0; do_handled_files < 2; do_handled_files++) for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail)) {