emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/replace.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/replace.el
Date: Mon, 24 Dec 2001 11:26:15 -0500

Index: emacs/lisp/replace.el
diff -c emacs/lisp/replace.el:1.124 emacs/lisp/replace.el:1.125
*** emacs/lisp/replace.el:1.124 Sat Dec  1 23:45:54 2001
--- emacs/lisp/replace.el       Mon Dec 24 11:26:15 2001
***************
*** 436,441 ****
--- 436,442 ----
      (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)
***************
*** 511,516 ****
--- 512,530 ----
    (let ((pos (occur-mode-find-occurrence)))
      (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."



reply via email to

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