emacs-devel
[Top][All Lists]
Advanced

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

Re: follow mode for occur


From: Juri Linkov
Subject: Re: follow mode for occur
Date: Fri, 28 May 2004 11:47:44 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Dan Nicolaescu <address@hidden> 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/





reply via email to

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