[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] putting xref's in the plan pages.
From: |
Joe Steeve |
Subject: |
[emacs-wiki-discuss] putting xref's in the plan pages. |
Date: |
Tue, 07 Dec 2004 14:40:46 +0530 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
By doing the following.,
(setq remember-planner-copy-on-xref-flag nil)
The actual note is saved in the plan page and a xref to it in the
day page. However, when a lot of information comes by., the plan
page becomes very big. I thought it might be handier to have the
xrefs in the plan page pointing to the actual notes which may be
left in the day pages.. I copied the function
remember-planner-add-xref from remember-planner.el and modified it
slightly to the following..,
(defun remember-planner-add-xref-to-plan-page ()
"Leave the main text in the day page and add a cross-reference to
the plan page. "
(when (string-match planner-date-regexp (planner-page-name))
(goto-char (point-min))
(when (looking-at "^.#\\([0-9]+\\)\\s-+\\(.*\\)")
(let* (plan-number
(day-number (match-string-no-properties 1))
(day-page (planner-today))
(title (match-string-no-properties 2))
(planner-default-page (or remember-planner-page (planner-today)))
(body (buffer-substring-no-properties (line-end-position)
(point-max)))
(plan-page (planner-read-name (planner-file-alist))))
(unless (or (not plan-page) (equal plan-page (planner-today)))
(save-window-excursion
(setq plan-number (number-to-string
(planner-create-note plan-page)))
(insert title " ([[" day-page "#" day-number "]])")
(when remember-save-after-remembering
(save-buffer)))
(goto-char (line-end-position))
(insert " ([[" plan-page "#" plan-number "]])"))))))
I added it to the hook remember-planner-append-hook and it seems
to do what I want. I'm very much new at elisp., so please have a
look at it and make sure I've not made any blunders
--
A proud GNU user
http://www.joesteeve.tk/ | http://gnukid.shyper.com/
pgpW2BpdGjn_u.pgp
Description: PGP signature
- [emacs-wiki-discuss] putting xref's in the plan pages.,
Joe Steeve <=