diff options
| author | Eshel Yaron | 2024-06-17 16:48:43 +0200 |
|---|---|---|
| committer | Eshel Yaron | 2024-06-17 16:48:43 +0200 |
| commit | 27f46ba4b96947dedbafa6e4366a07fa171dbd2e (patch) | |
| tree | 3a0b9d1c80d349f54ba2c8713d8b554b09d0a495 | |
| parent | a5a374014f3afe0d6b94bf645c6cf886c6564699 (diff) | |
| download | emacs-27f46ba4b96947dedbafa6e4366a07fa171dbd2e.tar.gz emacs-27f46ba4b96947dedbafa6e4366a07fa171dbd2e.zip | |
(bookmark--jump-via): Ensure 'window-point' is set correctly
* lisp/bookmark.el (bookmark--jump-via): Record
bookmark-prescribed point before calling DISPLAY-FUNCTION, and
use it to set 'window-point' afterwards. (Bug#71603)
| -rw-r--r-- | lisp/bookmark.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 06f8e24b518..223a7fedc8d 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -1265,10 +1265,12 @@ After calling DISPLAY-FUNCTION, set window point to the point specified | |||
| 1265 | by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook', | 1265 | by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook', |
| 1266 | and then show any annotations for this bookmark." | 1266 | and then show any annotations for this bookmark." |
| 1267 | (bookmark-handle-bookmark bookmark-name-or-record) | 1267 | (bookmark-handle-bookmark bookmark-name-or-record) |
| 1268 | (save-current-buffer | 1268 | ;; Store `point' now, because `display-function' might change it. |
| 1269 | (funcall display-function (current-buffer))) | 1269 | (let ((point (point))) |
| 1270 | (let ((win (get-buffer-window (current-buffer) 0))) | 1270 | (save-current-buffer |
| 1271 | (if win (set-window-point win (point)))) | 1271 | (funcall display-function (current-buffer))) |
| 1272 | (let ((win (get-buffer-window (current-buffer) 0))) | ||
| 1273 | (if win (set-window-point win point)))) | ||
| 1272 | ;; FIXME: we used to only run bookmark-after-jump-hook in | 1274 | ;; FIXME: we used to only run bookmark-after-jump-hook in |
| 1273 | ;; `bookmark-jump' itself, but in none of the other commands. | 1275 | ;; `bookmark-jump' itself, but in none of the other commands. |
| 1274 | (when bookmark-fringe-mark | 1276 | (when bookmark-fringe-mark |