I want to set a key binding to insert the date into the buffer. I have written the following lisp in my .emacs file. Using date as an example:
;;put the date
(global-set-key
(kbd "C-c C-d")
(shell-command "date" (current-buffer))
)
The key binding works okay when I use other commands like 'next-line, but shell-command will put it into the *scratch* buffer when the .emacs is read and leaves it at that.
Maybe I need to use shell-command-on-region.
A friend of mine at work helped me.