From 241ab2b5f97c33e43ac73be9a170a2d4c6c1d8a6 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Fri, 13 Jul 2007 18:20:55 +0000 Subject: [PATCH] * bookmark.el (bookmark-jump-other-window): New function. (bookmark-map): Bind it to "o". Patch by Drew Adams . See http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00633.html. --- lisp/ChangeLog | 8 ++++++++ lisp/bookmark.el | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 010b2db64c1..209174beddb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2007-07-13 Karl Fogel + * bookmark.el (bookmark-jump-other-window): New function. + (bookmark-map): Bind it to "o". + + Patch by Drew Adams . See + http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00633.html. + +2007-07-13 Karl Fogel + * bookmark.el: Shorten some comments to fit within 80 lines. 2007-07-13 Karl Fogel diff --git a/lisp/bookmark.el b/lisp/bookmark.el index ba0f93854b3..6ef2ea198d3 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -241,6 +241,7 @@ functions have a binding in this keymap.") ;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ;"m"ark ;;;###autoload (define-key bookmark-map "j" 'bookmark-jump) ;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ;"g"o +;;;###autoload (define-key bookmark-map "o" 'bookmark-jump-other-window) ;;;###autoload (define-key bookmark-map "i" 'bookmark-insert) ;;;###autoload (define-key bookmark-map "e" 'edit-bookmarks) ;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ;"f"ind @@ -1081,6 +1082,27 @@ of the old one in the permanent bookmark record." (bookmark-show-annotation bookmark))))) +;;;###autoload +(defun bookmark-jump-other-window (bookmark) + "Jump to BOOKMARK (a point in some file) in another window. +See `bookmark-jump'." + (interactive + (let ((bkm (bookmark-completing-read "Jump to bookmark (in another window)" + bookmark-current-bookmark))) + (if (> emacs-major-version 21) + (list bkm) bkm))) + (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)))))) + + (defun bookmark-file-or-variation-thereof (file) "Return FILE (a string) if it exists, or return a reasonable variation of FILE if that exists. Reasonable variations are checked -- 2.11.4.GIT