Use a command such as this one, binding it to a key:
(defun my-bookmark-file-switch (bookmark)
"Prompt for a bookmark-file BOOKMARK and switch to that bookmark file."
(interactive
(let ((alist (bmkp-bookmark-file-alist-only)))
(list (bmkp-read-bookmark-for-type "bookmark-file" alist nil nil
'bmkp-bookmark-file-history))))
(let ((file (bookmark-prop-get bookmark 'bookmark-file)))
(bookmark-load file t 'save)))
This command first saves the current bookmark list to the current bookmark file, before switching to the new bookmark file. If you do not want that behavior (you want to just abandon any unsaved changes to the current bookmark list) then replace save
in this code with just t
.
But as always, back up your current bookmark file before trying this or other new bookmark code.
UPDATE:
I've now added these two commands to Bookmark+: bmkp-bookmark-file-load-jump
, bmkp-bookmark-file-switch-jump
They are like bmkp-bookmark-file-jump
(C-x j y
), but they do not prompt for prior saving or confirmation. The second of these is what you requested.
C-x j
? Vanilla Emacs doesn't have such key binding.C-x j y
is bound, by default, tobmkp-bookmark-file-jump
, which loads a bookmark file.