[Top][All Lists]

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

Re: Furna's fisheye minor mode

From: Stefan Monnier
Subject: Re: Furna's fisheye minor mode
Date: 20 Jan 2004 11:29:35 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> I have attached a minor mode for emacs 21 that dynamically filters out stuff
> that is indented. It is a bit similar to hideshow, hidelines and outline,
> but it works on the indentation level instead of the semantics of some
> programming language.

Setting outline-regexp to "[ \t]*" does "the same", so I expect there are
other differences (just like there are differences between hs-minor-mode,
outline-minor-mode, as well as umpteen other variants).  Could you describe
what your mode does to make it easier to understand your code?

Most interesting would be to know "what does the user have to do to
hide/unhide parts of the text and to tell which parts to hide/unhide".

> The mode is slow with very large files,

I suppose it's slow because you use line-counts rather than
buffer positions.  I recommend you begin by removing fisheye-count-lines
and figure out how to get your code working again without using it.
That'll speed it up tremendously.

> because I couldn't figure out how to check if the point is in the visible
> region of the buffer.

How about using overlays-at and check whether one of the overlays at point
belongs to fisheye ?

> Also, the only way I could detect that the point had moved was by saving
> the point position and checking if it has changed in the
> post-command-hook.

Why do you need to detect it ?  Do you automatically hide/unhide parts of
the buffer based on the user's movement (like reveal-mode does) ?

> The question is, what is the right way to check that the point has moved?

Using post-command-hook sounds about right.  In many cases you can try to
answer "why do I need to know whether point has moved" in order to avoid
having to answer the first question, tho.


reply via email to

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