summaryrefslogtreecommitdiff
path: root/lisp/bookmark.el
diff options
context:
space:
mode:
authorKarl Fogel <kfogel@red-bean.com>1995-03-15 14:47:09 +0000
committerKarl Fogel <kfogel@red-bean.com>1995-03-15 14:47:09 +0000
commite40e3151169e10b93274e51ff922566c5b08c57a (patch)
treecfb0f7eeedb8dda3b5eaa2bfd1a820315ea21074 /lisp/bookmark.el
parent4ac386907d5bf8af94bfbc9b712dfe95214a3308 (diff)
downloademacs-e40e3151169e10b93274e51ff922566c5b08c57a.tar.gz
(bookmark-bmenu-2-window): go to correct position as well as
correct buffer. (bookmark-bmenu-other-window): same. (bookmark-bmenu-switch-other-window): same.
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r--lisp/bookmark.el45
1 files changed, 30 insertions, 15 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index c17d6db4c42..79b2904898a 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -5,7 +5,7 @@
;; Author: Karl Fogel <kfogel@cyclic.com>
;; Maintainer: Karl Fogel <kfogel@cyclic.com>
;; Created: July, 1993
-;; Author's Update Number: 2.6.8
+;; Author's Update Number: 2.6.9
;; Keywords: bookmarks, placeholders, annotations
;;; Summary:
@@ -1706,8 +1706,11 @@ With a prefix arg, prompts for a file to save them in."
(pop-up-windows t))
(delete-other-windows)
(switch-to-buffer (other-buffer))
- (let ((buff (car (bookmark-jump-noselect bmrk))))
- (pop-to-buffer buff))
+ (let* ((pair (bookmark-jump-noselect bmrk))
+ (buff (car pair))
+ (pos (cdr pair)))
+ (pop-to-buffer buff)
+ (goto-char pos))
(bury-buffer menu))))
@@ -1723,8 +1726,31 @@ With a prefix arg, prompts for a file to save them in."
(interactive)
(let ((bookmark (bookmark-bmenu-bookmark)))
(if (bookmark-bmenu-check-position)
- (let ((buff (car (bookmark-jump-noselect bookmark))))
+ (let* ((pair (bookmark-jump-noselect bookmark))
+ (buff (car pair))
+ (pos (cdr pair)))
(switch-to-buffer-other-window buff)
+ (goto-char pos)
+ (set-window-point (get-buffer-window buff) pos)
+ (bookmark-show-annotation bookmark)))))
+
+
+(defun bookmark-bmenu-switch-other-window ()
+ "Make the other window select this line's bookmark.
+The current window remains selected."
+ (interactive)
+ (let ((bookmark (bookmark-bmenu-bookmark)))
+ (if (bookmark-bmenu-check-position)
+ (let* ((pair (bookmark-jump-noselect bookmark))
+ (buff (car pair))
+ (pos (cdr pair)))
+ (display-buffer buff)
+ (let ((o-buffer (current-buffer)))
+ ;; save-excursion won't do
+ (set-buffer buff)
+ (goto-char pos)
+ (set-window-point (get-buffer-window buff) pos)
+ (set-buffer o-buffer))
(bookmark-show-annotation bookmark)))))
@@ -1750,17 +1776,6 @@ With a prefix arg, prompts for a file to save them in."
(bookmark-edit-annotation bookmark))))
-(defun bookmark-bmenu-switch-other-window ()
- "Make the other window select this line's bookmark.
-The current window remains selected."
- (interactive)
- (let ((bookmark (bookmark-bmenu-bookmark)))
- (if (bookmark-bmenu-check-position)
- (let ((buff (car (bookmark-jump-noselect bookmark))))
- (display-buffer buff)
- (bookmark-show-annotation bookmark)))))
-
-
(defun bookmark-bmenu-quit ()
"Quit the bookmark menu."
(interactive)