summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2013-10-27 16:17:21 -0400
committerKyle Meyer <kyle@kyleam.com>2013-10-27 21:33:32 -0400
commit0d35b5a4ad23f8060da9fab46015a653fef2c92b (patch)
treef5ded51614aae237644f90c17f5e2423c7d5e72a /init
parentf21775df2bd7c405d755471f27cdb1e9aeeb8f2d (diff)
downloademacs.d-0d35b5a4ad23f8060da9fab46015a653fef2c92b.tar.gz
"TODO" comment function
Diffstat (limited to 'init')
-rw-r--r--init/km-func.el13
-rw-r--r--init/km-keybindings.el2
2 files changed, 15 insertions, 0 deletions
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 ()
diff --git a/init/km-keybindings.el b/init/km-keybindings.el
index 4ed2001..2cbe1ae 100644
--- a/init/km-keybindings.el
+++ b/init/km-keybindings.el
@@ -15,3 +15,5 @@
(global-set-key (kbd "C-c r S") 'replace-string)
(global-set-key (kbd "C-c r r") 'query-replace-regexp)
(global-set-key (kbd "C-c r R") 'replace-regexp)
+
+(global-set-key (kbd "C-c c t") 'km/todo-comment)