From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: follow mode for occur Date: Fri, 28 May 2004 11:47:44 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <877juxlyz3.fsf@mail.jurta.org> References: <200405270035.i4R0ZjGK017770@scanner2.ics.uci.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085800083 18507 80.91.224.253 (29 May 2004 03:08:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 29 May 2004 03:08:03 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 29 05:07:58 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTuCT-0002se-00 for ; Sat, 29 May 2004 05:07:57 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTuCT-0000fT-00 for ; Sat, 29 May 2004 05:07:57 +0200 Original-Received: from [127.0.0.1] (helo=mailman.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BTuCW-00069U-F1 for emacs-devel@quimby.gnus.org; Fri, 28 May 2004 23:08:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BTuBg-0005mp-Gx for emacs-devel@gnu.org; Fri, 28 May 2004 23:07:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BTuBc-0005lK-EF for emacs-devel@gnu.org; Fri, 28 May 2004 23:07:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BTuBb-0005l9-SR for emacs-devel@gnu.org; Fri, 28 May 2004 23:07:04 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BTdx4-0005cd-Tm for emacs-devel@gnu.org; Fri, 28 May 2004 05:47:30 -0400 Original-Received: from [66.33.219.4] (helo=spork.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTd7W-0004sH-Ml for emacs-devel@gnu.org; Fri, 28 May 2004 04:53:42 -0400 Original-Received: from mail.jurta.org (80-235-41-39-dsl.mus.estpak.ee [80.235.41.39]) by spork.dreamhost.com (Postfix) with ESMTP id 0312411DC1E; Fri, 28 May 2004 01:53:40 -0700 (PDT) Original-To: Dan Nicolaescu In-Reply-To: <200405270035.i4R0ZjGK017770@scanner2.ics.uci.edu> (Dan Nicolaescu's message of "Wed, 26 May 2004 17:35:47 -0700") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24121 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24121 Dan Nicolaescu writes: > The code below implements a follow mode for the *Occur*, this was > inspired by `reftex-toc-follow-mode'. You could look also at color-moccur.el which already implements follow mode for *Moccur* buffers. Instead of using `post-command-hook' it follows matches in the original buffer by special functions `moccur-next' and `moccur-prev' bound to vertical motion keys. And it toggles the follow mode by `t'. > Is there an interest to have something like this included in Emacs? > If there is I can provide a patch acceptable for inclusion. This is a very useful thing. However, your current implementation has one drawbacks: its indication for the current match in the original buffer is not seen when `cursor-in-non-selected-windows' is nil. To solve this problem, `occur-mode-display-occurrence' could be modified to call `next-error' which would use location highlighting methods `next-error-highlight' and `next-error-highlight-no-select'. > How about implementing something similar for compile.el? > I can provide code for that too. It definitely needs to work in all modes supporting `next-error' functionality: compile, grep, diff, occur. This can be achieved by generalizing all error functions and creating unified functions like I suggested yesterday on emacs-devel. For example, using `goto-error-no-select' instead of `occur-mode-display-occurrence'. So, if you want to develop this idea further, please take all this into consideration. -- Juri Linkov http://www.jurta.org/emacs/