From: Ted Zlatanov <tzz@lifelogs.com>
To: help-gnu-emacs@gnu.org
Subject: Re: efficiently viewing Unix timestamps as dates
Date: Wed, 04 May 2011 08:35:41 -0500 [thread overview]
Message-ID: <87tyda7fma.fsf@lifelogs.com> (raw)
In-Reply-To: jwvr58nrds6.fsf-monnier+gnu.emacs.help@gnu.org
On Wed, 27 Apr 2011 11:18:29 -0300 Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I was definitely not paying careful attention to that discussion when it
>> happened on emacs-devel. Can you give some references so I can catch up
>> with what needs to be done, since "display" and "properties" return too
>> many matches? Even if I don't work on it I can at least understand the
>> history.
SM> The idea is the following:
SM> We add a notion of "plane" to text-properties. So, for example,
SM> font-lock would set the `face' property (and any other property it feels
SM> like setting) in the `font-lock' plane. When font-lock needs to erase
SM> the properties it has set, it just erases the `font-lock' plane which
SM> guarantees that all the properties in that plane are removed (so you
SM> don't need font-lock-extra-managed-props any more) and none of the
SM> properties of other planes are affected (so you don't risk erasing
SM> other packages's properties).
SM> The text-property value at a particular point is the combination of the
SM> value for each existing plane. The combination can be done via `or' or
SM> via some more sophisticated merge operator (the merge operator can be
SM> specified on a per-property basis, so `face' can be merged differently
SM> from `keymap' or `invisible').
As long as the merge is smart this should work: if you have
plane=1,face=A on (0, 5) and plane=2,face=B on (3, 10) the merge should
be called just once for the region between 3 and 5. I assume that's how
you picture it too, though `re-merge-property' below doesn't do it.
SM> The implementation would go something like:
SM> (defun new-put-text-property (start end prop val &optional object)
SM> (let ((plane (if (consp prop) (prog1 (car prop) (setq prop (cdr prop))))))
SM> (old-put-text-property start end (cons plane prop) val object)
SM> (re-merge-property start end prop object)))
SM> (defun re-merge-property (start end prop object)
SM> (for all i from start to end
SM> (old-put-text-property x (1+ x) prop
SM> (funcall (merger-function prop)
SM> (collect-values-from-planes i prop)))))
So the default plane is nil? That seems OK and backwards compatible.
But I don't know enough about the internals to say how much work this
will be; I would guess "a lot" :)
Ted
next prev parent reply other threads:[~2011-05-04 13:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 17:20 efficiently viewing Unix timestamps as dates Ted Zlatanov
2010-12-16 7:28 ` Kevin Rodgers
[not found] ` <mailman.8.1292484545.7231.help-gnu-emacs@gnu.org>
2010-12-16 19:26 ` Ted Zlatanov
2010-12-16 20:48 ` Burton Samograd
2010-12-16 21:34 ` PJ Weisberg
2010-12-16 22:23 ` Stefan Monnier
2010-12-16 23:12 ` Ted Zlatanov
2010-12-17 2:35 ` Stefan Monnier
2011-04-15 0:31 ` Ted Zlatanov
2011-04-15 15:29 ` Stefan Monnier
2011-04-15 16:59 ` Ted Zlatanov
2011-04-17 14:38 ` Stefan Monnier
2011-04-19 13:23 ` Ted Zlatanov
2011-04-19 15:23 ` Stefan Monnier
2011-04-19 18:09 ` Ted Zlatanov
2011-04-21 20:20 ` Stefan Monnier
2011-04-21 20:48 ` Ted Zlatanov
2011-04-24 5:18 ` Stefan Monnier
2011-04-25 19:52 ` Ted Zlatanov
2011-04-26 2:50 ` Ted Zlatanov
2011-04-26 13:28 ` Stefan Monnier
2011-04-26 15:43 ` Ted Zlatanov
2011-04-27 14:18 ` Stefan Monnier
2011-05-04 13:35 ` Ted Zlatanov [this message]
2011-05-04 15:32 ` Stefan Monnier
2011-05-04 19:40 ` Ted Zlatanov
2010-12-17 8:25 ` Eli Zaretskii
[not found] ` <mailman.7.1292574349.666.help-gnu-emacs@gnu.org>
2010-12-17 14:07 ` Ted Zlatanov
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=87tyda7fma.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--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.