;; gse-create-dated-file.el ;; Summary: Create files prefixed with today's date. ;; Author: Scott Evans ;; Home: http://www.antisleep.com/elisp ;; Time-stamp: <2004.12.22 23:47:00 gse> ;; ;; Commentary: ;; At work, I started prefixing textfile names with dates -- this ;; way they sort by creation date even after they get updated. ;; This dumb little function does the work for me, and it's easy ;; to put spaces in the filename (unlike with C-x C-f). ;; ;; Installation: ;; (require 'gse-create-dated-file) ;; ;;--------------------------------------------------------------------------- ;; Change Log ;; ---------- ;; 2004.12.22 Created. ;;--------------------------------------------------------------------------- (defun gse-create-dated-file (filename) "Prompt for a filename (spaces no problem) then create the file with the current date prefixed to the name. If .txt is not at the end of filename, appends it. Works in the current folder only for now." (interactive "s(dated) filename: ") (find-file (concat (gse-sortable-date "-") " " filename (if (not (string-match "\\.txt" filename)) ".txt")))) ;; If you like (global-set-key "\C-x\C-d" 'gse-create-dated-file) (provide 'gse-create-dated-file)