From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: efficiently viewing Unix timestamps as dates Date: Thu, 16 Dec 2010 21:35:10 -0500 Organization: A noiseless patient Spider Message-ID: References: <87mxo9mvxm.fsf@lifelogs.com> <87bp4la59u.fsf@lifelogs.com> <87fwtx5n3c.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292553633 27355 80.91.229.12 (17 Dec 2010 02:40:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Dec 2010 02:40:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 17 03:40:27 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PTQF8-0001fR-Ur for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Dec 2010 03:40:27 +0100 Original-Received: from localhost ([127.0.0.1]:51319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTQF8-00084u-55 for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 21:40:26 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Injection-Info: mx03.eternal-september.org; posting-host="npc8WwhkFofBeKiRj5F6nA"; logging-data="28644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FZPTnPVqEjbb5dgfFzEGe" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:qoZ+BMO3XoeNHe8EkIKX/3PNhzw= sha1:N17aqq9fa2IEyjHY9IDMwp6qkOI= Original-Xref: usenet.stanford.edu gnu.emacs.help:183360 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77612 Archived-At: > (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