feat(emacs.d): Add function to insert TODO comments

This commit is contained in:
Vincent Ambo 2019-12-17 12:03:57 +00:00
parent cc68e28514
commit 940a9c580c
2 changed files with 15 additions and 0 deletions

View file

@ -37,4 +37,7 @@
;; Open a file in project: ;; Open a file in project:
(global-set-key (kbd "C-c f") 'project-find-file) (global-set-key (kbd "C-c f") 'project-find-file)
;; Insert TODO comments
(global-set-key (kbd "C-c t") 'insert-todo-comment)
(provide 'bindings) (provide 'bindings)

View file

@ -230,4 +230,16 @@ Including indent-buffer, which should not be called automatically on save."
(goto-char start) (goto-char start)
(insert memed)))) (insert memed))))
(defun insert-todo-comment (prefix todo)
"Insert a comment at point with something for me to do."
(interactive "P\nsWhat needs doing? ")
(save-excursion
(move-end-of-line nil)
(insert (format " %s TODO(%s): %s"
comment-start
(if prefix (read-string "Who needs to do this? ")
(getenv "USER"))
todo))))
(provide 'functions) (provide 'functions)