Re: Planner: Readable headers on day pages

Phillip Lord <[email protected]>
Newsgroups gmane.emacs.wiki.general
Message-ID <[email protected]>
>>>>> "JO" == Jim Ottaway <[email protected]> writes:

>>>>> 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.

  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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.