From 0d35b5a4ad23f8060da9fab46015a653fef2c92b Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 27 Oct 2013 16:17:21 -0400 Subject: "TODO" comment function --- init/km-func.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'init/km-func.el') diff --git a/init/km-func.el b/init/km-func.el index acbeb7d..bf98552 100644 --- a/init/km-func.el +++ b/init/km-func.el @@ -74,6 +74,19 @@ user." (comment-or-uncomment-region beg end)) (forward-line)) +(defun km/todo-comment () + "Add commented TODO" + (interactive) + (let (beg end) + (if (region-active-p) + (setq beg (region-beginning) end (region-end)) + (setq beg (line-beginning-position) end (line-end-position))) + (unless (comment-only-p beg end) + (beginning-of-line) + (insert "TODO ") + (comment-region beg (+ end 5)) + (forward-line)))) + ;; kill functions (defun km/kill-string-at-point () -- cgit v1.2.3