Commit 67ae9766 authored by Glenn Morris's avatar Glenn Morris
Browse files

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.
parent 0ab9cff3
2010-09-14 Glenn Morris <rgm@gnu.org> 2010-09-14 Glenn Morris <rgm@gnu.org>
* cal-xtra.texi (Fancy Diary Display): Emphasize that sort should be
the last hook item.
* calendar.texi (Appointments): Also updated when a diary include file * calendar.texi (Appointments): Also updated when a diary include file
is saved. is saved.
......
...@@ -613,7 +613,9 @@ each day's diary entries by their time of day. Here's how: ...@@ -613,7 +613,9 @@ each day's diary entries by their time of day. Here's how:
@noindent @noindent
For each day, this sorts diary entries that begin with a recognizable For each day, this sorts diary entries that begin with a recognizable
time of day according to their times. Diary entries without times come time of day according to their times. Diary entries without times come
first within each day. first within each day. Note how the sort command is placed at the end
of the hook list, in case earlier members of the list change the order
of the diary entries, or add items.
@vindex diary-include-string @vindex diary-include-string
Your main diary file can include other files. This permits a group of Your main diary file can include other files. This permits a group of
......
2010-09-14 Glenn Morris <rgm@gnu.org> 2010-09-14 Glenn Morris <rgm@gnu.org>
* calendar/diary-lib.el (diary-list-entries-hook, diary-sort-entries):
Doc fixes.
* calendar/diary-lib.el (diary-included-files): New variable. * calendar/diary-lib.el (diary-included-files): New variable.
(diary-list-entries): Maybe initialize diary-included-files. (diary-list-entries): Maybe initialize diary-included-files.
(diary-include-other-diary-files): Append to diary-included-files. (diary-include-other-diary-files): Append to diary-included-files.
......
...@@ -187,11 +187,12 @@ you will probably also want to add `diary-mark-included-diary-files' to ...@@ -187,11 +187,12 @@ you will probably also want to add `diary-mark-included-diary-files' to
(setq diary-display-function 'diary-fancy-display) (setq diary-display-function 'diary-fancy-display)
(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
(add-hook 'diary-list-entries-hook 'diary-sort-entries) (add-hook 'diary-list-entries-hook 'diary-sort-entries t)
in your `.emacs' file to cause the fancy diary buffer to be displayed with in your `.emacs' file to cause the fancy diary buffer to be displayed with
diary entries from various included files, each day's entries sorted into diary entries from various included files, each day's entries sorted into
lexicographic order." lexicographic order. Note how the sort function is placed last,
so that it can sort the entries included from other files."
:type 'hook :type 'hook
:options '(diary-include-other-diary-files diary-sort-entries) :options '(diary-include-other-diary-files diary-sort-entries)
:group 'diary) :group 'diary)
...@@ -1584,7 +1585,10 @@ be used instead of a colon (:) to separate the hour and minute parts." ...@@ -1584,7 +1585,10 @@ be used instead of a colon (:) to separate the hour and minute parts."
(string-lessp ts1 ts2))))))) (string-lessp ts1 ts2)))))))
(defun diary-sort-entries () (defun diary-sort-entries ()
"Sort the list of diary entries by time of day." "Sort the list of diary entries by time of day.
If you add this function to `diary-list-entries-hook', it should
be the last item in the hook, in case earlier items add diary
entries, or change the order."
(setq diary-entries-list (sort diary-entries-list 'diary-entry-compare))) (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare)))
(define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1") (define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment