diff options
| author | Glenn Morris | 2010-09-14 01:02:28 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-09-14 01:02:28 -0700 |
| commit | 67ae97667d185e23a24a98f295bcf1cd9c788cb5 (patch) | |
| tree | 3f2c2603b25bd63e2cdcf4581720afea76961d06 | |
| parent | 0ab9cff33d60e035ff437639f62cf763610641b1 (diff) | |
| download | emacs-67ae97667d185e23a24a98f295bcf1cd9c788cb5.tar.gz emacs-67ae97667d185e23a24a98f295bcf1cd9c788cb5.zip | |
Doc fixes related to diary-sort-entries.
* lisp/calendar/diary-lib.el (diary-list-entries-hook, diary-sort-entries):
Doc fixes.
* doc/emacs/cal-xtra.texi (Fancy Diary Display): Emphasize that sort
should be the last hook item.
| -rw-r--r-- | doc/emacs/ChangeLog | 3 | ||||
| -rw-r--r-- | doc/emacs/cal-xtra.texi | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 10 |
4 files changed, 16 insertions, 4 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index af408d44a39..2c47fbe0daf 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2010-09-14 Glenn Morris <rgm@gnu.org> | 1 | 2010-09-14 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * cal-xtra.texi (Fancy Diary Display): Emphasize that sort should be | ||
| 4 | the last hook item. | ||
| 5 | |||
| 3 | * calendar.texi (Appointments): Also updated when a diary include file | 6 | * calendar.texi (Appointments): Also updated when a diary include file |
| 4 | is saved. | 7 | is saved. |
| 5 | 8 | ||
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi index 60588542356..de36ccc4f5f 100644 --- a/doc/emacs/cal-xtra.texi +++ b/doc/emacs/cal-xtra.texi | |||
| @@ -613,7 +613,9 @@ each day's diary entries by their time of day. Here's how: | |||
| 613 | @noindent | 613 | @noindent |
| 614 | For each day, this sorts diary entries that begin with a recognizable | 614 | For each day, this sorts diary entries that begin with a recognizable |
| 615 | time of day according to their times. Diary entries without times come | 615 | time of day according to their times. Diary entries without times come |
| 616 | first within each day. | 616 | first within each day. Note how the sort command is placed at the end |
| 617 | of the hook list, in case earlier members of the list change the order | ||
| 618 | of the diary entries, or add items. | ||
| 617 | 619 | ||
| 618 | @vindex diary-include-string | 620 | @vindex diary-include-string |
| 619 | Your main diary file can include other files. This permits a group of | 621 | Your main diary file can include other files. This permits a group of |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66be118bf7e..6098dad51de 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2010-09-14 Glenn Morris <rgm@gnu.org> | 1 | 2010-09-14 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * calendar/diary-lib.el (diary-list-entries-hook, diary-sort-entries): | ||
| 4 | Doc fixes. | ||
| 5 | |||
| 3 | * calendar/diary-lib.el (diary-included-files): New variable. | 6 | * calendar/diary-lib.el (diary-included-files): New variable. |
| 4 | (diary-list-entries): Maybe initialize diary-included-files. | 7 | (diary-list-entries): Maybe initialize diary-included-files. |
| 5 | (diary-include-other-diary-files): Append to diary-included-files. | 8 | (diary-include-other-diary-files): Append to diary-included-files. |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 83b49e91e76..46926050362 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -187,11 +187,12 @@ you will probably also want to add `diary-mark-included-diary-files' to | |||
| 187 | 187 | ||
| 188 | (setq diary-display-function 'diary-fancy-display) | 188 | (setq diary-display-function 'diary-fancy-display) |
| 189 | (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) | 189 | (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) |
| 190 | (add-hook 'diary-list-entries-hook 'diary-sort-entries) | 190 | (add-hook 'diary-list-entries-hook 'diary-sort-entries t) |
| 191 | 191 | ||
| 192 | in your `.emacs' file to cause the fancy diary buffer to be displayed with | 192 | in your `.emacs' file to cause the fancy diary buffer to be displayed with |
| 193 | diary entries from various included files, each day's entries sorted into | 193 | diary entries from various included files, each day's entries sorted into |
| 194 | lexicographic order." | 194 | lexicographic order. Note how the sort function is placed last, |
| 195 | so that it can sort the entries included from other files." | ||
| 195 | :type 'hook | 196 | :type 'hook |
| 196 | :options '(diary-include-other-diary-files diary-sort-entries) | 197 | :options '(diary-include-other-diary-files diary-sort-entries) |
| 197 | :group 'diary) | 198 | :group 'diary) |
| @@ -1584,7 +1585,10 @@ be used instead of a colon (:) to separate the hour and minute parts." | |||
| 1584 | (string-lessp ts1 ts2))))))) | 1585 | (string-lessp ts1 ts2))))))) |
| 1585 | 1586 | ||
| 1586 | (defun diary-sort-entries () | 1587 | (defun diary-sort-entries () |
| 1587 | "Sort the list of diary entries by time of day." | 1588 | "Sort the list of diary entries by time of day. |
| 1589 | If you add this function to `diary-list-entries-hook', it should | ||
| 1590 | be the last item in the hook, in case earlier items add diary | ||
| 1591 | entries, or change the order." | ||
| 1588 | (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare))) | 1592 | (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare))) |
| 1589 | 1593 | ||
| 1590 | (define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1") | 1594 | (define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1") |