comparison lisp/bookmark.el @ 11021:83b6c53268c3

(bookmark-bmenu-2-window): go to correct position as well as correct buffer. (bookmark-bmenu-other-window): same. (bookmark-bmenu-switch-other-window): same.
author Karl Fogel <kfogel@red-bean.com>
date Wed, 15 Mar 1995 14:47:09 +0000
parents d173d21f14e2
children ebee80744a06
comparison
equal deleted inserted replaced
11020:0951bb12c8ee 11021:83b6c53268c3
3 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation 3 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation
4 4
5 ;; Author: Karl Fogel <kfogel@cyclic.com> 5 ;; Author: Karl Fogel <kfogel@cyclic.com>
6 ;; Maintainer: Karl Fogel <kfogel@cyclic.com> 6 ;; Maintainer: Karl Fogel <kfogel@cyclic.com>
7 ;; Created: July, 1993 7 ;; Created: July, 1993
8 ;; Author's Update Number: 2.6.8 8 ;; Author's Update Number: 2.6.9
9 ;; Keywords: bookmarks, placeholders, annotations 9 ;; Keywords: bookmarks, placeholders, annotations
10 10
11 ;;; Summary: 11 ;;; Summary:
12 ;; This package is for setting "bookmarks" in files. A bookmark 12 ;; This package is for setting "bookmarks" in files. A bookmark
13 ;; associates a string with a location in a certain file. Thus, you 13 ;; associates a string with a location in a certain file. Thus, you
1704 (let ((bmrk (bookmark-bmenu-bookmark)) 1704 (let ((bmrk (bookmark-bmenu-bookmark))
1705 (menu (current-buffer)) 1705 (menu (current-buffer))
1706 (pop-up-windows t)) 1706 (pop-up-windows t))
1707 (delete-other-windows) 1707 (delete-other-windows)
1708 (switch-to-buffer (other-buffer)) 1708 (switch-to-buffer (other-buffer))
1709 (let ((buff (car (bookmark-jump-noselect bmrk)))) 1709 (let* ((pair (bookmark-jump-noselect bmrk))
1710 (pop-to-buffer buff)) 1710 (buff (car pair))
1711 (pos (cdr pair)))
1712 (pop-to-buffer buff)
1713 (goto-char pos))
1711 (bury-buffer menu)))) 1714 (bury-buffer menu))))
1712 1715
1713 1716
1714 (defun bookmark-bmenu-this-window () 1717 (defun bookmark-bmenu-this-window ()
1715 "Select this line's bookmark in this window." 1718 "Select this line's bookmark in this window."
1721 (defun bookmark-bmenu-other-window () 1724 (defun bookmark-bmenu-other-window ()
1722 "Select this line's bookmark in other window, leaving bookmark menu visible." 1725 "Select this line's bookmark in other window, leaving bookmark menu visible."
1723 (interactive) 1726 (interactive)
1724 (let ((bookmark (bookmark-bmenu-bookmark))) 1727 (let ((bookmark (bookmark-bmenu-bookmark)))
1725 (if (bookmark-bmenu-check-position) 1728 (if (bookmark-bmenu-check-position)
1726 (let ((buff (car (bookmark-jump-noselect bookmark)))) 1729 (let* ((pair (bookmark-jump-noselect bookmark))
1730 (buff (car pair))
1731 (pos (cdr pair)))
1727 (switch-to-buffer-other-window buff) 1732 (switch-to-buffer-other-window buff)
1733 (goto-char pos)
1734 (set-window-point (get-buffer-window buff) pos)
1735 (bookmark-show-annotation bookmark)))))
1736
1737
1738 (defun bookmark-bmenu-switch-other-window ()
1739 "Make the other window select this line's bookmark.
1740 The current window remains selected."
1741 (interactive)
1742 (let ((bookmark (bookmark-bmenu-bookmark)))
1743 (if (bookmark-bmenu-check-position)
1744 (let* ((pair (bookmark-jump-noselect bookmark))
1745 (buff (car pair))
1746 (pos (cdr pair)))
1747 (display-buffer buff)
1748 (let ((o-buffer (current-buffer)))
1749 ;; save-excursion won't do
1750 (set-buffer buff)
1751 (goto-char pos)
1752 (set-window-point (get-buffer-window buff) pos)
1753 (set-buffer o-buffer))
1728 (bookmark-show-annotation bookmark))))) 1754 (bookmark-show-annotation bookmark)))))
1729 1755
1730 1756
1731 (defun bookmark-bmenu-show-annotation () 1757 (defun bookmark-bmenu-show-annotation ()
1732 "Show the annotation for the current bookmark in another window." 1758 "Show the annotation for the current bookmark in another window."
1746 "Edit the annotation for the current bookmark in another window." 1772 "Edit the annotation for the current bookmark in another window."
1747 (interactive) 1773 (interactive)
1748 (let ((bookmark (bookmark-bmenu-bookmark))) 1774 (let ((bookmark (bookmark-bmenu-bookmark)))
1749 (if (bookmark-bmenu-check-position) 1775 (if (bookmark-bmenu-check-position)
1750 (bookmark-edit-annotation bookmark)))) 1776 (bookmark-edit-annotation bookmark))))
1751
1752
1753 (defun bookmark-bmenu-switch-other-window ()
1754 "Make the other window select this line's bookmark.
1755 The current window remains selected."
1756 (interactive)
1757 (let ((bookmark (bookmark-bmenu-bookmark)))
1758 (if (bookmark-bmenu-check-position)
1759 (let ((buff (car (bookmark-jump-noselect bookmark))))
1760 (display-buffer buff)
1761 (bookmark-show-annotation bookmark)))))
1762 1777
1763 1778
1764 (defun bookmark-bmenu-quit () 1779 (defun bookmark-bmenu-quit ()
1765 "Quit the bookmark menu." 1780 "Quit the bookmark menu."
1766 (interactive) 1781 (interactive)