all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Change in list-buffers behavior in 24.4
@ 2015-04-12 16:00 Sam Varshavchik
  2015-04-13  2:44 ` Eli Zaretskii
  0 siblings, 1 reply; 24+ messages in thread
From: Sam Varshavchik @ 2015-04-12 16:00 UTC (permalink / raw)
  To: help-gnu-emacs

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

I typically have only one buffer window open, and my programmed muscle  
memory includes the sequence ^X-2-^X-^B.

This used to result in the cursor ending up in one window, and the buffer  
list in the other window.

After upgrading to 24.4, it seems that the cursor now winds up in the buffer  
list's window.

It looks like that with one window open, ^X-^B ends up doing what ^X-2-^X-^B  
used to do. Instead of retraining my fingers, I'm hoping that it's possible  
to flip some knob, and restore the previous behavior, but list-buffers' help  
is silent on this subject matter.


[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread
* bug#20206: 25.0.50; [PATCH] keep diff-mode's window visible when we visit sources from diff-mode
@ 2015-03-26 18:25 Dima Kogan
  2015-03-26 18:41 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Dima Kogan @ 2015-03-26 18:25 UTC (permalink / raw)
  To: 20206

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

When looking at a patch in diff-mode, one can visit the sources being
patched with several functions, for instance (diff-goto-source). This
patch makes sure that the source buffer does not cover up the diff-mode
buffer in its window, but uses any other window instead.

This really is a continuation of bug 20034 (and 17675 and 19901). I feel
like the earlier display-buffer implementation had a nicer default in
this regard. Should we keep adding this patch wherever a user operation
on a buffer can cause a different buffer to be displayed, or should
display-buffer defaults be changed to make the "don't steal user's
focus" behavior the default?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-keep-diff-mode-s-window-visible-when-we-visit-source.patch --]
[-- Type: text/x-diff, Size: 2784 bytes --]

From fa88533777a500784cb5def1733aa182c6bd4135 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Thu, 26 Mar 2015 11:21:06 -0700
Subject: [PATCH] keep diff-mode's window visible when we visit sources from
 diff-mode

When looking at a patch in diff-mode, one can visit the sources being
patched with several functions, for instance (diff-goto-source).  This
patch makes sure that the source buffer does not cover up the
diff-mode buffer in its window, but uses any other window instead
---
 lisp/vc/diff-mode.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index a9614e9..15cdae9 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1318,7 +1318,7 @@ See `after-change-functions' for the meaning of BEG, END and LEN."
   ;; Select a window that displays the current buffer so that point
   ;; movements are reflected in that window.  Otherwise, the user might
   ;; never see the hunk corresponding to the source she's jumping to.
-  (pop-to-buffer (current-buffer))
+  (pop-to-buffer (current-buffer) '(display-buffer-use-some-window (inhibit-same-window . t)))
   (if reset (goto-char (point-min)))
   (diff-hunk-next arg)
   (diff-goto-source))
@@ -1801,7 +1801,7 @@ With a prefix argument, REVERSE the hunk."
 	(delete-region (car pos) (cdr pos))
 	(insert (car new)))
       ;; Display BUF in a window
-      (set-window-point (display-buffer buf) (+ (car pos) (cdr new)))
+      (set-window-point (display-buffer buf '(display-buffer-use-some-window (inhibit-same-window . t))) (+ (car pos) (cdr new)))
       (diff-hunk-status-msg line-offset (diff-xor switched reverse) nil)
       (when diff-advance-after-apply-hunk
 	(diff-hunk-next))))))
@@ -1813,7 +1813,7 @@ With a prefix argument, try to REVERSE the hunk."
   (interactive "P")
   (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
                (diff-find-source-location nil reverse)))
-    (set-window-point (display-buffer buf) (+ (car pos) (cdr src)))
+    (set-window-point (display-buffer buf '(display-buffer-use-some-window (inhibit-same-window . t))) (+ (car pos) (cdr src)))
     (diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
 
 
@@ -1843,7 +1843,7 @@ then `diff-jump-to-old-file' is also set, for the next invocations."
   (let ((rev (not (save-excursion (beginning-of-line) (looking-at "[-<]")))))
     (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
                  (diff-find-source-location other-file rev)))
-      (pop-to-buffer buf)
+      (pop-to-buffer buf '(display-buffer-use-some-window (inhibit-same-window . t)))
       (goto-char (+ (car pos) (cdr src)))
       (diff-hunk-status-msg line-offset (diff-xor rev switched) t))))
 
-- 
2.1.4


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

end of thread, other threads:[~2019-06-25 18:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 16:00 Change in list-buffers behavior in 24.4 Sam Varshavchik
2015-04-13  2:44 ` Eli Zaretskii
2015-04-13  3:53   ` Sam Varshavchik
2015-04-13 12:14     ` martin rudalics
2015-04-13 14:34       ` bug#20206: 25.0.50; [PATCH] keep diff-mode's window visible when we visit sources from diff-mode Eli Zaretskii
2015-04-14 15:51         ` martin rudalics
2015-04-14 12:43       ` Change in list-buffers behavior in 24.4 Sam Varshavchik
2015-04-14 14:43         ` Eli Zaretskii
2015-04-13 14:31     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2015-03-26 18:25 bug#20206: 25.0.50; [PATCH] keep diff-mode's window visible when we visit sources from diff-mode Dima Kogan
2015-03-26 18:41 ` Eli Zaretskii
2015-03-26 18:58 ` martin rudalics
2015-03-28  6:01   ` Dima Kogan
2015-03-28  9:58     ` martin rudalics
2015-03-28 21:44       ` Dima Kogan
2015-03-29 18:00         ` martin rudalics
2015-03-29 20:06           ` Dima Kogan
2015-03-30  8:37             ` martin rudalics
2015-03-28 21:53   ` Dima Kogan
2015-03-29 18:01     ` martin rudalics
2015-03-29 19:48       ` Dima Kogan
2015-03-30  8:37         ` martin rudalics
2019-06-25 17:33 ` Lars Ingebrigtsen
2019-06-25 18:10   ` Dima Kogan

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.