1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

Let bookmark-jump override window-point (Bug#31751)

* lisp/bookmark.el (bookmark-jump): Use pop-to-buffer-same-window
instead of switch-to-buffer, the latter obeys
switch-to-buffer-preserve-window-point and so loses the bookmark's
point.
This commit is contained in:
Noam Postavsky 2018-07-23 21:49:00 -04:00
parent 1208aaa989
commit f64c2774e9

View File

@ -1102,7 +1102,7 @@ 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 `switch-to-buffer'. A typical value for
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"
@ -1110,7 +1110,7 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
(unless bookmark
(error "No bookmark specified"))
(bookmark-maybe-historicize-string bookmark)
(bookmark--jump-via bookmark (or display-func 'switch-to-buffer)))
(bookmark--jump-via bookmark (or display-func 'pop-to-buffer-same-window)))
;;;###autoload