From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41691: [PATCH] Add bookmark-jump-other-tab Date: Thu, 11 Jun 2020 00:50:21 +0300 Message-ID: <87v9jyocea.fsf@mail.linkov.net> References: <20200603163925.11161-1-pirata@gmail.com> <87bllzvjov.fsf@mail.linkov.net> <87y2p2gzvs.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="125135"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) To: 41691@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 10 23:57:18 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jj8ij-000WW7-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jun 2020 23:57:17 +0200 Original-Received: from localhost ([::1]:49010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jj8ii-0000ZR-Oj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jun 2020 17:57:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jj8iU-0000Wo-LO for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2020 17:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jj8iU-0005qY-BP for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2020 17:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jj8iU-0005Bi-9Q for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2020 17:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jun 2020 21:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41691 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 41691-submit@debbugs.gnu.org id=B41691.159182619119878 (code B ref 41691); Wed, 10 Jun 2020 21:57:02 +0000 Original-Received: (at 41691) by debbugs.gnu.org; 10 Jun 2020 21:56:31 +0000 Original-Received: from localhost ([127.0.0.1]:35512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jj8hz-0005AY-88 for submit@debbugs.gnu.org; Wed, 10 Jun 2020 17:56:31 -0400 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:43545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jj8hx-0005AF-1y for 41691@debbugs.gnu.org; Wed, 10 Jun 2020 17:56:29 -0400 Original-Received: from mail.gandi.net (m91-129-108-6.cust.tele2.ee [91.129.108.6]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 2549B240002 for <41691@debbugs.gnu.org>; Wed, 10 Jun 2020 21:56:21 +0000 (UTC) In-Reply-To: <87y2p2gzvs.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 05 Jun 2020 02:34:23 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181833 Archived-At: --=-=-= Content-Type: text/plain >> Then after typing 'C-x t t' as a prefix key sequence, >> the next command will display its buffer in a new tab: Now here is a patch for doing the same for a new window with 'C-x 4 4', and a new frame with 'C-x 5 5': --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=other-window-frame.patch diff --git a/lisp/window.el b/lisp/window.el index b6f44341e8..c3d1a775b7 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4005,6 +4005,22 @@ other-window ;; Always return nil. nil)))) +(defun other-window-prefix () + "Display the buffer of the next command in a new window. +The next buffer is the buffer displayed by the next command invoked +immediately after this command (ignoring reading from the minibuffer). +Creates a new window before displaying the buffer, or switches to the window +that already contains that buffer. +When `switch-to-buffer-obey-display-actions' is non-nil, +`switch-to-buffer' commands are also supported." + (interactive) + (display-buffer-override-next-command + (lambda (buffer alist) + (cons (display-buffer-pop-up-window + buffer (append alist '((inhibit-same-window . t)))) + 'window))) + (message "Display next command buffer in a new window...")) + ;; This should probably return non-nil when the selected window is part ;; of an atomic window whose root is the frame's root window. (defun one-window-p (&optional nomini all-frames) @@ -10131,5 +10147,6 @@ ctl-x-map (define-key ctl-x-map "-" 'shrink-window-if-larger-than-buffer) (define-key ctl-x-map "+" 'balance-windows) (define-key ctl-x-4-map "0" 'kill-buffer-and-window) +(define-key ctl-x-4-map "4" 'other-window-prefix) ;;; window.el ends here diff --git a/lisp/frame.el b/lisp/frame.el index 6c2f774709..25634fb445 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1070,6 +1070,23 @@ other-frame (setq arg (1+ arg))) (select-frame-set-input-focus frame))) +(defun other-frame-prefix () + "Display the buffer of the next command in a new frame. +The next buffer is the buffer displayed by the next command invoked +immediately after this command (ignoring reading from the minibuffer). +Creates a new frame before displaying the buffer, or switches to the frame +that already contains that buffer. +When `switch-to-buffer-obey-display-actions' is non-nil, +`switch-to-buffer' commands are also supported." + (interactive) + (display-buffer-override-next-command + (lambda (buffer alist) + (cons (display-buffer-pop-up-frame + buffer (append alist '((reusable-frames . 0) + (inhibit-same-window . t)))) + 'frame))) + (message "Display next command buffer in a new frame...")) + (defun iconify-or-deiconify-frame () "Iconify the selected frame, or deiconify if it's currently an icon." (interactive) @@ -2697,6 +2714,7 @@ ctl-x-5-map (define-key ctl-x-5-map "1" 'delete-other-frames) (define-key ctl-x-5-map "0" 'delete-frame) (define-key ctl-x-5-map "o" 'other-frame) +(define-key ctl-x-5-map "5" 'other-frame-prefix) (define-key global-map [f11] 'toggle-frame-fullscreen) (define-key global-map [(meta f10)] 'toggle-frame-maximized) (define-key esc-map [f10] 'toggle-frame-maximized) --=-=-=--