all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: efficiently viewing Unix timestamps as dates
Date: Wed, 27 Apr 2011 11:18:29 -0300	[thread overview]
Message-ID: <jwvr58nrds6.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 877hahggrx.fsf@lifelogs.com

> 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.

The idea is the following:

We add a notion of "plane" to text-properties.  So, for example,
font-lock would set the `face' property (and any other property it feels
like setting) in the `font-lock' plane.  When font-lock needs to erase
the properties it has set, it just erases the `font-lock' plane which
guarantees that all the properties in that plane are removed (so you
don't need font-lock-extra-managed-props any more) and none of the
properties of other planes are affected (so you don't risk erasing
other packages's properties).

The text-property value at a particular point is the combination of the
value for each existing plane.  The combination can be done via `or' or
via some more sophisticated merge operator (the merge operator can be
specified on a per-property basis, so `face' can be merged differently
from `keymap' or `invisible').

The implementation would go something like:

(defun new-put-text-property (start end prop val &optional object)
  (let ((plane (if (consp prop) (prog1 (car prop) (setq prop (cdr prop))))))
    (old-put-text-property start end (cons plane prop) val object)
    (re-merge-property start end prop object)))

(defun re-merge-property (start end prop object)
  (for all i from start to end
    (old-put-text-property x (1+ x) prop
                           (funcall (merger-function prop)
                                    (collect-values-from-planes i prop)))))

-- Stefan


  reply	other threads:[~2011-04-27 14:18 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 [this message]
2011-05-04 13:35                                       ` Ted Zlatanov
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=jwvr58nrds6.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.