|
|
|
|
|
by afefers
1330 days ago
|
|
Thank you! Just converted it to Emacs Lisp: (defun new-note ()
(interactive)
(insert "----------------\n")
(insert (shell-command-to-string "echo -n $(date \"+%Y-%m-%d %T\")"))
(insert "\n"))
(global-set-key (kbd "C-M-n") #'new-note)
And to invoke it from the shell: emacs --function new-note --file notes.txt
If somebody knows a better or more elegant way to do this, please tell me! |
|
I had to set keybinding to C-c C-n because I got unmatched parentheses error with C-M-n.
I've been slowly moving to emacs since this summer and got to where I like it better than Vim. I was "forced" to learn it as I am learning Lisp (started with Clojure but moved to Common Lisp).