emacs-devel
[Top][All Lists]
Advanced

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

Re: occur-mode-hook run too early to be useful


From: Stefan Monnier
Subject: Re: occur-mode-hook run too early to be useful
Date: Wed, 28 Aug 2002 11:11:37 -0400

> On Wed, 28 Aug 2002 10:30:05 -0400, "Stefan Monnier" 
> <monnier+gnu/address@hidden> wrote:
> 
> > That would be wrong.  The hook should be run at the end of the major mode's
> > function.
> 
> Yes, sure. That's the normal way and that's why I asked.
> 
> But in this case things aren't that clear, as the distinction between
> code in occur-mode and code in occur-1 seems rather arbitrary:
> 
>  1. occur-mode is only called from occur-1

No. `occur-mode' in an interactive function.
Oops, scratch that:
Yes, except that `occur-mode' should be an interactive function.

>  4. M-x occur-mode in a non-occur buffer is meaningless

Maybe you're right.  But how about

        M-x occur RET foo RET
        ...
        M-x some-other-mode RET
        ...
        M-x occur-mode RET

I switch major modes like that sometimes in order to get a particular
kind of font-lock highlighting, or some particular set of key-bindings.
I must admit that I'm not convinced it's very compelling in the case of
an occur buffer.

> So I think that's what I'm going to do: changing occur-mode-hook to just
> occur-hook and executing it at the end of occur-1.

That sounds good to me.


        Stefan





reply via email to

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