I'm looking for the cleanest way to have a language agnostic keybinding that will insert my initials + formatted timestamp e.g.:
--<my initials> (28 Oct 2013 11:38:20 AM)
into an Emacs buffer, so that I can initial my comments. I know I could create a function and create a keybinding to call it, but I feel like Emacs probably has a de facto way to do stuff like this, presumedly through the use of macros.
F3 (start recording macro)
--AAC-u M-!dateC-e (insert text, insert output fromdatecommand)F4 (stop recording macro)
C-x C-k n
my-initial-timestamp(name the macro)C-x C-k b
...(bind the macro to an appropriate key combination)And finally, open
~/.emacsand type C-u M-xinsert-kbd-macroRETmy-initial-timestamp, which will insert the Lisp code to recreate the macro and bind it to the same key at startup.