diff options
| author | Pierre-Yves Luyten | 2018-10-13 22:06:41 +0200 |
|---|---|---|
| committer | Karl Fogel | 2018-11-08 16:37:23 -0800 |
| commit | f3345dee4b40293547d10963c6cb242a62e424ba (patch) | |
| tree | 4230ab50630090149788241c8b01ac5a44c50da8 | |
| parent | 3450970dacd73506ef3d6eed6709375be5ccf2b6 (diff) | |
| download | emacs-f3345dee4b40293547d10963c6cb242a62e424ba.tar.gz emacs-f3345dee4b40293547d10963c6cb242a62e424ba.zip | |
Add functions to open a bookmark in another frame
* lisp/bookmark.el (bookmark-jump-other-frame): New function.
Bind in bookmark-map.
(bookmark-bmenu-other-frame): New function.
Bind in bookmark-bmenu-mode-map.
Patch applied by Karl Fogel.
| -rw-r--r-- | lisp/bookmark.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 58a279473d0..15a841e208c 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -209,6 +209,7 @@ A non-nil value may result in truncated bookmark names." | |||
| 209 | (define-key map "j" 'bookmark-jump) | 209 | (define-key map "j" 'bookmark-jump) |
| 210 | (define-key map "g" 'bookmark-jump) ;"g"o | 210 | (define-key map "g" 'bookmark-jump) ;"g"o |
| 211 | (define-key map "o" 'bookmark-jump-other-window) | 211 | (define-key map "o" 'bookmark-jump-other-window) |
| 212 | (define-key map "5" 'bookmark-jump-other-frame) | ||
| 212 | (define-key map "i" 'bookmark-insert) | 213 | (define-key map "i" 'bookmark-insert) |
| 213 | (define-key map "e" 'edit-bookmarks) | 214 | (define-key map "e" 'edit-bookmarks) |
| 214 | (define-key map "f" 'bookmark-insert-location) ;"f"ind | 215 | (define-key map "f" 'bookmark-insert-location) ;"f"ind |
| @@ -1124,6 +1125,14 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'." | |||
| 1124 | bookmark-current-bookmark))) | 1125 | bookmark-current-bookmark))) |
| 1125 | (bookmark-jump bookmark 'switch-to-buffer-other-window)) | 1126 | (bookmark-jump bookmark 'switch-to-buffer-other-window)) |
| 1126 | 1127 | ||
| 1128 | ;;;###autoload | ||
| 1129 | (defun bookmark-jump-other-frame (bookmark) | ||
| 1130 | "Jump to BOOKMARK in another frame. See `bookmark-jump' for more." | ||
| 1131 | (interactive | ||
| 1132 | (list (bookmark-completing-read "Jump to bookmark (in another frame)" | ||
| 1133 | bookmark-current-bookmark))) | ||
| 1134 | (let ((pop-up-frames t)) | ||
| 1135 | (bookmark-jump-other-window bookmark))) | ||
| 1127 | 1136 | ||
| 1128 | (defun bookmark-jump-noselect (bookmark) | 1137 | (defun bookmark-jump-noselect (bookmark) |
| 1129 | "Return the location pointed to by BOOKMARK (see `bookmark-jump'). | 1138 | "Return the location pointed to by BOOKMARK (see `bookmark-jump'). |
| @@ -1561,6 +1570,7 @@ unique numeric suffixes \"<2>\", \"<3>\", etc." | |||
| 1561 | (set-keymap-parent map special-mode-map) | 1570 | (set-keymap-parent map special-mode-map) |
| 1562 | (define-key map "v" 'bookmark-bmenu-select) | 1571 | (define-key map "v" 'bookmark-bmenu-select) |
| 1563 | (define-key map "w" 'bookmark-bmenu-locate) | 1572 | (define-key map "w" 'bookmark-bmenu-locate) |
| 1573 | (define-key map "5" 'bookmark-bmenu-other-frame) | ||
| 1564 | (define-key map "2" 'bookmark-bmenu-2-window) | 1574 | (define-key map "2" 'bookmark-bmenu-2-window) |
| 1565 | (define-key map "1" 'bookmark-bmenu-1-window) | 1575 | (define-key map "1" 'bookmark-bmenu-1-window) |
| 1566 | (define-key map "j" 'bookmark-bmenu-this-window) | 1576 | (define-key map "j" 'bookmark-bmenu-this-window) |
| @@ -1702,6 +1712,7 @@ Bookmark names preceded by a \"*\" have annotations. | |||
| 1702 | \\[bookmark-bmenu-this-window] -- select this bookmark in place of the bookmark menu buffer. | 1712 | \\[bookmark-bmenu-this-window] -- select this bookmark in place of the bookmark menu buffer. |
| 1703 | \\[bookmark-bmenu-other-window] -- select this bookmark in another window, | 1713 | \\[bookmark-bmenu-other-window] -- select this bookmark in another window, |
| 1704 | so the bookmark menu bookmark remains visible in its window. | 1714 | so the bookmark menu bookmark remains visible in its window. |
| 1715 | \\[bookmark-bmenu-other-frame] -- select this bookmark in another frame. | ||
| 1705 | \\[bookmark-bmenu-switch-other-window] -- switch the other window to this bookmark. | 1716 | \\[bookmark-bmenu-switch-other-window] -- switch the other window to this bookmark. |
| 1706 | \\[bookmark-bmenu-rename] -- rename this bookmark (prompts for new name). | 1717 | \\[bookmark-bmenu-rename] -- rename this bookmark (prompts for new name). |
| 1707 | \\[bookmark-bmenu-relocate] -- relocate this bookmark's file (prompts for new file). | 1718 | \\[bookmark-bmenu-relocate] -- relocate this bookmark's file (prompts for new file). |
| @@ -1971,6 +1982,13 @@ With a prefix arg, prompts for a file to save them in." | |||
| 1971 | (bookmark--jump-via bookmark 'switch-to-buffer-other-window))) | 1982 | (bookmark--jump-via bookmark 'switch-to-buffer-other-window))) |
| 1972 | 1983 | ||
| 1973 | 1984 | ||
| 1985 | (defun bookmark-bmenu-other-frame () | ||
| 1986 | "Select this line's bookmark in other frame." | ||
| 1987 | (interactive) | ||
| 1988 | (let ((bookmark (bookmark-bmenu-bookmark)) | ||
| 1989 | (pop-up-frames t)) | ||
| 1990 | (bookmark-jump-other-window bookmark))) | ||
| 1991 | |||
| 1974 | (defun bookmark-bmenu-switch-other-window () | 1992 | (defun bookmark-bmenu-switch-other-window () |
| 1975 | "Make the other window select this line's bookmark. | 1993 | "Make the other window select this line's bookmark. |
| 1976 | The current window remains selected." | 1994 | The current window remains selected." |