Antonio Garcia on Wed, 5 May 2004 09:21:05 -0700 writes: > I would like to easily interject a timestamp, a la date command, in a > buffer in emacs. Is there a pre-existing macro I can use, or do I have to > make one myself? If the latter, pointers to how to do so appreciated. The following code should work. (setq substitute-keywords-keywords/expressions-alist (list (cons "\\$\Date:.*\\$" '(format-time-string "$\Date: %a, %d %B %Y %T %Z $" (current-time))))) (defun substitute-keywords () (interactive) (save-excursion (beginning-of-buffer) (mapcar (lambda (keyw/exp) (replace-regexp (car keyw/exp) (eval (cdr keyw/exp)))) substitute-keywords-keywords/expressions-alist) nil)) ;; Deprecated. ;; (add-hook 'write-file-hooks 'substitute-keywords) -- Marco Parrone (marc0) [0x45070AD6]