all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Sent <richard@freakingpenguin.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: martin rudalics <rudalics@gmx.at>, Eli Zaretskii <eliz@gnu.org>,
	70819@debbugs.gnu.org
Subject: bug#70819: [PATCH] Make clone-indirect-buffer-other-window use other window
Date: Sun, 12 May 2024 23:14:19 -0400	[thread overview]
Message-ID: <87v83ipfn8.fsf_-_@freakingpenguin.com> (raw)
In-Reply-To: <jwvikziwism.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 12 May 2024 22:26:28 -0400")

Previously, depending on the settings in display-buffer-alist,
clone-indirect-buffer-other-window would display the cloned buffer in
the original window, behaving identically to clone-indirect-buffer with
a non-nil display-flag. This behavior was inconsistent with other-window
commands, which always used another window.

Now, clone-indirect-buffer-other-window uses
switch-to-buffer-other-window. This means it uses the same logic as
other-window commands like find-file-other-window and info-other-window
and its behavior is more consistent.

Because there is no reason for an other-window command to take a
display-flag argument, the argument was removed.

* lisp/simple.el: (clone-indirect-buffer-other-window): Use
switch-to-buffer-other-window and remove display-flag.
---
That makes sense to me, no complaints and things work as expected given
the change you suggest. Thank you all for taking the time to look into
this!

Hopefully this patch is sent successfully and makes things just a little
bit easier.

 lisp/simple.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index deab52c4201..0ab502c9f6b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10649,7 +10649,7 @@ Returns the newly created indirect buffer."
     buffer))
 
 
-(defun clone-indirect-buffer-other-window (newname display-flag &optional norecord)
+(defun clone-indirect-buffer-other-window (newname &optional norecord)
   "Like `clone-indirect-buffer' but display in another window."
   (interactive
    (progn
@@ -10658,8 +10658,8 @@ Returns the newly created indirect buffer."
      (list (if current-prefix-arg
 	       (read-buffer "Name of indirect buffer: " (current-buffer)))
 	   t)))
-  (let ((pop-up-windows t))
-    (clone-indirect-buffer newname display-flag norecord)))
+  (switch-to-buffer-other-window
+   (clone-indirect-buffer newname nil norecord)))
 
 \f
 ;;; Handling of Backspace and Delete keys.
-- 
2.41.0






  reply	other threads:[~2024-05-13  3:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 16:19 bug#70819: 29.3; clone-indirect-buffer-other-window is inconsistent with *-other-window commands Richard Sent
2024-05-11  9:29 ` Eli Zaretskii
2024-05-12  8:30   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-13  2:26   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-13  3:14     ` Richard Sent [this message]
2024-05-13  5:22       ` bug#70819: [PATCH] Make clone-indirect-buffer-other-window use other window Eli Zaretskii
2024-05-13  8:05       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-25  7:49         ` Eli Zaretskii
2024-06-08 11:45           ` Eli Zaretskii
2024-06-08 13:29             ` Eli Zaretskii
2024-05-27 15:32 ` bug#70819: [PATCH v2] Make clone-indirect-buffer-other-window use other window (bug#70819) Richard Sent
2024-05-28  8:04   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-08 12:18   ` Eli Zaretskii

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=87v83ipfn8.fsf_-_@freakingpenguin.com \
    --to=richard@freakingpenguin.com \
    --cc=70819@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /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.