emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: doc-view support for bookmark.el


From: Drew Adams
Subject: RE: doc-view support for bookmark.el
Date: Tue, 25 Dec 2007 09:24:09 -0800

> When I was doing that I found some strange code: bookmark-jump-noselect
> opened the bookmarked file, set point at the correct position and
> returned a cons (BUFFER . POSITION).  All calling functions did set the
> position once again.  I suspect that was a relict of the past, so I
> removed it and now bookmark-jump-noselect only returns the buffer.

`bookmark-jump' expects the return value of `bookmark-jump-noselect' to be
what it has always been, a "cell" that provides both the buffer and the
position. I define my own `bookmark-jump-other-window' analogously, so it
has the same expectation:

(defun bookmark-jump-other-window (bookmark)
  "Jump to BOOKMARK (a point in some file) in another window.
See `bookmark-jump'."
  (interactive (list (bookmark-completing-read
                       "Jump to bookmark (in another window)"
                       bookmark-current-bookmark)))
  (when bookmark
    (bookmark-maybe-historicize-string bookmark)
    (let ((cell (bookmark-jump-noselect bookmark)))
      (and cell
           (switch-to-buffer-other-window (car cell))
           (goto-char (cdr cell))
           (if bookmark-automatically-show-annotations
               ;; if there is an annotation for this bookmark,
               ;; show it in a buffer.
               (bookmark-show-annotation bookmark))))))

> Till now I didn't use bookmarks, so I'm not sure if this change will
> break something.

See above.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]