◎以下のプログラムは、下記URLに公開されているソースを改変したものです。 下記頁の作者に感謝します。 http://members.tripod.co.jp/kwatch/mule/tips.html ------------------------cut here------------------------- ;; F5キーに割り当てる (define-key global-map [f5] 'my-insert-date) ; ;;; ;;; 日付入力関数 ;;; (defun my-insert-date (arg) "'8/29(Wed)'のような形式で日付を挿入する。 引数 N を渡すと、N日前の日付まで挿入する。" (interactive "p") (if (not arg) (setq arg 1)) (let* ((time (current-time-string)) (weekday (substring time 0 3)) (monthname (substring time 4 7)) (index (string-match monthname "JanFebMarAprMayJunJulAugSepOctNovDec")) (month (+ 1 (/ index 3))) (year (string-to-number (substring time 22 24))) (day (string-to-number (substring time 8 10))) ) (my-insert-date-body arg month day weekday year) )) (defun my-insert-date-body (arg month day weekday year) ;;来年、去年、今年を書式付きで定義 (setq next-year (format "%02d" (+ year 1)) last-year (format "%02d" (- year 1)) this-year (format "%02d" year)) ;; 日付を挿入する (insert ;; *** この行を変えれば、書式が変えられます! ******* (concat "