all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <steve@ims.uni-stuttgart.de>
Cc: steve@ims.uni-stuttgart.de
Subject: todo-mode: saving widens buffer (again)
Date: Mon, 22 Jul 2002 13:38:34 +0200	[thread overview]
Message-ID: <m34resu01h.fsf@steve.ims.uni-stuttgart.de> (raw)

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

                 reply	other threads:[~2002-07-22 11:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34resu01h.fsf@steve.ims.uni-stuttgart.de \
    --to=steve@ims.uni-stuttgart.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.