I currently have a function like so in my .emacs
file:
(defun insert-todo ()
(interactive)
(insert "// TODO(map) : ")
)
It is bound to my key combination of "C-t"
. This will work for me if I'm doing Java or JavaScript code as the //
is the start of a comment for that particular language. However, I want to dynamically insert the appropriate comment character based on the major mode I'm in.
For example:
Java Mode -> //
Python mode -> #
Lisp mode -> ;;
etc...
So how do I, in my .emacs
config file, get the current major mode so I can insert the appropriate comment characters before adding my TODO string?
newcomment.el
which provides functionality for language-agnostic commentary.TODO(map)
as that is what I do searches on in my code before commits.