Next: , Previous: Scheduling and Time, Up: Scheduling and Time


7.2.1 Diary

If you use Emacs's diary feature, Planner-Diary could be helpful for you. It puts all diary entries for the current day in the ‘* Diary’ section of your day plan page. This section is updated every time you display the file in Emacs. By default the diary section of past pages is not updated; it's pretty unlikely that you want to add new diary entries for the past. (see Diary)

If you want to use planner-diary.el, make sure the file is in your load path and add this to your .emacs (or _emacs):

     (require 'planner-diary)

planner-diary.el needs fancy-diary-display. To use fancy-diary-display, add this to your .emacs (or _emacs):

     (add-hook 'diary-display-hook 'fancy-diary-display)

You can use Planner-Diary in two different ways:

  1. If you want the saved files to contain your entries and not just a line of Lisp, add the following lines to your .emacs (or _emacs):
              (setq planner-diary-use-diary t)
              (planner-diary-insinuate)
    

    You should also customize or set planner-day-page-template to include a ‘* Diary’:

              (setq planner-day-page-template
               "* Tasks\n\n\n* Schedule\n\n\n* Diary\n\n\n* Notes")
    

    C-c C-e updates the diary sections. C-u C-c C-e forces an update—it inserts the diary section for the day, even if the day is in the past or if there is no ‘Diary’ section in the buffer.

  2. (GNU EMACS ONLY) You can put the following line of Lisp code in your day plan pages to display your diary entries:
              <lisp>(planner-diary-entries-here)</lisp>
    

    You can do this automatically for all day plan pages:

              (setq planner-day-page-template
                "* Tasks\n\n\n* Diary\n\n<lisp>(planner-diary-entries-here)</lisp>
              \n* Notes")
    

    When you open a day plan page outside Emacs, you will see the line of Lisp code and not your diary entries.

If you want to see your diary entries for more than just one day, set planner-diary-number-of-days accordingly. This works for either of the two approaches.

These diary sections are only intended for display. Editing them will not affect your diary file. If you want to add entries to your diary, you should use the usual Emacs diary and calendar methods for doing that, or call planner-diary-add-entry.

If you want to use the Cal-Desk package, simply follow the instructions in cal-desk.el. If you get the Cal-Desk layout from the Calendar buffer, you get it in the day plan buffer, too.

If you use Planner-Diary, you might consider using the Calendar support of Planner. (see Calendar/Diary) To get Calendar integration, add this to your .emacs (or _emacs):

     (planner-insinuate-calendar)

If planner-diary-create-section-flag is non-nil, sections are always inserted if necessary.

If you want to import Planner entries into your Diary file, the planner2diary.py script will accomplish this for you. To use it, execute planner2diary.py on the command line, specifying your planner directory as the first and only argument.

Options

— User Option: planner-diary-create-section-flag

Non-nil means create the requested diary sections if they do not exist. By default, planner-diary tries to create the section. If you want more control over your pages, you can set this to nil. Trying to write a diary section to a page that does not have it yet will then result in an error.

By default, planner-diary lists only the appointments you have on that day. If you want the date headers included even when showing the diary entries for a single day, set planner-diary-include-all-output to non-nil.

— User Option: planner-diary-include-all-output-flag

Non-nil means don't omit any data when copying diary entries into day pages.

Functions

planner-diary.el defines the following interactive functions:

— Function: planner-diary-add-entry date time text

Prompt for a diary entry to add to diary-file on date. Uses planner-annotation-functions to make hyperlinks. time and text are used in the description."

— Function: planner-diary-insert-diary force

Insert the fancy diary for the day into the day plan file. If force is non-nil, insert a diary section even if there is no planner-diary-string in the buffer.

— Function: planner-diary-insert-diary-maybe force

Maybe insert the fancy diary for the day into the day plan file. If the current day is in the past and force is nil, don't do anything. If force is non-nil, insert a diary section even if there is no planner-diary-string in the buffer.

— Function: planner-diary-insert-appts force

Insert the diary appointments for the day into the day plan file. If force is non-nil, insert a diary appointments section even if there is no planner-diary-appts-string in the buffer.

— Function: planner-diary-insert-appts-maybe force

Maybe insert the diary appointments for the day into the day plan file. If the current day is in the past and force is nil, don't do anything. If force is non-nil, insert a diary appointments section even if there is no planner-diary-appts-string in the buffer.

— Function: planner-diary-insert-cal-desk force

Insert the cal-desk diary for the day into the day plan file. If force is non-nil, insert a cal-desk diary section even if there is no planner-diary-cal-desk-string in the buffer.

— Function: planner-diary-insert-cal-desk-maybe force

Maybe insert the cal-desk diary for the day into the day plan file. If the current day is in the past and force is nil, don't do anything. If force is non-nil, insert a cal-desk appointments section even if there is no planner-diary-cal-desk-string in the buffer.

— Function: planner-diary-insert-public force

Insert the public diary for the day into the day plan file. If force is non-nil, insert a public diary section even if there is no planner-diary-public-string in the buffer.

— Function: planner-diary-insert-public-maybe force

Maybe insert the public diary for the day into the day plan file. If the current day is in the past and force is nil, don't do anything. If force is non-nil, insert a public appointments section even if there is no planner-diary-public-string in the buffer.

— Function: planner-diary-insert-private force

Insert the private diary for the day into the day plan file. If force is non-nil, insert a private diary section even if there is no planner-diary-private-string in the buffer.

— Function: planner-diary-insert-private-maybe force

Maybe insert the private diary for the day into the day plan file. If the current day is in the past and force is nil, don't do anything. If force is non-nil, insert a private appointments section even if there is no planner-diary-private-string in the buffer.

— Function: planner-diary-insert-all-diaries force

Update all diary sections in a day plan file. If force is non-nil, insert a diary section even if there is no section header. It only inserts diaries if the corresponding planner-diary-use-* variable is ‘t’.

— Function: planner-diary-insert-all-diaries-maybe force

Update all diary sections in a day plan file. If the current day is in the past and force is nil, don't do anything. If force is non-nil, insert a diary section even if there is no section header. It only inserts diaries if the corresponding planner-diary-use-* variable is ‘t’.

— Function: planner-diary-show-day-plan-or-diary

Show the day plan or diary entries for the date under point in calendar. Add this to calendar-move-hook if you want to use it. In that case, you should also remove-hookplanner-calendar-show’ from calendar-move-hook.

Keys

planner-diary.el adds the following keybinding to Planner, if planner-diary-insinuate is in your .emacs (or _emacs):