Function: bookmark-jump

bookmark-jump is an autoloaded, interactive and byte-compiled function defined in bookmark.el.gz.

Signature

(bookmark-jump BOOKMARK &optional DISPLAY-FUNC)

Documentation

Jump to bookmark BOOKMARK (a point in some file).

You may have a problem using this function if the value of variable bookmark-alist is nil. If that happens, you need to load in some bookmarks. See help on function bookmark-load for more about this.

If the file pointed to by BOOKMARK no longer exists, you will be asked if you wish to give the bookmark a new location, and bookmark-jump will then jump to the new location, as well as recording it in place of the old one in the permanent bookmark record.

BOOKMARK is usually a bookmark name (a string). It can also be a bookmark record, but this is usually only done by programmatic callers.

If DISPLAY-FUNC is non-nil, it is a function to invoke to display the bookmark. It defaults to pop-to-buffer-same-window. A typical value for DISPLAY-FUNC would be switch-to-buffer-other-window.

View in manual

Probably introduced at or before Emacs version 19.29.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
;;;###autoload
(defun bookmark-jump (bookmark &optional display-func)
  "Jump to bookmark BOOKMARK (a point in some file).
You may have a problem using this function if the value of variable
`bookmark-alist' is nil.  If that happens, you need to load in some
bookmarks.  See help on function `bookmark-load' for more about
this.

If the file pointed to by BOOKMARK no longer exists, you will be asked
if you wish to give the bookmark a new location, and `bookmark-jump'
will then jump to the new location, as well as recording it in place
of the old one in the permanent bookmark record.

BOOKMARK is usually a bookmark name (a string).  It can also be a
bookmark record, but this is usually only done by programmatic callers.

If DISPLAY-FUNC is non-nil, it is a function to invoke to display the
bookmark.  It defaults to `pop-to-buffer-same-window'.  A typical value for
DISPLAY-FUNC would be `switch-to-buffer-other-window'."
  (interactive
   (list (bookmark-completing-read "Jump to bookmark"
				   bookmark-current-bookmark)))
  (unless bookmark
    (error "No bookmark specified"))
  (bookmark-maybe-historicize-string bookmark)
  ;; Don't use `switch-to-buffer' because it would let the
  ;; window-point override the bookmark's point when
  ;; `switch-to-buffer-preserve-window-point' is non-nil.
  (bookmark--jump-via bookmark (or display-func #'pop-to-buffer-same-window)))