emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] sacha/planner-create-note-from-task


From: Sacha Chua
Subject: [emacs-wiki-discuss] sacha/planner-create-note-from-task
Date: Fri, 19 Nov 2004 22:52:10 +0900
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

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 <address@hidden> - 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]