unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Howard Melman <hmelman@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Adding missing C-x 5 C-j and C-x t C-j commands
Date: Wed, 08 Jun 2022 19:08:24 +0300	[thread overview]
Message-ID: <865ylbkuiv.fsf@mail.linkov.net> (raw)
In-Reply-To: <C89F3675-6617-463E-88CC-0F0A14721E05@gmail.com> (Howard Melman's message of "Wed, 8 Jun 2022 08:27:33 -0400")

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

>>> I have a question the other way.  I forgot that `C-x 5 .'
>>> exists and tried `C-x 5 5 M-.' and was surprised to find it
>>> didn't work (it opened in the same frame as if I just did
>>> `M-.'.  Is it supposed to work or should I open a bug?
>>
>> It does the right thing after customizing
>> switch-to-buffer-obey-display-actions to t.
>
> Yes I see that too.
>
>> Maybe its default value should be changed to t?
>
> At least the docstring of other-frame-prefix (and friends) should
> be clearer about it's effect. I don't think I'm supposed to know
> which commands use switch-to-buffer internally.

Maybe more commands should use pop-to-buffer-same-window
instead of switch-to-buffer.  But OTOH, too much commands
already use switch-to-buffer.

> If the default value isn't changed, maybe other-frame-prefix
> should let bind it to t since if you're using it you presumably
> want a new frame.  Same for the window and tab variants.
> project.el seems to do this in project--other-place-command
> which the project-other-{frame,window,tab}-commands use.

I'm not sure if the default value can be changed,
but you are right about other-frame-prefix.
I didn't know that project--other-place-command
let binds it to t.  But doing the same is not possible
in other-frame-prefix, that just sets a display action
for the next command.  So a more elaborate fix is required:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: obey-display.patch --]
[-- Type: text/x-diff, Size: 1294 bytes --]

diff --git a/lisp/window.el b/lisp/window.el
index 1b8fe2b262..eba888a89d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8931,6 +8931,7 @@ display-buffer-override-next-command
   (let* ((old-window (or (minibuffer-selected-window) (selected-window)))
          (new-window nil)
          (minibuffer-depth (minibuffer-depth))
+         (obey-display switch-to-buffer-obey-display-actions)
          (clearfun (make-symbol "clear-display-buffer-overriding-action"))
          (postfun (make-symbol "post-display-buffer-override-next-command"))
          (action (lambda (buffer alist)
@@ -8955,6 +8956,7 @@ display-buffer-override-next-command
               (funcall post-function old-window new-window)))))
     (fset clearfun
           (lambda ()
+            (setq switch-to-buffer-obey-display-actions obey-display)
             (setcar display-buffer-overriding-action
                     (delq action (car display-buffer-overriding-action)))))
     (fset postfun
@@ -8971,6 +8973,7 @@ display-buffer-override-next-command
     (add-hook 'post-command-hook postfun)
     (when echofun
       (add-hook 'prefix-command-echo-keystrokes-functions echofun))
+    (setq switch-to-buffer-obey-display-actions t)
     (push action (car display-buffer-overriding-action))
     exitfun))
 

  reply	other threads:[~2022-06-08 16:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 19:53 Adding missing C-x 5 C-j and C-x t C-j commands Sean Whitton
2022-05-23  2:24 ` Eli Zaretskii
2022-05-23  4:57   ` Sean Whitton
2022-05-23  4:59     ` Sean Whitton
2022-05-23  7:56       ` Juri Linkov
2022-05-23  9:16         ` Eli Zaretskii
2022-05-23 13:54           ` Sean Whitton
2022-05-23 14:07             ` Eli Zaretskii
2022-05-23 20:52               ` Sean Whitton
2022-05-23 13:35         ` Sean Whitton
2022-05-23 12:26     ` Stefan Monnier
2022-05-23 16:52       ` Juri Linkov
2022-06-07 20:17         ` Howard Melman
2022-06-08  2:29           ` Eli Zaretskii
2022-06-08  6:40           ` Juri Linkov
2022-06-08 12:27             ` Howard Melman
2022-06-08 16:08               ` Juri Linkov [this message]
2022-06-08 19:17                 ` Howard Melman
2022-06-09  2:41                   ` Howard Melman
2022-06-09  6:44                     ` Juri Linkov
2022-06-09  5:02                   ` Eli Zaretskii
2022-06-09  6:42                     ` Juri Linkov

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=865ylbkuiv.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=emacs-devel@gnu.org \
    --cc=hmelman@gmail.com \
    /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).