Mercurial > emacs
comparison lisp/bookmark.el @ 65087:83940123c4b3
(bookmark-after-jump-hook): New hook.
(bookmark-jump): Run `bookmark-after-jump-hook'.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Wed, 24 Aug 2005 10:18:29 +0000 |
parents | bf2ce0e2b48b |
children | c877fbcb64de |
comparison
equal
deleted
inserted
replaced
65086:aaf3a4138958 | 65087:83940123c4b3 |
---|---|
1035 (sort (copy-alist bookmark-alist) | 1035 (sort (copy-alist bookmark-alist) |
1036 (function | 1036 (function |
1037 (lambda (x y) (string-lessp (car x) (car y)))))))) | 1037 (lambda (x y) (string-lessp (car x) (car y)))))))) |
1038 | 1038 |
1039 | 1039 |
1040 (defvar bookmark-after-jump-hook nil | |
1041 "Hook run after `bookmark-jump' jumps to a bookmark. | |
1042 Useful for example to unhide text in `outline-mode'.") | |
1043 | |
1040 ;;;###autoload | 1044 ;;;###autoload |
1041 (defun bookmark-jump (bookmark) | 1045 (defun bookmark-jump (bookmark) |
1042 "Jump to bookmark BOOKMARK (a point in some file). | 1046 "Jump to bookmark BOOKMARK (a point in some file). |
1043 You may have a problem using this function if the value of variable | 1047 You may have a problem using this function if the value of variable |
1044 `bookmark-alist' is nil. If that happens, you need to load in some | 1048 `bookmark-alist' is nil. If that happens, you need to load in some |
1057 (bookmark-maybe-historicize-string bookmark) | 1061 (bookmark-maybe-historicize-string bookmark) |
1058 (let ((cell (bookmark-jump-noselect bookmark))) | 1062 (let ((cell (bookmark-jump-noselect bookmark))) |
1059 (and cell | 1063 (and cell |
1060 (switch-to-buffer (car cell)) | 1064 (switch-to-buffer (car cell)) |
1061 (goto-char (cdr cell)) | 1065 (goto-char (cdr cell)) |
1066 (progn (run-hooks 'bookmark-jump-hook) t) | |
1062 (if bookmark-automatically-show-annotations | 1067 (if bookmark-automatically-show-annotations |
1063 ;; if there is an annotation for this bookmark, | 1068 ;; if there is an annotation for this bookmark, |
1064 ;; show it in a buffer. | 1069 ;; show it in a buffer. |
1065 (bookmark-show-annotation bookmark))))) | 1070 (bookmark-show-annotation bookmark))))) |
1066 | 1071 |