# HG changeset patch # User Richard M. Stallman # Date 1009211175 0 # Node ID d1c81a1250f2073e821ba8c31930e4f9e5d34868 # Parent f31eab2cf8ae40cad27ba76fd1edfefdda34654f (occur-mode-display-occurrence): New function. (occur-mode-map): Bind C-o to it. diff -r f31eab2cf8ae -r d1c81a1250f2 lisp/replace.el --- a/lisp/replace.el Mon Dec 24 12:20:50 2001 +0000 +++ b/lisp/replace.el Mon Dec 24 16:26:15 2001 +0000 @@ -436,6 +436,7 @@ (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 "\C-o" 'occur-mode-display-occurrence) (define-key map "\M-n" 'occur-next) (define-key map "\M-p" 'occur-prev) (define-key map "g" 'revert-buffer) @@ -512,6 +513,19 @@ (pop-to-buffer occur-buffer) (goto-char (marker-position pos)))) +(defun occur-mode-display-occurrence () + "Display in another window the occurrence the current line describes." + (interactive) + (let ((pos (occur-mode-find-occurrence)) + same-window-buffer-names + same-window-regexps + window) + (setq window (display-buffer occur-buffer)) + ;; This is the way to set point in the proper window. + (save-selected-window + (select-window window) + (goto-char (marker-position pos))))) + (defun occur-next (&optional n) "Move to the Nth (default 1) next match in the *Occur* buffer." (interactive "p")