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:00:57 -0000
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

On Thu, 16 Dec 2010 21:35:10 -0500 Stefan Monnier <address@hidden> wrote: 

>> I'd rather make this a minor mode than a hook, so I can easily turn it
>> on in a buffer.  Is that easy or hard to do?  Any specific example I can
>> look at?

SM> Use `define-minor-mode' rather than `add-hook'.

Attached is my attempt to view numbers matching "\\<[0-9]\\{8,11\\}\\>"
as dates.  It works all right, but not perfectly.  I looked at
rainbow-mode.el for some of the setup and did some on my own.

It uses the `help-echo' text property, which means you have to use the
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.  If someone could explain how to display the calculated
date in some other way besides `help-echo', or how to use the margins or
something else to show the `help-echo' string, I'd really appreciate it.

Once this is ready I'll put it up on the GNU ELPA or wherever...  It's
really useful for me but others may not find it so useful.

Thanks
Ted

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


reply via email to

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