1. Save a ~/.todo-do file with entries in two categories, e.g. (this file can be created from emacs -Q, e.g. by calling todo-show): ==cut== -*- mode: todo; todo-categories: ("test" "Todo"); -*- */* --- test */* 2009-11-30 00:47 steve: another item --- End */* --------------------------------------------------------------------------- */* --- Todo */* 2009-11-29 21:48 steve: todo item --- End */* --------------------------------------------------------------------------- ==cut== 2. Save ~/diary with a line to include the todo file: ==cut== #include "~/.todo-do" ==cut== 3. Save ~/.emacs with the following content (or start from emacs -Q and either use the Custom interface for diary-list-entries-hook or eval (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)): ==cut== (custom-set-variables '(diary-list-entries-hook (quote (diary-include-other-diary-files)))) ==cut== 4. Restart Emacs, type `M-x diary', answer y to the question about applying the local variables list for todo-categories. => A buffer pops up with the following fancy diary display: Tuesday, December 1, 2009 ========================= --- test 2009-11-30 00:47 steve: another item --------------------------------------------------------------------------- --- Todo 2009-11-29 21:48 steve: todo item --------------------------------------------------------------------------- 5. Type `M-x todo-show' to visit the todo file in Todo mode (category "test"), then type type `M-x diary' again. => Now fancy diary display looks like this: Tuesday, December 1, 2009 ========================= 2009-11-29 00:47 steve: another item The output after step 5 is incomplete, in contrast to the output after step 4. (The latter is the intended output, as seen by the lines in ~/.todo-do with the prefix '*/*', which are added to each day's diary entries.) This is because diary-list-entries-2 in diary-lib.el, which contains the search routine for new diary entries, does not take possible narrowing into account, and that is in effect in Todo mode. The patch below fixes this. It assumes that narrowing should always be suspended when searching for new diary entries, which seems reasonable (the alternative would, AFAICT, require checking individual major modes). The problem also exists in Emacs 22, but that needs a separate patch to list-diary-entries, due to this function being split up in Emacs 23. I don't have the Emacs 22 CVS branch at hand, so I can't include the needed patch. Steve Berman 2009-12-01 Stephen Berman * calendar/diary-lib.el (diary-list-entries-2): Use save-restriction and widen in order to include all entries from files being visited with narrowing, as in Todo mode (bug#5XXX).