In Emacs I can do C-x 5 C-f or C-x 5 f to find a file in a new frame. I want to do something similar but for bookmarks. How can I jump to a bookmark in a new frame?

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

There is bookmark-jump-other-window which you can clone and modify to create the function my-bookmark-jump-other-frame:

(defun my-bookmark-jump-other-frame (bookmark)
  "Jump to BOOKMARK in another frame.  See `bookmark-jump' for more."
  (interactive
   (list (bookmark-completing-read "Jump to bookmark (in another frame)"
                                   bookmark-current-bookmark)))
  (bookmark-jump bookmark 'switch-to-buffer-other-frame))

Bind that function to a key chord of your liking and use it to open bookmarks in another frame, e.g. like that:

(global-set-key (kbd "C-x C-5 b") 'my-bookmark-jump-other-frame)

Note that my-bookmark-jump-other-frame still needs bookmark.el and its functions. Make sure the appropriate functions are loaded in your startup file, e.g.:

(require 'bookmark)

or

(autoload 'bookmark-completing-read "bookmark"
 "Prompting with PROMPT ...[rest of docstring (optional)]")
link|improve this answer
That seems to work. Could you please include an appropriate way to bind a key for completeness? I figure that C-x C-5 b is an appropriate bind since it seems unbound and it is similar to the normal jump to bookmark, C-x r b, and also to find file in new frame. – N.N. Jan 18 at 9:55
You can e.g. use (global-set-key (kbd "C-x C-5 b") 'my-bookmark-jump-other-frame). – u-punkt Jan 18 at 10:51
I have encountered a problem with your solution. If I try to use it before I have used bookmarks in any other way during a session I get "list: Symbol's function definition is void: bookmark-completing-read". However, if I jump to a bookmark some other way, e.g. C-x r b and then try M-x my-bookmark-jump-other-frame it works. Can this be solved? – N.N. Jan 18 at 16:27
A (require 'bookmark) in your startup file should do. If you don't want to load bookmark.el unconditionally on each startup you could also use (autoload 'bookmark-completing-read "bookmark" "Prompting with PROMPT ... (plus rest of docstring from bookmark.el (optional))"). – u-punkt Jan 19 at 8:24
Could you please include that info and a full description of the autoload solution in the answer? I am unfamiliar with how to complete it. – N.N. Jan 19 at 8:33
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.