From: Juri Linkov <juri@linkov.net>
To: 41691@debbugs.gnu.org
Subject: bug#41691: [PATCH] Add bookmark-jump-other-tab
Date: Thu, 11 Jun 2020 00:50:21 +0300 [thread overview]
Message-ID: <87v9jyocea.fsf@mail.linkov.net> (raw)
In-Reply-To: <87y2p2gzvs.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 05 Jun 2020 02:34:23 +0300")
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
>> 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':
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: other-window-frame.patch --]
[-- Type: text/x-diff, Size: 2935 bytes --]
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)
next prev parent reply other threads:[~2020-06-10 21:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 16:39 bug#41691: [PATCH] Add bookmark-jump-other-tab Javier Olaechea
2020-06-03 17:16 ` Glenn Morris
2020-06-03 23:00 ` Juri Linkov
2020-06-04 23:34 ` Juri Linkov
2020-06-06 23:42 ` Juri Linkov
2020-06-07 1:40 ` Javier Olaechea
2020-06-10 21:50 ` Juri Linkov [this message]
2020-06-21 23:18 ` Juri Linkov
2020-06-22 15:06 ` Eli Zaretskii
2020-06-28 22:00 ` Juri Linkov
2020-06-29 14:35 ` Eli Zaretskii
2020-06-29 22:52 ` Juri Linkov
2020-06-30 21:30 ` Juri Linkov
2020-07-01 14:34 ` 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=87v9jyocea.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=41691@debbugs.gnu.org \
/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.