Re: Planner: Readable headers on day pages
Jim Ottaway <[email protected]>
| Newsgroups | gmane.emacs.wiki.general |
|---|---|
| Message-ID | <[email protected]> |
>>>>> Jim Ottaway <[email protected]> writes: >>>>> Phillip Lord <[email protected]> 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