unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: 19727@debbugs.gnu.org
Subject: bug#19727: 25.0.50; setting a todo item to done puts point at the end of the buffer
Date: Thu, 29 Jan 2015 11:10:47 +0100	[thread overview]
Message-ID: <827fw5oq1k.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

Hi,

when I set an item to done in a todo-mode buffer, point ends up at the
end of the buffer, which is somewhat surprising. Attached patch
remembers where point was, and restores it.

Regards

Robert

In GNU Emacs 25.0.50.6 (i686-pc-cygwin)
 of 2015-01-28 on RPLUIM
Repository revision: 8a8bd38fedb89b2d04cca2419698813a22862c3b
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-w32 --with-wide-int'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: todo-mode-done-restore-point.patch --]
[-- Type: text/x-patch, Size: 987 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 90681c8..060cbf7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-26  Robert Pluim  <rpluim@gmail.com>
+
+	* calendar/todo-mode.el (todo-item-done): Initialize opoint so
+	that point stays where it is when setting items to DONE.
+
 2015-01-28  Tassilo Horn  <tsdh@gnu.org>
 
 	* textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and )
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 7ca57a4..2fb7e2e 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2816,7 +2816,8 @@ (defun todo-item-done (&optional arg)
 			  (goto-char (point-min))
 			  (re-search-forward todo-done-string-start nil t)))
 	     (buffer-read-only nil)
-	     item done-item opoint)
+	     item done-item
+	     (opoint (point)))
 	;; Don't add empty comment to done item.
 	(setq comment (unless (zerop (length comment))
 			(concat " [" todo-comment-string ": " comment "]")))

             reply	other threads:[~2015-01-29 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 10:10 Robert Pluim [this message]
2015-02-03 22:39 ` bug#19727: 25.0.50; setting a todo item to done puts point at the end of the buffer Stephen Berman
2015-02-04 12:48   ` Robert Pluim
2015-02-04 21:46     ` Stephen Berman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=827fw5oq1k.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=19727@debbugs.gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).