unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ken Manheimer <ken.manheimer@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: outline/allout/overlay performance
Date: Thu, 12 Jan 2006 17:40:48 -0500	[thread overview]
Message-ID: <2cd46e7f0601121440t14dddf55lcb14b078bd9ecfcf@mail.gmail.com> (raw)
In-Reply-To: <jwvd5iyxudb.fsf-monnier+emacs@gnu.org>

i've made the transition to directly using outline-flag-region from
allout mode (rather than allout having it's own allout-flag-region),
and am using outline-flag-region as it stands.  to enable allout's
custom isearch-open-invisible behavior, i'm defadvicing
`outline-isearch-open-invisible' (which is what outline-flag-regexp
assigns as the isearch-open-invisible property on the overlays) so
that allout's preferred function, `allout-show-to-offshoot' is run,
instead, when the outline is in allout-mode.  this works very nicely!

more generally, i'm getting the distinct impression that there are
more than a few generalization issues in this suppression-of-detail
reveal/conceal realm, that (2) deserve comprehensive attention, and
(2) are of scope well beyond the particular things i have time for at
the moment.

that said, i do have some responses to your particular suggestions.

On 1/11/06, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > the function is registered with the overlay, as a property - that's
> > why the current outline-flag-region sets it.  i want to make the
> > function it registers with the overlay parameterized - eg, a mode
> > local variable - to be registered if set.  outline-mode's current one
> > (`outline-isearch-open-invisible') will be used for outline-mode, and
> > allout will have its own.  other modes could, too.
>
> Actually, some other modes using similar functions add a few more
> properties, so I think it makes sense to just add a &rest parameter to
> outline-flag-region.

i don't like the idea of having every call to outline-flag-region pass
in generic mode parameters every time the function is called.  such
incidental concerns can pile up, obscuring the specific business
relevant to the actual call, complicating programmers lives with
incidental things to remember in every call.

i don't know the exact right mechanism to use for such concerns, but
hook-function lists seem like the kind of thing - though we're
probably talking about things that belong in particular modes.  that
suggests properties on some hook variable, qualified with the mode
where they belong or put in an 'all' bucket if they want to be used
everywhere.

> As for using a buffer-local variable for outline-isearch-open-invisible, it
> assumes only one major/minor mode will use it at a time.  In reveal.el
> I chose to allow a reveal-toggle-invisible property on the overlay or on the
> symbol used for invisibility.  So in outline.el rather than adding the
> property to every single overlay, I just do
>
>   (put 'outline 'reveal-toggle-invisible 'outline-reveal-toggle-invisible)
>
> and reveal.el finds it with
>
>   (get (overlay-get ol 'invisible) 'reveal-toggle-invisible)
>
> Maybe isearch (c|sh)ould be changed in a similar way.

this sounds good - i may be describing something like it, above.

> >> stitches overlays together sounds like a good idea.
> >> Maybe it could be made into a generic function, much like remove-overlays
> >> and moved to subr.el.
> > i'll take a look at remove-overlays, when i get to that point.
>
> All I was thinking is to add a function like
>
>     (add-overlay-props FROM TO &rest PROPS)
>
> which either creates a new overlay with the specified props or moves
> existing overlays if there's already an overlay around with the right
> properties, thus trying to minimize the number of overlays in the buffer.
> This said, it's probably more important to work on the C code to try and
> remove the O(n) behavior.  And even if it's not removed everywhere, I can't
> think of any reason why cursor movement should suffer from this
> O(n) behavior.

fortunately, it doesn't look like overlays need that consolidation.  i
don't know how they're implemented, but it seems like they
"consolidated" on their own.

i thank you (and everyone else who've provided clues) for helping
guide me.  i think i have a good approach at this point - the advice
mechnism scales, since others can similarly advice-wrap as needed.  it
depends on continuing use of the particular
outline-isearch-open-invisible function, but any approach is going to
establish some such dependencies...

ken
ken.manheimer@gmail.com

  parent reply	other threads:[~2006-01-12 22:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <rzqacf3mbav.fsf@albion.dl.ac.uk>
     [not found] ` <rzq64pmkov4.fsf@albion.dl.ac.uk>
     [not found]   ` <E1EoUi3-0006Vc-DV@fencepost.gnu.org>
     [not found]     ` <rzqek44is9i.fsf@albion.dl.ac.uk>
     [not found]       ` <E1EpzHJ-0000Lk-VC@fencepost.gnu.org>
     [not found]         ` <rzqk6da9ri0.fsf@albion.dl.ac.uk>
     [not found]           ` <E1Ew0Mt-0002aZ-4F@fencepost.gnu.org>
     [not found]             ` <2cd46e7f0601091127w7f988942w33a105481ccd02e0@mail.gmail.com>
     [not found]               ` <E1EwLJV-0005JX-Dc@fencepost.gnu.org>
     [not found]                 ` <2cd46e7f0601110821x5c97c63bj25d80df70240c80e@mail.gmail.com>
     [not found]                   ` <2cd46e7f0601111223m4e568b56n283d038ccfff6be0@mail.gmail.com>
2006-01-11 21:51                     ` outline/allout/overlay performance (was: existing work on TODO items) Stefan Monnier
2006-01-11 22:00                       ` Ken Manheimer
2006-01-11 22:50                         ` outline/allout/overlay performance Stefan Monnier
2006-01-12  0:59                           ` Ken Manheimer
2006-01-12 13:56                             ` Thien-Thi Nguyen
2006-01-12 22:18                               ` Ken Manheimer
2006-01-12 23:30                                 ` Thien-Thi Nguyen
2006-01-12 22:40                           ` Ken Manheimer [this message]
2006-01-12 23:32                             ` Stefan Monnier
2006-01-13 13:07                             ` Kim F. Storm
2006-01-14 15:24                               ` Ken Manheimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd46e7f0601121440t14dddf55lcb14b078bd9ecfcf@mail.gmail.com \
    --to=ken.manheimer@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).