all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27121: 26.0.50; Todo-mode buffer becomes current too soon
@ 2017-05-28 20:40 Stephen Berman
  2017-05-29  9:09 ` Stephen Berman
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Berman @ 2017-05-28 20:40 UTC (permalink / raw)
  To: 27121

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

If you're in todo-mode and you type `q' to exit it, and in the buffer
that is now current you invoke quit-window, then the todo-mode buffer
becomes current again.  But it was supposed to have been buried by `q',
so it should not immediately become current again.

This problem is due to a faulty use of bury-buffer in commit ea3ae33b
from 2013-05-16, and it's annoyed me ever since, but I didn't bother to
do anything about it till now.


2017-05-28  Stephen Berman  <stephen.berman@gmx.net>

	Prevent buried todo-mode buffer from being current too soon

	This happened due to commit ea3ae33b from 2013-05-16, which
	prevented quitting todo-mode buffer after visiting
	todo-archive buffer from making the archive buffer current
	again.  Avoid this now by simply killing the archive buffer,
	since there's no need to keep it a live buffer.  Consequently,
	quitting a todo-mode buffer can now use bury-buffer without an
	argument, which ensures that is will not becomes current on
	quitting the next buffer.

	* lisp/calendar/todo-mode.el (todo-quit): Kill todo-archive-mode
	buffer instead of burying it.  This now allows exiting the
	todo-mode buffer with bury-buffer without an argument, so do that.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: todo-quit patch --]
[-- Type: text/x-patch, Size: 905 bytes --]

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 5d4fcf8fcb..8155a4241a 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -820,14 +820,10 @@ todo-quit
 	       (message "There is no todo file for this archive")))
 	   ;; When todo-check-file runs in todo-show, it kills the
 	   ;; buffer if the archive file was deleted externally.
-	   (when (buffer-live-p buf) (bury-buffer buf)))
+	   (when (buffer-live-p buf) (kill-buffer buf)))
 	  ((eq major-mode 'todo-mode)
 	   (todo-save)
-	   ;; If we just quit archive mode, just burying the buffer
-	   ;; in todo-mode would return to archive.
-	   (set-window-buffer (selected-window)
-			      (set-buffer (other-buffer)))
-	   (bury-buffer buf)))))
+	   (bury-buffer)))))
 
 ;; -----------------------------------------------------------------------------
 ;;; Navigation between and within categories

[-- Attachment #3: Type: text/plain, Size: 247 bytes --]



In GNU Emacs 26.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version 3.22.8)
 of 2017-05-27 built on rosalinde
Repository revision: 527a7cc9425370f7217a4d2b6914b96dff6f5ec1
Windowing system distributor 'The X.Org Foundation', version 11.0.11901000

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#27121: 26.0.50; Todo-mode buffer becomes current too soon
  2017-05-28 20:40 bug#27121: 26.0.50; Todo-mode buffer becomes current too soon Stephen Berman
@ 2017-05-29  9:09 ` Stephen Berman
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Berman @ 2017-05-29  9:09 UTC (permalink / raw)
  To: 27121-done

On Sun, 28 May 2017 22:40:26 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> If you're in todo-mode and you type `q' to exit it, and in the buffer
> that is now current you invoke quit-window, then the todo-mode buffer
> becomes current again.  But it was supposed to have been buried by `q',
> so it should not immediately become current again.
>
> This problem is due to a faulty use of bury-buffer in commit ea3ae33b
> from 2013-05-16, and it's annoyed me ever since, but I didn't bother to
> do anything about it till now.

Committed in d76c007.

Steve Berman





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-29  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-28 20:40 bug#27121: 26.0.50; Todo-mode buffer becomes current too soon Stephen Berman
2017-05-29  9:09 ` Stephen Berman

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.