From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: overlays vs text properties
Date: Wed, 13 Jul 2011 00:23:23 -0700 [thread overview]
Message-ID: <87tyaqiqz8.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <E1QgtPy-00045Q-62@fencepost.gnu.org> (Eli Zaretskii's message of "Wed, 13 Jul 2011 02:59:34 -0400")
On Tue, Jul 12 2011, Eli Zaretskii wrote:
>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Tue, 12 Jul 2011 23:12:20 -0700
>>
>> I can't decide whether to use overlays or regular properties. The
>> advantages of using overlays seem to be:
>>
>> 1. I can make a single named overlay, and move it around the buffer with
>> move-overlay. Nice and clean, no searching for boundaries of things
>> and suchlike.
>> 2. I can attach multiple properties to a single overlay -- saves time
>> and effort, and seems like good programming.
>>
>> The disadvantage seems to be the practical issue that overlays don't
>> come with point-entered/point-left special properties -- ie, there's no
>> good way of keeping track of when point is going in and out of a
>> paragraph with the overlay, and then moving the overlay to the
>> next/previous/other paragraph.
>>
>> Does anyone have any experience they'd like to share on this point?
>> Should I just use fundamental text properties?
>
> You didn't give enough information to help you with this issue. For
> example: how many properties/overlays will exist in a given buffer
> simultaneously? Text properties scale much better than overlays, so
> this information is important.
>
> Also, text properties by default are copied with text, while overlays
> are not. Will this be an issue in your application?
>
> Overlays can overlap, while text properties cannot (for the same
> property). Is this a possible issue for you?
>
> Etc. etc. IOW, tell more about your application to get any advice
> beyond a list of abstract cons and pros.
Can do! So:
1. I'll have a buffer and an indirect buffer on the same file. Each
buffer will have a single "active" paragraph at any one time, but
only one. So I don't think scaling is too much of an issue. I'm
trying to create a "follow" situation, where a paragraph in the
source buffer is matched to a paragraph in the indirect buffer, and
these two paragraphs have (different) properties. But only the two
paragraphs at one time, moving in unison.
2. This is mostly a visual effect (hence my leaning towards overlays),
and copying text properties is not necessary. In fact, it would be
annoying.
3. Overlapping would not be an issue -- within the "active" paragraphs
there might be other properties present, but they would be separate
from the overall paragraph property.
I am trying to create a translation environment, by modifying an org-mode
file so that I can move through one subtree while the indirect buffer
displays mirror paragraphs in another subtree. I want to link
source-language paragraphs with target-language paragraphs, so it's
pretty crucial that movement be covered: wherever point goes in the main
buffer, it should be tracked and mirrored in the indirect buffer.
Having different keymaps available within the "active" paragraphs is
key!
Thanks a lot for considering this issue…
Eric
next prev parent reply other threads:[~2011-07-13 7:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 6:12 overlays vs text properties Eric Abrahamsen
2011-07-13 6:59 ` Eli Zaretskii
2011-07-13 7:23 ` Eric Abrahamsen [this message]
2011-07-13 7:28 ` Eli Zaretskii
2011-07-13 7:32 ` Eric Abrahamsen
2011-07-13 8:07 ` PJ Weisberg
2011-07-13 22:21 ` Eric Abrahamsen
2011-07-13 9:57 ` Eli Zaretskii
2011-07-13 14:55 ` Drew Adams
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tyaqiqz8.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.