3 ms·
This is what I have, it def could be improved: (defun capture-comment-line (&optional line) (let ((c (save-excursion (save-window-e
by Vekz 4y ago
This is what I have, it def could be improved:
(defun capture-comment-line (&optional line)
(let ((c
(save-excursion
(save-window-excursion
(switch-to-buffer (plist-get org-capture-plist :original-buffer))
comment-start)
)))
(while (string-prefix-p c line)
(setq line (string-remove-prefix c line)))
(comment-string-strip line t t)
))
(setq org-capture-templates
'(("C" "TODO code comment" entry (file+headline "~/org/brain/code.org" "Tasks")
"\* %(capture-comment-line \"%i\")\n %a"
)))
- wanderingmind 4y agoThank you very much