CVS の $Id:$ のような機能を、ファイル保存時に実行したいです。
time-stamp.elを使って、
(if (not (memq 'time-stamp write-file-hooks))
(setq write-file-hooks
(cons 'time-stamp write-file-hooks)))
とでも設定して、ファイルのどこか(コメント内でも可なはず)に
Time-stamp: <>
と入れておけばsave-buffer時に更新。
タイムスタンプの書式はsetq time-stamp-formatで適宜調整
ずばりこれでした。
ありがとうございます。
http://homepage.mac.com/zenitani/elisp-j.html#time-stamp
(require 'time-stamp) (add-hook 'before-save-hook 'time-stamp) (setq time-stamp-active t) (setq time-stamp-start "last updated : ") (setq time-stamp-format "%04y/%02m/%02d") (setq time-stamp-end " \\|$")
のように、before-save-hook を使うようです。
こちらも、ありがとうございます。
「ファイル保存時に自動的に」という条件を満たしていないようです。