Insert a comment with username and date in emacs
Posted by Fahdos on Nov 8th, 2007 in Computers
Add the following to your .emacs file:
[text];; insert a comment w/ name and date
(defun insert-comment ()
(interactive)
(comment-dwim “”)
(insert-string “!!! “)
(insert-string (getenv “USER”))
(insert (format-time-string ” %Y%m%d: “)))[/text]
To use it, just type “M-x insert-comment“.
If it’s too much work for you, you can add a shortcut for it, again, in your .emacs, after the insert-comment definition, add the following:
[text](global-set-key “C-xv” ‘insert-comment)[/text]
Now you can insert your comment with just “C-x v“







