aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2008-11-30 01:01:18 +0000
committerJuanma Barranquero2008-11-30 01:01:18 +0000
commit64ba814f12fea7884d6cc2c9e58f63b12b7d79f5 (patch)
tree8209080c6587ae2e5d5c7b17563a4791b7e94862
parent0aec90c95b73d821a311a811163695d57f33ef05 (diff)
downloademacs-64ba814f12fea7884d6cc2c9e58f63b12b7d79f5.tar.gz
emacs-64ba814f12fea7884d6cc2c9e58f63b12b7d79f5.zip
* calendar/diary-lib.el (diary-cyclic): Doc fix.
(diary-remind-message, diary-number-of-entries) (diary-include-other-diary-files, diary-mark-included-diary-files) (diary-view-entries, diary-date, diary-block, diary-insert-entry-1) (diary-font-lock-keywords-1): Reflow docstrings. (diary-add-to-list, calendar-mark-1, diary-entry-time, diary-make-date) (diary-anniversary, diary-date-display-form): Fix typos in docstrings. * emacs-lisp/timer.el (timer-duration-words): Fix typo in docstring. (timer-duration): Use `string-match-p'.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/calendar/diary-lib.el103
-rw-r--r--lisp/emacs-lisp/timer.el6
3 files changed, 67 insertions, 55 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2a63e8e12a2..2c6c789b67b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12008-11-30 Juanma Barranquero <lekktu@gmail.com>
2
3 * calendar/diary-lib.el (diary-cyclic): Doc fix.
4 (diary-remind-message, diary-number-of-entries)
5 (diary-include-other-diary-files, diary-mark-included-diary-files)
6 (diary-view-entries, diary-date, diary-block, diary-insert-entry-1)
7 (diary-font-lock-keywords-1): Reflow docstrings.
8 (diary-add-to-list, calendar-mark-1, diary-entry-time, diary-make-date)
9 (diary-anniversary, diary-date-display-form): Fix typos in docstrings.
10
11 * emacs-lisp/timer.el (timer-duration-words): Fix typo in docstring.
12 (timer-duration): Use `string-match-p'.
13
12008-11-29 Chong Yidong <cyd@stupidchicken.com> 142008-11-29 Chong Yidong <cyd@stupidchicken.com>
2 15
3 * complete.el (PC-do-complete-and-exit): Use 16 * complete.el (PC-do-complete-and-exit): Use
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index d88144559ea..55a018eebab 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -286,8 +286,8 @@ with no recognizable time after those with times."
286 "Pseudo-pattern giving form of reminder messages in the fancy diary display. 286 "Pseudo-pattern giving form of reminder messages in the fancy diary display.
287 287
288Used by the function `diary-remind', a pseudo-pattern is a list of 288Used by the function `diary-remind', a pseudo-pattern is a list of
289expressions that can involve the keywords `days' (a number), `date' (a list of 289expressions that can involve the keywords `days' (a number), `date'
290month, day, year), and `diary-entry' (a string)." 290\(a list of month, day, year), and `diary-entry' (a string)."
291 :type 'sexp 291 :type 'sexp
292 :group 'diary) 292 :group 'diary)
293 293
@@ -430,21 +430,20 @@ just visiting the `diary-file'), and SYMBOL's value is to be changed."
430 430
431(defcustom diary-number-of-entries 1 431(defcustom diary-number-of-entries 1
432 "Specifies how many days of diary entries are to be displayed initially. 432 "Specifies how many days of diary entries are to be displayed initially.
433This variable affects the diary display when the command \\[diary] is used, 433This variable affects the diary display when the command \\[diary] is
434or if the value of the variable `calendar-view-diary-initially-flag' is non-nil. 434used, or if the value of the variable `calendar-view-diary-initially-flag'
435For example, if the default value 1 is used, then only the current day's diary 435is non-nil. For example, if the default value 1 is used, then only the
436entries will be displayed. If the value 2 is used, then both the current 436current day's diary entries will be displayed. If the value 2 is used,
437day's and the next day's entries will be displayed. 437then both the current day's and the next day's entries will be displayed.
438 438
439The value can also be a vector such as [0 2 2 2 2 4 1]; this value 439The value can also be a vector such as [0 2 2 2 2 4 1]; this value says
440says to display no diary entries on Sunday, the entries for 440to display no diary entries on Sunday, the entries for the current date
441the current date and the day after on Monday through Thursday, 441and the day after on Monday through Thursday, Friday through Monday's
442Friday through Monday's entries on Friday, and only Saturday's 442entries on Friday, and only Saturday's entries on Saturday.
443entries on Saturday.
444 443
445This variable does not affect the diary display with the `d' command 444This variable does not affect the diary display with the `d' command
446from the calendar; in that case, the prefix argument controls the 445from the calendar; in that case, the prefix argument controls the number
447number of days of diary entries displayed." 446of days of diary entries displayed."
448 :type '(choice (integer :tag "Entries") 447 :type '(choice (integer :tag "Entries")
449 (vector :value [0 0 0 0 0 0 0] 448 (vector :value [0 0 0 0 0 0 0]
450 (integer :tag "Sunday") 449 (integer :tag "Sunday")
@@ -485,8 +484,8 @@ does nothing. This function is suitable for execution in a `.emacs' file."
485;;;###cal-autoload 484;;;###cal-autoload
486(defun diary-view-entries (&optional arg) 485(defun diary-view-entries (&optional arg)
487 "Prepare and display a buffer with diary entries. 486 "Prepare and display a buffer with diary entries.
488Searches the file named in `diary-file' for entries that 487Searches the file named in `diary-file' for entries that match
489match ARG days starting with the date indicated by the cursor position 488ARG days starting with the date indicated by the cursor position
490in the displayed three-month calendar." 489in the displayed three-month calendar."
491 (interactive "p") 490 (interactive "p")
492 (diary-check-diary-file) 491 (diary-check-diary-file)
@@ -587,13 +586,13 @@ The function takes a string argument and must return a string.")
587(defun diary-add-to-list (date string specifier &optional marker 586(defun diary-add-to-list (date string specifier &optional marker
588 globcolor literal) 587 globcolor literal)
589 "Add an entry to `diary-entries-list'. 588 "Add an entry to `diary-entries-list'.
590Do nothing if DATE or STRING is nil. DATE is the (MONTH DAY 589Do nothing if DATE or STRING are nil. DATE is the (MONTH DAY
591YEAR) for which the entry applies; STRING is the text of the 590YEAR) for which the entry applies; STRING is the text of the
592entry as it will appear in the diary (i.e. with any format 591entry as it will appear in the diary (i.e. with any format
593strings such as \"%d\" expanded); SPECIFIER is the date part of 592strings such as \"%d\" expanded); SPECIFIER is the date part of
594the entry as it appears in the diary-file; LITERAL is the entry 593the entry as it appears in the diary-file; LITERAL is the entry
595as it appears in the diary-file (i.e. before expansion). If 594as it appears in the diary-file (i.e. before expansion).
596LITERAL is nil, it is taken to be the same as STRING. 595If LITERAL is nil, it is taken to be the same as STRING.
597 596
598The entry is added to the list as (DATE STRING SPECIFIER LOCATOR 597The entry is added to the list as (DATE STRING SPECIFIER LOCATOR
599GLOBCOLOR), where LOCATOR has the form (MARKER FILENAME LITERAL), 598GLOBCOLOR), where LOCATOR has the form (MARKER FILENAME LITERAL),
@@ -822,8 +821,8 @@ it enables you to use shared diary files together with your own.
822The files included are specified in the `diary-file' by lines of this form: 821The files included are specified in the `diary-file' by lines of this form:
823 #include \"filename\" 822 #include \"filename\"
824This is recursive; that is, #include directives in diary files thus included 823This is recursive; that is, #include directives in diary files thus included
825are obeyed. You can change the `#include' to some other string by 824are obeyed. You can change the `#include' to some other string by changing
826changing the variable `diary-include-string'." 825the variable `diary-include-string'."
827 (goto-char (point-min)) 826 (goto-char (point-min))
828 (while (re-search-forward 827 (while (re-search-forward
829 (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string)) 828 (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string))
@@ -1384,8 +1383,8 @@ you to use shared diary files together with your own. The files included are
1384specified in the `diary-file' by lines of this form: 1383specified in the `diary-file' by lines of this form:
1385 #include \"filename\" 1384 #include \"filename\"
1386This is recursive; that is, #include directives in diary files thus included 1385This is recursive; that is, #include directives in diary files thus included
1387are obeyed. You can change the `#include' to some other string by 1386are obeyed. You can change the `#include' to some other string by changing
1388changing the variable `diary-include-string'." 1387the variable `diary-include-string'."
1389 (goto-char (point-min)) 1388 (goto-char (point-min))
1390 (while (re-search-forward 1389 (while (re-search-forward
1391 (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string)) 1390 (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string))
@@ -1501,7 +1500,7 @@ Optional argument COLOR is passed to `calendar-mark-visible-date' as MARK."
1501(defun calendar-mark-1 (month day year fromabs toabs &optional color) 1500(defun calendar-mark-1 (month day year fromabs toabs &optional color)
1502 "Mark dates in the calendar conforming to MONTH DAY YEAR of some system. 1501 "Mark dates in the calendar conforming to MONTH DAY YEAR of some system.
1503The function FROMABS converts absolute dates to the appropriate date system. 1502The function FROMABS converts absolute dates to the appropriate date system.
1504The function TOABDS carries out the inverse operation. Optional argument 1503The function TOABS carries out the inverse operation. Optional argument
1505COLOR is passed to `calendar-mark-visible-date' as MARK." 1504COLOR is passed to `calendar-mark-visible-date' as MARK."
1506 (save-excursion 1505 (save-excursion
1507 (set-buffer calendar-buffer) 1506 (set-buffer calendar-buffer)
@@ -1536,7 +1535,7 @@ For example, returns 1325 for 1:25pm.
1536 1535
1537Returns `diary-unknown-time' (default value -9999) if no time is recognized. 1536Returns `diary-unknown-time' (default value -9999) if no time is recognized.
1538The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam, 1537The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam,
1539XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, or XX:XXPM. A period (.) can 1538XXAM, XXpm, XXPM, XX:XXam, XX:XXAM, XX:XXpm, or XX:XXPM. A period (.) can
1540be used instead of a colon (:) to separate the hour and minute parts." 1539be used instead of a colon (:) to separate the hour and minute parts."
1541 (let (case-fold-search) 1540 (let (case-fold-search)
1542 (cond ((string-match ; military time 1541 (cond ((string-match ; military time
@@ -1739,7 +1738,7 @@ best if they are non-marking."
1739 "Convert A B C into the internal calendar date form. 1738 "Convert A B C into the internal calendar date form.
1740The expected order of the inputs depends on `calendar-date-style', 1739The expected order of the inputs depends on `calendar-date-style',
1741e.g. in the European case, A = day, B = month, C = year. Returns 1740e.g. in the European case, A = day, B = month, C = year. Returns
1742a list\(MONTH DAY YEAR), i.e. the American style, which is the 1741a list (MONTH DAY YEAR), i.e. the American style, which is the
1743form used internally by the calendar and diary." 1742form used internally by the calendar and diary."
1744 (cond ((eq calendar-date-style 'iso) ; YMD 1743 (cond ((eq calendar-date-style 'iso) ; YMD
1745 (list b c a)) 1744 (list b c a))
@@ -1756,13 +1755,13 @@ form used internally by the calendar and diary."
1756;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. 1755;; To be called from diary-sexp-entry, where DATE, ENTRY are bound.
1757(defun diary-date (month day year &optional mark) 1756(defun diary-date (month day year &optional mark)
1758 "Specific date(s) diary entry. 1757 "Specific date(s) diary entry.
1759Entry applies if date is MONTH, DAY, YEAR. Each parameter can be 1758Entry applies if date is MONTH, DAY, YEAR. Each parameter can be a
1760a list of integers, `t' (meaning all values), or an integer. The 1759list of integers, `t' (meaning all values), or an integer. The order
1761order of the input parameters changes according to `calendar-date-style' 1760of the input parameters changes according to `calendar-date-style'
1762\(e.g. to DAY MONTH YEAR in the European style). 1761\(e.g. to DAY MONTH YEAR in the European style).
1763 1762
1764An optional parameter MARK specifies a face or single-character string to 1763An optional parameter MARK specifies a face or single-character string
1765use when highlighting the day in the calendar." 1764to use when highlighting the day in the calendar."
1766 (let* ((ddate (diary-make-date month day year)) 1765 (let* ((ddate (diary-make-date month day year))
1767 (dd (calendar-extract-day ddate)) 1766 (dd (calendar-extract-day ddate))
1768 (mm (calendar-extract-month ddate)) 1767 (mm (calendar-extract-month ddate))
@@ -1785,12 +1784,12 @@ use when highlighting the day in the calendar."
1785;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. 1784;; To be called from diary-sexp-entry, where DATE, ENTRY are bound.
1786(defun diary-block (m1 d1 y1 m2 d2 y2 &optional mark) 1785(defun diary-block (m1 d1 y1 m2 d2 y2 &optional mark)
1787 "Block diary entry. 1786 "Block diary entry.
1788Entry applies if date is between, or on one of, two dates. The 1787Entry applies if date is between, or on one of, two dates. The order
1789order of the input parameters changes according to 1788of the input parameters changes according to `calendar-date-style'
1790`calendar-date-style' (e.g. to D1, M1, Y1, D2, M2, Y2 in the European style). 1789\(e.g. to D1, M1, Y1, D2, M2, Y2 in the European style).
1791 1790
1792An optional parameter MARK specifies a face or single-character string to 1791An optional parameter MARK specifies a face or single-character string
1793use when highlighting the day in the calendar." 1792to use when highlighting the day in the calendar."
1794 (let ((date1 (calendar-absolute-from-gregorian 1793 (let ((date1 (calendar-absolute-from-gregorian
1795 (diary-make-date m1 d1 y1))) 1794 (diary-make-date m1 d1 y1)))
1796 (date2 (calendar-absolute-from-gregorian 1795 (date2 (calendar-absolute-from-gregorian
@@ -1879,11 +1878,11 @@ Entry applies if date is the anniversary of MONTH, DAY, YEAR.
1879The order of the input parameters changes according to 1878The order of the input parameters changes according to
1880`calendar-date-style' (e.g. to DAY MONTH YEAR in the European style). 1879`calendar-date-style' (e.g. to DAY MONTH YEAR in the European style).
1881 1880
1882The diary entry can contain `%d' or `%d%s'; the %d will be 1881The diary entry can contain `%d' or `%d%s'; the %d will be replaced
1883replaced by the number of years since the MONTH, DAY, YEAR, and the 1882by the number of years since the MONTH, DAY, YEAR, and the %s will
1884%s will be replaced by the ordinal ending of that number (that 1883be replaced by the ordinal ending of that number (that is, `st',
1885is, `st', `nd', `rd' or `th', as appropriate. The anniversary of 1884`nd', `rd' or `th', as appropriate). The anniversary of February 29
1886February 29 is considered to be March 1 in non-leap years. 1885is considered to be March 1 in non-leap years.
1887 1886
1888An optional parameter MARK specifies a face or single-character 1887An optional parameter MARK specifies a face or single-character
1889string to use when highlighting the day in the calendar." 1888string to use when highlighting the day in the calendar."
@@ -1904,10 +1903,10 @@ string to use when highlighting the day in the calendar."
1904 "Cycle diary entry--entry applies every N days starting at MONTH, DAY, YEAR. 1903 "Cycle diary entry--entry applies every N days starting at MONTH, DAY, YEAR.
1905The order of the input parameters changes according to 1904The order of the input parameters changes according to
1906`calendar-date-style' (e.g. to N DAY MONTH YEAR in the European 1905`calendar-date-style' (e.g. to N DAY MONTH YEAR in the European
1907style). ENTRY can contain `%d' or `%d%s'; the %d will be 1906style). The entry can contain `%d' or `%d%s'; the %d will be
1908replaced by the number of repetitions since the MONTH DAY YEAR, 1907replaced by the number of repetitions since the MONTH DAY YEAR,
1909and %s by the ordinal ending of that number (that is, `st', `nd', 1908and %s by the ordinal ending of that number (that is, `st', `nd',
1910`rd' or `th', as appropriate. 1909`rd' or `th', as appropriate).
1911 1910
1912An optional parameter MARK specifies a face or single-character 1911An optional parameter MARK specifies a face or single-character
1913string to use when highlighting the day in the calendar." 1912string to use when highlighting the day in the calendar."
@@ -2022,7 +2021,7 @@ Prefix argument ARG makes the entry nonmarking."
2022 'diary-insert-weekly-entry "23.1") 2021 'diary-insert-weekly-entry "23.1")
2023 2022
2024(defun diary-date-display-form (&optional type) 2023(defun diary-date-display-form (&optional type)
2025 "Return value for `calendar-date-display-form' using `calendar-date-style.' 2024 "Return value for `calendar-date-display-form' using `calendar-date-style'.
2026Optional symbol TYPE is either `monthly' or `yearly'." 2025Optional symbol TYPE is either `monthly' or `yearly'."
2027 (cond ((eq type 'monthly) (cond ((eq calendar-date-style 'iso) 2026 (cond ((eq type 'monthly) (cond ((eq calendar-date-style 'iso)
2028 '((format "*-*-%.2d" 2027 '((format "*-*-%.2d"
@@ -2048,11 +2047,11 @@ Optional symbol TYPE is either `monthly' or `yearly'."
2048 2047
2049(defun diary-insert-entry-1 (&optional type nomark months symbol absfunc) 2048(defun diary-insert-entry-1 (&optional type nomark months symbol absfunc)
2050 "Subroutine to insert a diary entry related to the date at point. 2049 "Subroutine to insert a diary entry related to the date at point.
2051TYPE is the type of entry (`monthly' or `yearly'). NOMARK 2050TYPE is the type of entry (`monthly' or `yearly'). NOMARK non-nil
2052non-nil means make the entry non-marking. Array MONTHS is used 2051means make the entry non-marking. Array MONTHS is used in place
2053in place of `calendar-month-name-array'. String SYMBOL marks the 2052of `calendar-month-name-array'. String SYMBOL marks the type of
2054type of diary entry. Function ABSFUNC converts absolute dates to 2053diary entry. Function ABSFUNC converts absolute dates to dates of
2055dates of the appropriate type." 2054the appropriate type."
2056 (let ((calendar-date-display-form (if type 2055 (let ((calendar-date-display-form (if type
2057 (diary-date-display-form type) 2056 (diary-date-display-form type)
2058 calendar-date-display-form)) 2057 calendar-date-display-form))
@@ -2218,8 +2217,8 @@ names."
2218(defmacro diary-font-lock-keywords-1 (markfunc listfunc feature months symbol) 2217(defmacro diary-font-lock-keywords-1 (markfunc listfunc feature months symbol)
2219 "Subroutine of the function `diary-font-lock-keywords'. 2218 "Subroutine of the function `diary-font-lock-keywords'.
2220If MARKFUNC is a member of `diary-nongregorian-marking-hook', or 2219If MARKFUNC is a member of `diary-nongregorian-marking-hook', or
2221LISTFUNC of `diary-nongregorian-listing-hook', then require FEATURE 2220LISTFUNC of `diary-nongregorian-listing-hook', then require FEATURE and
2222and return a font-lock pattern matching array of MONTHS and marking SYMBOL." 2221return a font-lock pattern matching array of MONTHS and marking SYMBOL."
2223 `(when (or (memq ',markfunc diary-nongregorian-marking-hook) 2222 `(when (or (memq ',markfunc diary-nongregorian-marking-hook)
2224 (memq ',listfunc diary-nongregorian-listing-hook)) 2223 (memq ',listfunc diary-nongregorian-listing-hook))
2225 (require ',feature) 2224 (require ',feature)
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 9f5f72d81fe..03d41936248 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -487,7 +487,7 @@ The argument should be a value previously returned by `with-timeout-suspend'."
487 (dolist (elt timer-spec-list) 487 (dolist (elt timer-spec-list)
488 (let ((timer (car elt)) 488 (let ((timer (car elt))
489 (delay (cadr elt))) 489 (delay (cadr elt)))
490 (timer-set-time timer (time-add (current-time) delay)) 490 (timer-set-time timer (time-add (current-time) delay))
491 (timer-activate timer)))) 491 (timer-activate timer))))
492 492
493(defun y-or-n-p-with-timeout (prompt seconds default-value) 493(defun y-or-n-p-with-timeout (prompt seconds default-value)
@@ -512,7 +512,7 @@ If the user does not answer after SECONDS seconds, return DEFAULT-VALUE."
512 (cons "month" (* 30 24 60 60)) ; Approximation 512 (cons "month" (* 30 24 60 60)) ; Approximation
513 (cons "year" (* 365.25 24 60 60)) ; Approximation 513 (cons "year" (* 365.25 24 60 60)) ; Approximation
514 ) 514 )
515 "Alist mapping temporal words to durations in seconds") 515 "Alist mapping temporal words to durations in seconds.")
516 516
517(defun timer-duration (string) 517(defun timer-duration (string)
518 "Return number of seconds specified by STRING, or nil if parsing fails." 518 "Return number of seconds specified by STRING, or nil if parsing fails."
@@ -534,7 +534,7 @@ If the user does not answer after SECONDS seconds, return DEFAULT-VALUE."
534 start (length string))))) 534 start (length string)))))
535 (if (= start (length string)) 535 (if (= start (length string))
536 secs 536 secs
537 (if (string-match "\\`[0-9.]+\\'" string) 537 (if (string-match-p "\\`[0-9.]+\\'" string)
538 (string-to-number string))))) 538 (string-to-number string)))))
539 539
540(provide 'timer) 540(provide 'timer)