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

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

Re: Journal package for Emacs?


From: David Forrest
Subject: Re: Journal package for Emacs?
Date: Sun, 8 Sep 2002 23:22:14 -0400 (EDT)

On Mon, 9 Sep 2002, mike hardy wrote:

...

Mike asked about having the journal open and do a time stamp, and I
thought it might work with hooks, so I wrote this as a venture into
learning elisp.  Is this good elisp?

(defun my-journal-hook ()
  "Go to the bottom and insert a timestamp on journal files
Identified with the is-journal local variable thus:
             -*- is-journal : t -*- "
  (if (local-variable-p 'is-journal)
    (progn (end-of-buffer) ( insert-current-time))
  ))
(add-hook 'find-file-hooks 'my-journal-hook)

;where insert-current-time is:

(defun insert-current-time ()
  "Insert the Current Time in ISO 8601 mode"
   (interactive)
   (insert
       (format-time-string "%Y-%m-%dT%T%z ") ; ISO8601
   )
)

Dave
-- 
 Dave Forrest                                   address@hidden
 (804)642-0662h (434)924-3954w  http://mug.sys.virginia.edu/~drf5n/





reply via email to

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