From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: [rick@laserdoodads.com: occur and next-error-follow-minor-mode] Date: Tue, 15 Nov 2005 04:15:53 +0200 Organization: JURTA Message-ID: <87y83q1wrq.fsf@jurta.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1132022971 14322 80.91.229.2 (15 Nov 2005 02:49:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2005 02:49:31 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 15 03:49:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EbqrA-00077z-QR for ged-emacs-devel@m.gmane.org; Tue, 15 Nov 2005 03:47:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ebqr9-0000Ti-64 for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 21:47:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ebqqk-0000R5-IM for emacs-devel@gnu.org; Mon, 14 Nov 2005 21:47:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ebqqi-0000Q5-9f for emacs-devel@gnu.org; Mon, 14 Nov 2005 21:47:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ebqqh-0000Q1-Vq for emacs-devel@gnu.org; Mon, 14 Nov 2005 21:47:08 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ebqqh-00012W-7c; Mon, 14 Nov 2005 21:47:07 -0500 Original-Received: from mail.neti.ee (80-235-43-161-dsl.mus.estpak.ee [80.235.43.161]) by Relayhost1.neti.ee (Postfix) with ESMTP id 4E2D116D1; Tue, 15 Nov 2005 04:47:20 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Sun, 13 Nov 2005 23:55:43 -0500") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45988 Archived-At: > Can someone please investigate this and ack? > > From: "LaserDoodads" > Subject: occur and next-error-follow-minor-mode > To: > 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 {something in your file several times} > C-x o > M-x next-error-follow-minor-mode > 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/