[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: |
Phillip Lord |
Subject: |
Re: [emacs-wiki-discuss] Planner: Readable headers on day pages |
Date: |
Wed, 26 Apr 2006 13:46:38 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
>>>>> "JO" == Jim Ottaway <address@hidden> writes:
>>>>> 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.
JO> I have just tried the hook method, using this:
JO> (defun planner-insert-date-title-maybe ()
JO> (when (string-match planner-date-regexp (planner-page-name))
JO> (save-excursion
JO> (goto-char (point-min)) (unless (looking-at "#title")
JO> (insert
JO> (format "#title %s\n\n"
JO> (calendar-date-string
JO> (planner-filename-to-calendar-date
JO> (planner-page-name)))))))))
JO> (add-hook 'planner-mode-hook #'planner-insert-date-title-maybe)
Worked perfectly, thanks!
Or, at least, perfectly once I figured out how to change the day and
the month around properly. Calendar's i18n leaves something to be
desired.
Cheers
Phil