all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Dmitry Gutov <dgutov@yandex.ru>
Cc: 20353@debbugs.gnu.org
Subject: bug#20353: M-. sometimes jumps in another window
Date: Tue, 21 Apr 2015 12:34:13 +0200	[thread overview]
Message-ID: <553627A5.3020809@gmx.at> (raw)
In-Reply-To: <jwv1tjethj0.fsf-monnier+emacsbugs@gnu.org>

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

> Right, the remembering might be part of pop-to-buffer and quit-window
> rather than part of xref.  Either way is fine by me.

Would the attached patch fix it?

martin



[-- Attachment #2: quit-window.diff --]
[-- Type: text/plain, Size: 857 bytes --]

--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5474,10 +5474,15 @@ element is BUFFER."
   (cond
    ((eq type 'reuse)
     (if (eq (window-buffer window) buffer)
-	;; WINDOW shows BUFFER already.
-	(when (consp (window-parameter window 'quit-restore))
-	  ;; If WINDOW has a quit-restore parameter, reset its car.
-	  (setcar (window-parameter window 'quit-restore) 'same))
+	;; WINDOW shows BUFFER already.  Update WINDOW's quit-restore
+	;; parameter, if any.
+	(let ((old (window-parameter window 'quit-restore)))
+	  (when (consp old)
+	    (set-window-parameter
+	     window 'quit-restore
+	     ;; The selected-window might have changed in between
+	     ;; (Bug#20353).
+	     (list 'same (nth 1 old) (selected-window) (nth 3 old)))))
       ;; WINDOW shows another buffer.
       (with-current-buffer (window-buffer window)
 	(set-window-parameter


  reply	other threads:[~2015-04-21 10:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17  5:03 bug#20353: M-. sometimes jumps in another window Stefan Monnier
2015-04-18  0:51 ` Dmitry Gutov
2015-04-18  4:46   ` Stefan Monnier
2015-04-18 23:21     ` Dmitry Gutov
2015-04-20 14:17       ` Stefan Monnier
2015-04-20 15:17         ` Dmitry Gutov
2015-04-20 19:28           ` Stefan Monnier
2015-04-20 19:37             ` Dmitry Gutov
2015-04-21  1:09               ` Stefan Monnier
2015-04-21 10:34                 ` martin rudalics [this message]
2015-04-21 13:42                   ` Dmitry Gutov
2015-04-22  9:33                     ` martin rudalics
2015-04-22 12:28                       ` Dmitry Gutov
2015-04-22 13:07                         ` martin rudalics
2015-05-20  9:46                           ` martin rudalics
2015-04-21 14:51                   ` Stefan Monnier

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=553627A5.3020809@gmx.at \
    --to=rudalics@gmx.at \
    --cc=20353@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=monnier@iro.umontreal.ca \
    /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.