aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-09-14 01:02:28 -0700
committerGlenn Morris2010-09-14 01:02:28 -0700
commit67ae97667d185e23a24a98f295bcf1cd9c788cb5 (patch)
tree3f2c2603b25bd63e2cdcf4581720afea76961d06
parent0ab9cff33d60e035ff437639f62cf763610641b1 (diff)
downloademacs-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/ChangeLog3
-rw-r--r--doc/emacs/cal-xtra.texi4
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/calendar/diary-lib.el10
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 @@
12010-09-14 Glenn Morris <rgm@gnu.org> 12010-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
614For each day, this sorts diary entries that begin with a recognizable 614For each day, this sorts diary entries that begin with a recognizable
615time of day according to their times. Diary entries without times come 615time of day according to their times. Diary entries without times come
616first within each day. 616first within each day. Note how the sort command is placed at the end
617of the hook list, in case earlier members of the list change the order
618of 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 @@
12010-09-14 Glenn Morris <rgm@gnu.org> 12010-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
192in your `.emacs' file to cause the fancy diary buffer to be displayed with 192in your `.emacs' file to cause the fancy diary buffer to be displayed with
193diary entries from various included files, each day's entries sorted into 193diary entries from various included files, each day's entries sorted into
194lexicographic order." 194lexicographic order. Note how the sort function is placed last,
195so 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.
1589If you add this function to `diary-list-entries-hook', it should
1590be the last item in the hook, in case earlier items add diary
1591entries, 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")