From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel 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 Organization: LINKOV.NET Message-ID: <865ylbkuiv.fsf@mail.linkov.net> References: <87a6b9xs22.fsf@athena.silentflame.com> <83fsl16l5l.fsf@gnu.org> <871qwkyhfx.fsf@athena.silentflame.com> <86v8twyyx9.fsf@mail.linkov.net> <86mtenmzea.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11072"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Howard Melman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 08 18:32:15 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyybO-0002jK-BI for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jun 2022 18:32:14 +0200 Original-Received: from localhost ([::1]:45114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyybN-0000xT-5w for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jun 2022 12:32:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyyYD-0007rf-FH for emacs-devel@gnu.org; Wed, 08 Jun 2022 12:28:58 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:39103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyyYB-0004o6-54 for emacs-devel@gnu.org; Wed, 08 Jun 2022 12:28:57 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C9918FF80E; Wed, 8 Jun 2022 16:28:51 +0000 (UTC) In-Reply-To: (Howard Melman's message of "Wed, 8 Jun 2022 08:27:33 -0400") Received-SPF: pass client-ip=217.70.183.199; envelope-from=juri@linkov.net; helo=relay9-d.mail.gandi.net X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, GAPPY_SUBJECT=0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290948 Archived-At: --=-=-= Content-Type: text/plain >>> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=obey-display.patch 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)) --=-=-=--