help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: efficiently viewing Unix timestamps as dates


From: Ted Zlatanov
Subject: Re: efficiently viewing Unix timestamps as dates
Date: Tue, 24 May 2011 20:01:00 -0000
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

On Fri, 15 Apr 2011 12:29:53 -0300 Stefan Monnier <address@hidden> wrote: 

>> mouse to look at the date as a tooltip.  I didn't like how it looked
>> with the `display' property: you would hit backspace from a string of 8
>> digits to 7, and the display property would remain the previously
>> computed date.

SM> You have to explicit remove the `display' property before refreshing
SM> with font-lock.  My sample code did not bother to do it because it was
SM> just a proof of concept.

SM> A naive way to do that is to add `display' to
SM> font-lock-extra-managed-props, tho this will also remove `display'
SM> properties added by other packages for other purposes.
SM> So a better way is to add not just a `display' property but also another
SM> property that is specific to your package, so that you can recognize
SM> which `display' properties are yours, and then in font-lock-keywords you
SM> can add a pseudo-keyword which will look for those display properties
SM> and remove them.

I think the more careful method is a real pain (I couldn't figure it out
in a few hours of digging through the painful details), so I'd rather
override `display' naively.  I would have rather superimposed the date
somehow, like make the line height larger...  I was tempted to use SVG
to render it just how I want, but then it won't work without SVG support
and graphics.

If you want, tell me how to patch my code, attached here, to do it the
smart way.  It doesn't seem like a big deal but if you do...  As I said
I want to put it in the GNU ELPA so if the bar is higher for that
acceptance, I'll work on it some more.

Ted

Attachment: epoch-view.el
Description: application/emacs-lisp


reply via email to

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