emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: occur and next-error-follow-minor-mode]


From: Juri Linkov
Subject: Re: address@hidden: occur and next-error-follow-minor-mode]
Date: Tue, 15 Nov 2005 04:15:53 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> Can someone please investigate this and ack?
>
> From: "LaserDoodads" <address@hidden>
> Subject: occur and next-error-follow-minor-mode
> To: <address@hidden>
> Date: Sat, 12 Nov 2005 13:59:50 -0600
>
> I've always used next-error-follow-minor-mode in the *occur* buffer.
> Recently I noticed that the buffers switch among the windows when ever the 
> cursor moves to a different line.
>
> While visiting any file with several lines containing some text
>
> M-x occur <ret> {something in your file several times} <ret>
> C-x o
> M-x next-error-follow-minor-mode <ret>
> C-n
> C-n
> C-n...

This should be fixed with the following patch.  It restores the
original functionality of goto-occurrence commands with `pop-to-buffer'.
The *Occur* buffer is like *compilation* and *grep* buffers, so using
`pop-to-buffer' is better in the *Occur* buffer.

Index: lisp/replace.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/replace.el,v
retrieving revision 1.230
diff -c -r1.230 replace.el
*** lisp/replace.el     9 Nov 2005 07:41:48 -0000       1.230
--- lisp/replace.el     15 Nov 2005 02:11:31 -0000
***************
*** 755,761 ****
        (save-excursion
        (goto-char (posn-point (event-end event)))
        (setq pos (occur-mode-find-occurrence))))
!     (switch-to-buffer-other-window (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-find-occurrence ()
--- 755,763 ----
        (save-excursion
        (goto-char (posn-point (event-end event)))
        (setq pos (occur-mode-find-occurrence))))
!     (let (same-window-buffer-names
!         same-window-regexps)
!       (pop-to-buffer (marker-buffer pos)))
      (goto-char pos)))
  
  (defun occur-mode-find-occurrence ()
***************
*** 769,776 ****
  (defun occur-mode-goto-occurrence ()
    "Go to the occurrence the current line describes."
    (interactive)
!   (let ((pos (occur-mode-find-occurrence)))
!     (switch-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-goto-occurrence-other-window ()
--- 771,780 ----
  (defun occur-mode-goto-occurrence ()
    "Go to the occurrence the current line describes."
    (interactive)
!   (let ((pos (occur-mode-find-occurrence))
!       same-window-buffer-names
!       same-window-regexps)
!     (pop-to-buffer (marker-buffer pos))
      (goto-char pos)))
  
  (defun occur-mode-goto-occurrence-other-window ()

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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