From: Richard M. Stallman Date: Tue, 8 Jan 2002 06:12:37 +0000 (+0000) Subject: (occur-mode-goto-occurrence-other-window): New command. X-Git-Tag: ttn-vms-21-2-B4~17263 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=029024e25b140d534834ebfb173e20d0985af7ef;p=emacs.git (occur-mode-goto-occurrence-other-window): New command. (occur-mode-map): Bind `o' to that. --- diff --git a/lisp/replace.el b/lisp/replace.el index 474e6158e87..6986a93b3bf 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -437,6 +437,7 @@ end of the buffer." (define-key map [mouse-2] 'occur-mode-mouse-goto) (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence) (define-key map "\C-m" 'occur-mode-goto-occurrence) + (define-key map "\o" 'occur-mode-goto-occurrence-other-window) (define-key map "\C-o" 'occur-mode-display-occurrence) (define-key map "\M-n" 'occur-next) (define-key map "\M-p" 'occur-prev) @@ -514,6 +515,13 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. (pop-to-buffer occur-buffer) (goto-char (marker-position pos)))) +(defun occur-mode-goto-occurrence-other-window () + "Go to the occurrence the current line describes, in another window." + (interactive) + (let ((pos (occur-mode-find-occurrence))) + (switch-to-buffer-other-window occur-buffer) + (goto-char (marker-position pos)))) + (defun occur-mode-display-occurrence () "Display in another window the occurrence the current line describes." (interactive)