From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: efficiently viewing Unix timestamps as dates
Date: Thu, 16 Dec 2010 21:35:10 -0500 [thread overview]
Message-ID: <jwvzks5w2is.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 87fwtx5n3c.fsf@lifelogs.com
> (add-hook 'foo-mode-hook
> (lambda ()
> (font-lock-add-keywords
> nil
> '(("[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
> (0 `(face nil display
> ,(format-time-string "%F %T"
> (seconds-to-time
> (car
> (read-from-string
> (concat
> (match-string 0)
> ".0"))))))))))))
> 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?
Use `define-minor-mode' rather than `add-hook'.
Stefan
next prev parent reply other threads:[~2010-12-17 2: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 [this message]
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
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=jwvzks5w2is.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.