diff options
| author | Stefan Monnier | 2008-03-09 21:37:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-03-09 21:37:16 +0000 |
| commit | a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e (patch) | |
| tree | 9d973b799c1d741f9bbdb3fa73d97564ed99fb1d | |
| parent | 136894c8fc052b51d5558c169881d92086158e8e (diff) | |
| download | emacs-a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e.tar.gz emacs-a9f8b49b44a4083d8e5a2429306ce41e7f3cfe0e.zip | |
(bookmark-buffer-file-name, bookmark-prop-get): Declare.
(doc-view-bookmark-make-record): Use them.
(doc-view-bookmark-jump): Use them. Fix find-file -> find-file-noselect.
(bookmark-get-filename, bookmark-get-bookmark-record): Remove.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/doc-view.el | 20 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d194ed5300..bb2291dc3e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2008-03-09 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-03-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * doc-view.el (bookmark-buffer-file-name, bookmark-prop-get): Declare. | ||
| 4 | (doc-view-bookmark-make-record): Use them. | ||
| 5 | (doc-view-bookmark-jump): Use them. Fix find-file -> find-file-noselect. | ||
| 6 | (bookmark-get-filename, bookmark-get-bookmark-record): Remove. | ||
| 7 | |||
| 3 | * bookmark.el (bookmark-make-record-function): Change expected return value | 8 | * bookmark.el (bookmark-make-record-function): Change expected return value |
| 4 | to include a suggested bookmark name. | 9 | to include a suggested bookmark name. |
| 5 | (bookmark-make): Split into bookmark-make-record and bookmark-store. | 10 | (bookmark-make): Split into bookmark-make-record and bookmark-store. |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 43d06f3c077..bb98b4a8af1 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -1082,26 +1082,28 @@ See the command `doc-view-mode' for more information on this mode." | |||
| 1082 | 1082 | ||
| 1083 | ;;;; Bookmark integration | 1083 | ;;;; Bookmark integration |
| 1084 | 1084 | ||
| 1085 | (declare-function bookmark-buffer-file-name "bookmark" ()) | ||
| 1086 | (declare-function bookmark-prop-get "bookmark" (bookmark prop)) | ||
| 1087 | |||
| 1085 | (defun doc-view-bookmark-make-record () | 1088 | (defun doc-view-bookmark-make-record () |
| 1086 | `((filename . ,buffer-file-name) | 1089 | `((filename . ,(bookmark-buffer-file-name)) |
| 1087 | (page . ,(doc-view-current-page)) | 1090 | (page . ,(doc-view-current-page)) |
| 1088 | (handler . doc-view-bookmark-jump))) | 1091 | (handler . doc-view-bookmark-jump))) |
| 1089 | 1092 | ||
| 1090 | 1093 | ||
| 1091 | (declare-function bookmark-get-filename "bookmark" (bookmark)) | ||
| 1092 | (declare-function bookmark-get-bookmark-record "bookmark" (bookmark)) | ||
| 1093 | |||
| 1094 | ;;;###autoload | 1094 | ;;;###autoload |
| 1095 | (defun doc-view-bookmark-jump (bmk) | 1095 | (defun doc-view-bookmark-jump (bmk) |
| 1096 | ;; This implements the `handler' function interface for record type | 1096 | ;; This implements the `handler' function interface for record type |
| 1097 | ;; returned by `doc-view-bookmark-make-record', which see. | 1097 | ;; returned by `doc-view-bookmark-make-record', which see. |
| 1098 | (save-window-excursion | 1098 | (let ((filename (bookmark-prop-get bmk 'filename)) |
| 1099 | (let ((filename (bookmark-get-filename bmk)) | 1099 | (page (bookmark-prop-get bmk 'page))) |
| 1100 | (page (cdr (assq 'page (bookmark-get-bookmark-record bmk))))) | 1100 | (with-current-buffer (find-file-noselect filename) |
| 1101 | (find-file filename) | ||
| 1102 | (when (not (eq major-mode 'doc-view-mode)) | 1101 | (when (not (eq major-mode 'doc-view-mode)) |
| 1103 | (doc-view-toggle-display)) | 1102 | (doc-view-toggle-display)) |
| 1104 | (doc-view-goto-page page) | 1103 | (with-selected-window |
| 1104 | (or (get-buffer-window (current-buffer) 0) | ||
| 1105 | (selected-window)) | ||
| 1106 | (doc-view-goto-page page)) | ||
| 1105 | `((buffer ,(current-buffer)) (position ,1))))) | 1107 | `((buffer ,(current-buffer)) (position ,1))))) |
| 1106 | 1108 | ||
| 1107 | 1109 | ||