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

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

Re: [emacs-wiki-discuss] Re: Some comments after using planner.el for a


From: Gary V. Vaughan
Subject: Re: [emacs-wiki-discuss] Re: Some comments after using planner.el for a while
Date: Tue, 01 Jun 2004 12:41:42 +0100
User-agent: Mozilla Thunderbird 0.6 (X11/20040502)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Niklas Morberg wrote:
| "Gary V. Vaughan" <address@hidden> writes:
|
|>(defsubst planner-calendar-today (&optional max-days)
|>~  "Return today or the first day before today with a day page."
|>~  (planner-calendar-prev-date
|>~   (planner-calendar-tomorrow (calendar-current-date))))
|>
|>(defun planner-calendar-create-today-link (&optional name)
|>~  "Create a link to the newest published day page."
|>~  (let ((target-file (emacs-wiki-published-file (or name "today")))
|>~        (source-file (emacs-wiki-published-file
|>~                      (planner-calendar-date-to-filename
|>~                       (planner-calendar-today)))))
|>~    (when (file-exists-p target-file)
|>~      (funcall planner-delete-file-function target-file))
|>~    (shell-command
|>~     (format "ln -s %s %s" source-file target-file))))
|>
|>(add-hook 'emacs-wiki-after-file-publish-hook
|>~   'planner-create-today-link nil t)

Oops, that should be 'planner-calendar-create-today-link...

| The code works (at least on a GNU/Linux system). I had
| problems getting the hook to work (even after changing it
| to run planner-calendar-create-today-link :). The hook did
| not seem to be active in my planner buffers.

I think that is my missing -calendar in the hook function.

| (add-hook 'emacs-wiki-mode-hook
|           (lambda () (add-hook 'after-save-hook
|                                'planner-calendar-create-today-link nil t)))

That would be equally valid though.

| Thanks for your help, this was just what I was looking for.

You're welcome.  I've commited this to address@hidden/planner--gary--1.0,
which should filter up into sacha's tree soon.

Cheers,
        Gary.

- --
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAvGt2FRMICSmD1gYRAtJQAJ9wNkk6WYJAXvk2bgD60rqeTIfOLACeNfi0
7qFOjxGZR3mj1D0i7H8/9gw=
=k3wx
-----END PGP SIGNATURE-----




reply via email to

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