logo       

sacha/planner-create-note-from-task: msg#00094

emacs.wiki.general

Subject: sacha/planner-create-note-from-task

This function lets you quickly create a note based on the current
task. It automatically edits the task to link to the note.

BEFORE:

* Tasks

#A0 _ Foo bar (BazProject)

* Notes

AFTER:

* Tasks

#A0 _ Foo bar ... (BazProject)

* Notes

.#1 Foo bar

(cursor here)

;; Improvements:
;; - Link back to the task?
;; - Make it possible to have your note on another page?
(defun sacha/planner-create-note-from-task ()
"Create a note based on the current task."
(interactive)
(let* ((task-info (planner-current-task-info))
note-num)
(when task-info
(setq note-num (planner-create-note (planner-page-name)))
(save-excursion
(save-window-excursion
(when (planner-find-task task-info)
(planner-edit-task-description
(concat (planner-task-description task-info) " "
(planner-make-link
(concat (planner-page-name) "#"
(number-to-string note-num))
"..."))))))
(insert (planner-task-description task-info) "\n\n"))))

If people like it, we can put it into dev and stable. =) (Sans sacha/
prefix, of course.) This can probably be made more flexible, though.
Any ideas?

(planner bloat, one feature at a time! <impish grin>)
--
Sacha Chua <sacha@xxxxxxxxxxx> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
applying as a Debian new maintainer | looking for a grad school


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise