From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: todo-mode: saving widens buffer (again) Date: Mon, 22 Jul 2002 13:38:34 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1027337964 18090 127.0.0.1 (22 Jul 2002 11:39:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 22 Jul 2002 11:39:24 +0000 (UTC) Cc: steve@ims.uni-stuttgart.de Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17WbX9-0004hf-00 for ; Mon, 22 Jul 2002 13:39:23 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Wbky-0002W7-00 for ; Mon, 22 Jul 2002 13:53:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17WbXA-0001PP-00; Mon, 22 Jul 2002 07:39:24 -0400 Original-Received: from steve.ims.uni-stuttgart.de ([141.58.127.232]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17WbWO-0001Op-00 for ; Mon, 22 Jul 2002 07:38:36 -0400 Original-Received: (from steve@localhost) by steve.ims.uni-stuttgart.de (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) id g6MBcYO01467; Mon, 22 Jul 2002 13:38:34 +0200 X-Authentication-Warning: steve.ims.uni-stuttgart.de: steve set sender to steve@ims.uni-stuttgart.de using -f Mail-Followup-To: steve@ims.uni-stuttgart.de Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i686-pc-linux-gnu) Original-Lines: 68 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5963 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5963 A change in the development version of todo-mode.el seems to have reintroduced a bug that Daniel Ortmann reported in gnu.emacs.bug on 27 Oct 2001: > Pressing "s" for save in "todo-mode" mistakenly widens the buffer. It > should not widen. On 12 Nov 2001 I offered the following fix: cut========================================================== --- todo-mode-1.34.el Thu Jun 14 23:20:01 2001 +++ todo-mode-1.34-srb0.el Sat Nov 10 21:05:50 2001 @@ -708,9 +708,11 @@ (defun todo-save () "Save the TODO list." (interactive) - (save-buffer) - (if todo-save-top-priorities-too (todo-save-top-priorities)) - ) + (save-excursion + (save-restriction + (save-buffer) + (if todo-save-top-priorities-too (todo-save-top-priorities)) + ))) (defalias 'todo-cmd-save 'todo-save) (defun todo-quit () "Done with TODO list for now." cut========================================================== (My patch was against the version of todo-mode I was using at the time, but it was also valid for the version included in Emacs 21.1.1, for which the bug had been reported.) This fix was incorporated into Emacs 21.2.1 (todo-mode.el,v 1.47.4.1) but in the current development version (todo-mode.el,v 1.50), it has been changed as follows: (defun todo-save () "Save the TODO list." (interactive) (save-excursion (save-restriction (save-buffer))) (if todo-save-top-priorities-too (todo-save-top-priorities))) I used this version of todo-save for some time with no problems, also in conjunction with extensive changes I have made to todo-mode (submitted to bug-gnu-emacs on 29 May 2002), but recently, I have repeatedly experienced that invoking it widens the buffer again. This behavior has been inconsistent and I am not certain what is causing it -- it may be related to my other changes, although these did not include further changes to todo-save, nor any changes to todo-save-top-priorities; but I don't have time for more extensive testing at present. I don't know why the placement of the `if' form in todo-save was changed in the development tree, but it appears that putting the `if' form back inside save-restriction reliably prevents this widening, and I haven't noticed any unwelcome effects of doing so. Therefore, I suggest reverting to v1.47.4.1 to avoid this problem. When I have a chance, I'll try to investigate this further; in the mean time, if anyone can -- or fails to -- corroborate my experience by using v1.50, with or without my extensions to todo-mode, I'd appreciate hearing about it. (If anyone responds to this and wants a more or less quick response from me, please CC: my email address, as I am not able to regularly follow the list.) --Steve Berman