[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] Planner: Readable headers on day pages
From: |
Jim Ottaway |
Subject: |
Re: [emacs-wiki-discuss] Planner: Readable headers on day pages |
Date: |
Wed, 26 Apr 2006 12:45:22 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>>>>> Jim Ottaway <address@hidden> writes:
>>>>> Phillip Lord <address@hidden> writes:
>> It is possible to get readable day titles on the day pages? Sometimes,
>> I've gone into the wrong day page and don't realise, because I don't
>> remember the dates. It would be great to be able to add a title to the
>> top with "Tuesday, 29th Feb", so that I knew where I am.
> You could do something like this:
> <lisp>(calendar-date-string
> (planner-filename-to-calendar-date (planner-page-name)))</lisp>
> Or have a hook that adds a #title directive to day pages using
> something like the above lisp form.
I have just tried the hook method, using this:
(defun planner-insert-date-title-maybe ()
(when (string-match planner-date-regexp (planner-page-name))
(save-excursion
(goto-char (point-min))
(unless (looking-at "#title")
(insert
(format "#title %s\n\n"
(calendar-date-string
(planner-filename-to-calendar-date
(planner-page-name)))))))))
(add-hook 'planner-mode-hook #'planner-insert-date-title-maybe)
Regards,
--
Jim Ottaway