diff options
| author | Glenn Morris | 2008-03-29 02:44:24 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-29 02:44:24 +0000 |
| commit | cc4b5cd31cc2a8a5821f903826daee60490a5ef1 (patch) | |
| tree | d5fa342b148b4ddb5199c377d4e790ebda4ac8a1 | |
| parent | 8266a036d7ce5f73f448387b704b4a773d8f3da3 (diff) | |
| download | emacs-cc4b5cd31cc2a8a5821f903826daee60490a5ef1.tar.gz emacs-cc4b5cd31cc2a8a5821f903826daee60490a5ef1.zip | |
(number): Move declaration where needed.
(diary-mail-entries, list-sexp-diary-entries): Doc fixes.
(diary-make-date): New function.
(diary-date, diary-block, diary-anniversary, diary-cyclic): Doc fix.
Use diary-make-date.
(diary-date-display-form, diary-insert-entry-1): New functions.
(insert-monthly-diary-entry, insert-yearly-diary-entry):
Use diary-insert-entry-1.
(insert-anniversary-diary-entry, insert-block-diary-entry)
(insert-cyclic-diary-entry): Use diary-date-display-form.
| -rw-r--r-- | lisp/calendar/diary-lib.el | 272 |
1 files changed, 149 insertions, 123 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 7e0f7649a37..1d8589f35a5 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -550,8 +550,6 @@ FILENAME being the file containing the diary entry." | |||
| 550 | (list marker (buffer-file-name) literal) | 550 | (list marker (buffer-file-name) literal) |
| 551 | globcolor)))))) | 551 | globcolor)))))) |
| 552 | 552 | ||
| 553 | (defvar number) ; not clear this should use number | ||
| 554 | |||
| 555 | (defun diary-list-entries-2 (date mark globattr list-only | 553 | (defun diary-list-entries-2 (date mark globattr list-only |
| 556 | &optional months symbol) | 554 | &optional months symbol) |
| 557 | "Internal subroutine of `diary-list-entries'. | 555 | "Internal subroutine of `diary-list-entries'. |
| @@ -623,6 +621,7 @@ entries of the desired type. Returns non-nil if any entries were found." | |||
| 623 | (defvar original-date) ; from diary-list-entries | 621 | (defvar original-date) ; from diary-list-entries |
| 624 | (defvar file-glob-attrs) | 622 | (defvar file-glob-attrs) |
| 625 | (defvar list-only) | 623 | (defvar list-only) |
| 624 | (defvar number) | ||
| 626 | 625 | ||
| 627 | (defun diary-list-entries-1 (months symbol absfunc) | 626 | (defun diary-list-entries-1 (months symbol absfunc) |
| 628 | "List diary entries of a certain type. | 627 | "List diary entries of a certain type. |
| @@ -1052,7 +1051,7 @@ should ensure that all relevant variables are set. | |||
| 1052 | 1051 | ||
| 1053 | \(setq diary-mail-days 3 | 1052 | \(setq diary-mail-days 3 |
| 1054 | diary-file \"/path/to/diary.file\" | 1053 | diary-file \"/path/to/diary.file\" |
| 1055 | european-calendar-style t | 1054 | calendar-date-style 'european |
| 1056 | diary-mail-addr \"user@host.name\") | 1055 | diary-mail-addr \"user@host.name\") |
| 1057 | 1056 | ||
| 1058 | \(diary-mail-entries) | 1057 | \(diary-mail-entries) |
| @@ -1519,12 +1518,13 @@ on a weekend: | |||
| 1519 | A number of built-in functions are available for this type of | 1518 | A number of built-in functions are available for this type of |
| 1520 | diary entry. In the following, the optional parameter MARK | 1519 | diary entry. In the following, the optional parameter MARK |
| 1521 | specifies a face or single-character string to use when | 1520 | specifies a face or single-character string to use when |
| 1522 | highlighting the day in the calendar. | 1521 | highlighting the day in the calendar. For those functions that |
| 1522 | take MONTH, DAY, and YEAR as arguments, the order of the input | ||
| 1523 | parameters changes according to `calendar-date-style' (e.g. to | ||
| 1524 | DAY MONTH YEAR in the European style). | ||
| 1523 | 1525 | ||
| 1524 | %%(diary-date MONTH DAY YEAR &optional MARK) text | 1526 | %%(diary-date MONTH DAY YEAR &optional MARK) text |
| 1525 | Entry applies if date is MONTH, DAY, YEAR. (If | 1527 | Entry applies if date is MONTH, DAY, YEAR. DAY, MONTH, and YEAR can |
| 1526 | `european-calendar-style' is non-nil, the parameter order | ||
| 1527 | should be changed to DAY, MONTH, YEAR). DAY, MONTH, and YEAR can | ||
| 1528 | be a list of integers, `t' (meaning all values), or an integer. | 1528 | be a list of integers, `t' (meaning all values), or an integer. |
| 1529 | 1529 | ||
| 1530 | %%(diary-float MONTH DAYNAME N &optional DAY MARK) text | 1530 | %%(diary-float MONTH DAYNAME N &optional DAY MARK) text |
| @@ -1537,25 +1537,22 @@ highlighting the day in the calendar. | |||
| 1537 | 1537 | ||
| 1538 | %%(diary-block M1 D1 Y1 M2 D2 Y2 &optional MARK) text | 1538 | %%(diary-block M1 D1 Y1 M2 D2 Y2 &optional MARK) text |
| 1539 | Entry will appear on dates between M1/D1/Y1 and M2/D2/Y2, | 1539 | Entry will appear on dates between M1/D1/Y1 and M2/D2/Y2, |
| 1540 | inclusive. (If `european-calendar-style' is non-nil, the | 1540 | inclusive. |
| 1541 | parameter order should be changed to D1, M1, Y1, D2, M2, Y2.) | ||
| 1542 | 1541 | ||
| 1543 | %%(diary-anniversary MONTH DAY YEAR &optional MARK) text | 1542 | %%(diary-anniversary MONTH DAY YEAR &optional MARK) text |
| 1544 | Entry will appear on anniversary dates of MONTH DAY, | 1543 | Entry will appear on anniversary dates of MONTH DAY, YEAR. |
| 1545 | YEAR. (If `european-calendar-style' is non-nil, the parameter | 1544 | Text can contain `%d' or `%d%s'; `%d' will be replaced by the |
| 1546 | order should be changed to DAY, MONTH, YEAR.) Text | 1545 | number of years since the MONTH DAY, YEAR, and `%s' by the |
| 1547 | can contain `%d' or `%d%s'; `%d' will be replaced by the number of | 1546 | ordinal ending of that number (i.e. `st', `nd', `rd' or `th', |
| 1548 | years since the MONTH DAY, YEAR, and `%s' by the ordinal ending of | 1547 | as appropriate). The anniversary of February 29 is |
| 1549 | that number (i.e. `st', `nd', `rd' or `th', as appropriate). The | 1548 | considered to be March 1 in a non-leap year. |
| 1550 | anniversary of February 29 is considered to be March 1 in a non-leap year. | ||
| 1551 | 1549 | ||
| 1552 | %%(diary-cyclic N MONTH DAY YEAR &optional MARK) text | 1550 | %%(diary-cyclic N MONTH DAY YEAR &optional MARK) text |
| 1553 | Entry will appear every N days, starting MONTH DAY, YEAR. (If | 1551 | Entry will appear every N days, starting MONTH DAY, YEAR. |
| 1554 | `european-calendar-style' is non-nil, the parameter order | 1552 | Text can contain `%d' or `%d%s'; `%d' will be replaced by the |
| 1555 | should be changed to N, DAY, MONTH, YEAR.) Text | 1553 | number of repetitions since the MONTH DAY, YEAR and `%s' by |
| 1556 | can contain `%d' or `%d%s'; `%d' will be replaced by the number of | 1554 | the ordinal ending of that number (i.e. `st', `nd', `rd' or |
| 1557 | repetitions since the MONTH DAY, YEAR and `%s' by the ordinal ending | 1555 | `th', as appropriate). |
| 1558 | of that number (i.e. `st', `nd', `rd' or `th', as appropriate). | ||
| 1559 | 1556 | ||
| 1560 | %%(diary-remind SEXP DAYS &optional MARKING) text | 1557 | %%(diary-remind SEXP DAYS &optional MARKING) text |
| 1561 | Entry is a reminder for diary sexp SEXP. DAYS is either a | 1558 | Entry is a reminder for diary sexp SEXP. DAYS is either a |
| @@ -1574,8 +1571,7 @@ highlighting the day in the calendar. | |||
| 1574 | Text is assumed to be the name of the person; the date is the | 1571 | Text is assumed to be the name of the person; the date is the |
| 1575 | date of death on the *civil* calendar. The diary entry will | 1572 | date of death on the *civil* calendar. The diary entry will |
| 1576 | appear on the proper Hebrew-date anniversary and on the day | 1573 | appear on the proper Hebrew-date anniversary and on the day |
| 1577 | before. (If `european-calendar-style' is non-nil, the | 1574 | before. |
| 1578 | parameter order should be changed to DAY, MONTH, YEAR.) | ||
| 1579 | 1575 | ||
| 1580 | All the remaining functions do not accept any text, and so only | 1576 | All the remaining functions do not accept any text, and so only |
| 1581 | make sense with `fancy-diary-display'. Most produce output every day. | 1577 | make sense with `fancy-diary-display'. Most produce output every day. |
| @@ -1653,6 +1649,19 @@ best if they are non-marking." | |||
| 1653 | entry-found)) | 1649 | entry-found)) |
| 1654 | 1650 | ||
| 1655 | 1651 | ||
| 1652 | (defun diary-make-date (a b c) | ||
| 1653 | "Convert A B C into the internal calendar date form. | ||
| 1654 | The expected order of the inputs depends on `calendar-date-style', | ||
| 1655 | e.g. in the European case, A = day, B = month, C = year. Returns | ||
| 1656 | a list\(MONTH DAY YEAR), i.e. the American style, which is the | ||
| 1657 | form used internally by the calendar and diary." | ||
| 1658 | (cond ((eq calendar-date-style 'iso) ; YMD | ||
| 1659 | (list b c a)) | ||
| 1660 | ((eq calendar-date-style 'european) ; DMY | ||
| 1661 | (list b a c)) | ||
| 1662 | (t (list a b c)))) | ||
| 1663 | |||
| 1664 | |||
| 1656 | ;;; Sexp diary functions. | 1665 | ;;; Sexp diary functions. |
| 1657 | 1666 | ||
| 1658 | (defvar date) | 1667 | (defvar date) |
| @@ -1661,54 +1670,48 @@ best if they are non-marking." | |||
| 1661 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. | 1670 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
| 1662 | (defun diary-date (month day year &optional mark) | 1671 | (defun diary-date (month day year &optional mark) |
| 1663 | "Specific date(s) diary entry. | 1672 | "Specific date(s) diary entry. |
| 1664 | Entry applies if date is MONTH, DAY, YEAR if `european-calendar-style' is nil, | 1673 | Entry applies if date is MONTH, DAY, YEAR. Each parameter can be |
| 1665 | and DAY, MONTH, YEAR otherwise. DAY, MONTH, and YEAR can be lists of | 1674 | a list of integers, `t' (meaning all values), or an integer. The |
| 1666 | integers, `t' (meaning all values), or an integer. | 1675 | order of the input parameters changes according to `calendar-date-style' |
| 1676 | \(e.g. to DAY MONTH YEAR in the European style). | ||
| 1667 | 1677 | ||
| 1668 | An optional parameter MARK specifies a face or single-character string to | 1678 | An optional parameter MARK specifies a face or single-character string to |
| 1669 | use when highlighting the day in the calendar." | 1679 | use when highlighting the day in the calendar." |
| 1670 | (let ((dd (if european-calendar-style | 1680 | (let* ((ddate (diary-make-date month day year)) |
| 1671 | month | 1681 | (dd (extract-calendar-day ddate)) |
| 1672 | day)) | 1682 | (mm (extract-calendar-month ddate)) |
| 1673 | (mm (if european-calendar-style | 1683 | (yy (extract-calendar-year ddate)) |
| 1674 | day | 1684 | (m (extract-calendar-month date)) |
| 1675 | month)) | 1685 | (y (extract-calendar-year date)) |
| 1676 | (m (extract-calendar-month date)) | 1686 | (d (extract-calendar-day date))) |
| 1677 | (y (extract-calendar-year date)) | 1687 | (and |
| 1678 | (d (extract-calendar-day date))) | 1688 | (or (and (listp dd) (memq d dd)) |
| 1679 | (if (and | 1689 | (equal d dd) |
| 1680 | (or (and (listp dd) (memq d dd)) | 1690 | (eq dd t)) |
| 1681 | (equal d dd) | 1691 | (or (and (listp mm) (memq m mm)) |
| 1682 | (eq dd t)) | 1692 | (equal m mm) |
| 1683 | (or (and (listp mm) (memq m mm)) | 1693 | (eq mm t)) |
| 1684 | (equal m mm) | 1694 | (or (and (listp yy) (memq y yy)) |
| 1685 | (eq mm t)) | 1695 | (equal y yy) |
| 1686 | (or (and (listp year) (memq y year)) | 1696 | (eq yy t)) |
| 1687 | (equal y year) | 1697 | (cons mark entry)))) |
| 1688 | (eq year t))) | ||
| 1689 | (cons mark entry)))) | ||
| 1690 | 1698 | ||
| 1691 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. | 1699 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
| 1692 | (defun diary-block (m1 d1 y1 m2 d2 y2 &optional mark) | 1700 | (defun diary-block (m1 d1 y1 m2 d2 y2 &optional mark) |
| 1693 | "Block diary entry. | 1701 | "Block diary entry. |
| 1694 | Entry applies if date is between, or on one of, two dates. | 1702 | Entry applies if date is between, or on one of, two dates. The |
| 1695 | The order of the parameters is M1, D1, Y1, M2, D2, Y2 if | 1703 | order of the input parameters changes according to |
| 1696 | `european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 otherwise. | 1704 | `calendar-date-style' (e.g. to D1, M1, Y1, D2, M2, Y2 in the European style). |
| 1697 | 1705 | ||
| 1698 | An optional parameter MARK specifies a face or single-character string to | 1706 | An optional parameter MARK specifies a face or single-character string to |
| 1699 | use when highlighting the day in the calendar." | 1707 | use when highlighting the day in the calendar." |
| 1700 | |||
| 1701 | (let ((date1 (calendar-absolute-from-gregorian | 1708 | (let ((date1 (calendar-absolute-from-gregorian |
| 1702 | (if european-calendar-style | 1709 | (diary-make-date m1 d1 y1))) |
| 1703 | (list d1 m1 y1) | ||
| 1704 | (list m1 d1 y1)))) | ||
| 1705 | (date2 (calendar-absolute-from-gregorian | 1710 | (date2 (calendar-absolute-from-gregorian |
| 1706 | (if european-calendar-style | 1711 | (diary-make-date m2 d2 y2))) |
| 1707 | (list d2 m2 y2) | ||
| 1708 | (list m2 d2 y2)))) | ||
| 1709 | (d (calendar-absolute-from-gregorian date))) | 1712 | (d (calendar-absolute-from-gregorian date))) |
| 1710 | (if (and (<= date1 d) (<= d date2)) | 1713 | (and (<= date1 d) (<= d date2) |
| 1711 | (cons mark entry)))) | 1714 | (cons mark entry)))) |
| 1712 | 1715 | ||
| 1713 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. | 1716 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
| 1714 | (defun diary-float (month dayname n &optional day mark) | 1717 | (defun diary-float (month dayname n &optional day mark) |
| @@ -1786,53 +1789,48 @@ highlighting the day in the calendar." | |||
| 1786 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. | 1789 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
| 1787 | (defun diary-anniversary (month day &optional year mark) | 1790 | (defun diary-anniversary (month day &optional year mark) |
| 1788 | "Anniversary diary entry. | 1791 | "Anniversary diary entry. |
| 1789 | Entry applies if date is the anniversary of MONTH, DAY, YEAR if | 1792 | Entry applies if date is the anniversary of MONTH, DAY, YEAR. |
| 1790 | `european-calendar-style' is nil, and DAY, MONTH, YEAR otherwise. The | 1793 | The order of the input parameters changes according to |
| 1791 | diary entry can contain `%d' or `%d%s'; the %d will be replaced by the | 1794 | `calendar-date-style' (e.g. to DAY MONTH YEAR in the European style). |
| 1792 | number of years since the MONTH DAY, YEAR and the %s will be replaced by | 1795 | |
| 1793 | the ordinal ending of that number (that is, `st', `nd', `rd' or `th', as | 1796 | The diary entry can contain `%d' or `%d%s'; the %d will be |
| 1794 | appropriate. The anniversary of February 29 is considered to be March 1 | 1797 | replaced by the number of years since the MONTH, DAY, YEAR, and the |
| 1795 | in non-leap years. | 1798 | %s will be replaced by the ordinal ending of that number (that |
| 1796 | 1799 | is, `st', `nd', `rd' or `th', as appropriate. The anniversary of | |
| 1797 | An optional parameter MARK specifies a face or single-character string to | 1800 | February 29 is considered to be March 1 in non-leap years. |
| 1798 | use when highlighting the day in the calendar." | 1801 | |
| 1799 | (let* ((d (if european-calendar-style | 1802 | An optional parameter MARK specifies a face or single-character |
| 1800 | month | 1803 | string to use when highlighting the day in the calendar." |
| 1801 | day)) | 1804 | (let* ((ddate (diary-make-date month day year)) |
| 1802 | (m (if european-calendar-style | 1805 | (dd (extract-calendar-day ddate)) |
| 1803 | day | 1806 | (mm (extract-calendar-month ddate)) |
| 1804 | month)) | 1807 | (yy (extract-calendar-year ddate)) |
| 1805 | (y (extract-calendar-year date)) | 1808 | (y (extract-calendar-year date)) |
| 1806 | (diff (if year (- y year) 100))) | 1809 | (diff (if yy (- y yy) 100))) |
| 1807 | (if (and (= m 2) (= d 29) (not (calendar-leap-year-p y))) | 1810 | (and (= mm 2) (= dd 29) (not (calendar-leap-year-p y)) |
| 1808 | (setq m 3 | 1811 | (setq mm 3 |
| 1809 | d 1)) | 1812 | dd 1)) |
| 1810 | (if (and (> diff 0) (calendar-date-equal (list m d y) date)) | 1813 | (and (> diff 0) (calendar-date-equal (list mm dd y) date) |
| 1811 | (cons mark (format entry diff (diary-ordinal-suffix diff)))))) | 1814 | (cons mark (format entry diff (diary-ordinal-suffix diff)))))) |
| 1812 | 1815 | ||
| 1813 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. | 1816 | ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
| 1814 | (defun diary-cyclic (n month day year &optional mark) | 1817 | (defun diary-cyclic (n month day year &optional mark) |
| 1815 | "Cycle diary entry--entry applies every N days starting at MONTH, DAY, YEAR. | 1818 | "Cycle diary entry--entry applies every N days starting at MONTH, DAY, YEAR. |
| 1816 | If `european-calendar-style' is non-nil, parameters are N, DAY, MONTH, YEAR. | 1819 | The order of the input parameters changes according to |
| 1817 | ENTRY can contain `%d' or `%d%s'; the %d will be replaced by the number of | 1820 | `calendar-date-style' (e.g. to N DAY MONTH YEAR in the European |
| 1818 | repetitions since the MONTH DAY, YEAR and %s will be replaced by the | 1821 | style). ENTRY can contain `%d' or `%d%s'; the %d will be |
| 1819 | ordinal ending of that number (that is, `st', `nd', `rd' or `th', as | 1822 | replaced by the number of repetitions since the MONTH DAY YEAR, |
| 1820 | appropriate. | 1823 | and %s by the ordinal ending of that number (that is, `st', `nd', |
| 1821 | 1824 | `rd' or `th', as appropriate. | |
| 1822 | An optional parameter MARK specifies a face or single-character string to | 1825 | |
| 1823 | use when highlighting the day in the calendar." | 1826 | An optional parameter MARK specifies a face or single-character |
| 1824 | (let* ((d (if european-calendar-style | 1827 | string to use when highlighting the day in the calendar." |
| 1825 | month | 1828 | (let* ((diff (- (calendar-absolute-from-gregorian date) |
| 1826 | day)) | ||
| 1827 | (m (if european-calendar-style | ||
| 1828 | day | ||
| 1829 | month)) | ||
| 1830 | (diff (- (calendar-absolute-from-gregorian date) | ||
| 1831 | (calendar-absolute-from-gregorian | 1829 | (calendar-absolute-from-gregorian |
| 1832 | (list m d year)))) | 1830 | (diary-make-date month day year)))) |
| 1833 | (cycle (/ diff n))) | 1831 | (cycle (/ diff n))) |
| 1834 | (if (and (>= diff 0) (zerop (% diff n))) | 1832 | (and (>= diff 0) (zerop (% diff n)) |
| 1835 | (cons mark (format entry cycle (diary-ordinal-suffix cycle)))))) | 1833 | (cons mark (format entry cycle (diary-ordinal-suffix cycle)))))) |
| 1836 | 1834 | ||
| 1837 | (defun diary-day-of-year () | 1835 | (defun diary-day-of-year () |
| 1838 | "Day of year and number of days remaining in the year of date diary entry." | 1836 | "Day of year and number of days remaining in the year of date diary entry." |
| @@ -1918,39 +1916,73 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 1918 | (make-diary-entry (calendar-day-name (calendar-cursor-to-date t)) | 1916 | (make-diary-entry (calendar-day-name (calendar-cursor-to-date t)) |
| 1919 | arg)) | 1917 | arg)) |
| 1920 | 1918 | ||
| 1919 | (defun diary-date-display-form (&optional type) | ||
| 1920 | "Return value for `calendar-date-display-form' using `calendar-date-style.' | ||
| 1921 | Optional symbol TYPE is either `monthly' or `yearly'." | ||
| 1922 | (cond ((eq type 'monthly) (cond ((eq calendar-date-style 'iso) | ||
| 1923 | '((format "*-*-%.2d" | ||
| 1924 | (string-to-number day)))) | ||
| 1925 | ((eq calendar-date-style 'european) | ||
| 1926 | '(day " * ")) | ||
| 1927 | (t '("* " day )))) | ||
| 1928 | ((eq type 'yearly) (cond ((eq calendar-date-style 'iso) | ||
| 1929 | '((format "*-%.2d-%.2d" | ||
| 1930 | (string-to-number month) | ||
| 1931 | (string-to-number day)))) | ||
| 1932 | ((eq calendar-date-style 'european) | ||
| 1933 | '(day " " monthname)) | ||
| 1934 | (t '(monthname " " day)))) | ||
| 1935 | ;; Iso cannot contain "-", because this form used eg by | ||
| 1936 | ;; insert-anniversary-diary-entry. | ||
| 1937 | (t (cond ((eq calendar-date-style 'iso) | ||
| 1938 | '((format "%s %.2d %.2d" year | ||
| 1939 | (string-to-number month) (string-to-number day)))) | ||
| 1940 | ((eq calendar-date-style 'european) | ||
| 1941 | '(day " " month " " year)) | ||
| 1942 | (t '(month " " day " " year)))))) | ||
| 1943 | |||
| 1944 | (defun diary-insert-entry-1 (&optional type nomark months symbol absfunc) | ||
| 1945 | "Subroutine to insert a diary entry related to the date at point. | ||
| 1946 | TYPE is the type of entry (`monthly' or `yearly'). NOMARK | ||
| 1947 | non-nil means make the entry non-marking. Array MONTHS is used | ||
| 1948 | in place of `calendar-month-name-array'. String SYMBOL marks the | ||
| 1949 | type of diary entry. Function ABSFUNC converts absolute dates to | ||
| 1950 | dates of the appropriate type." | ||
| 1951 | (let ((calendar-date-display-form (if type | ||
| 1952 | (diary-date-display-form type) | ||
| 1953 | calendar-date-display-form)) | ||
| 1954 | (calendar-month-name-array (or months calendar-month-name-array)) | ||
| 1955 | (date (calendar-cursor-to-date t))) | ||
| 1956 | (make-diary-entry | ||
| 1957 | (format "%s%s" (or symbol "") | ||
| 1958 | (calendar-date-string | ||
| 1959 | (if absfunc | ||
| 1960 | (funcall absfunc (calendar-absolute-from-gregorian date)) | ||
| 1961 | date) | ||
| 1962 | (not absfunc) | ||
| 1963 | (not type))) | ||
| 1964 | nomark))) | ||
| 1965 | |||
| 1921 | ;;;###cal-autoload | 1966 | ;;;###cal-autoload |
| 1922 | (defun insert-monthly-diary-entry (arg) | 1967 | (defun insert-monthly-diary-entry (arg) |
| 1923 | "Insert a monthly diary entry for the day of the month indicated by point. | 1968 | "Insert a monthly diary entry for the day of the month indicated by point. |
| 1924 | Prefix argument ARG makes the entry nonmarking." | 1969 | Prefix argument ARG makes the entry nonmarking." |
| 1925 | (interactive "P") | 1970 | (interactive "P") |
| 1926 | (let ((calendar-date-display-form | 1971 | (diary-insert-entry-1 'monthly arg)) |
| 1927 | (if european-calendar-style | ||
| 1928 | '(day " * ") | ||
| 1929 | '("* " day)))) | ||
| 1930 | (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t) | ||
| 1931 | arg))) | ||
| 1932 | 1972 | ||
| 1933 | ;;;###cal-autoload | 1973 | ;;;###cal-autoload |
| 1934 | (defun insert-yearly-diary-entry (arg) | 1974 | (defun insert-yearly-diary-entry (arg) |
| 1935 | "Insert an annual diary entry for the day of the year indicated by point. | 1975 | "Insert an annual diary entry for the day of the year indicated by point. |
| 1936 | Prefix argument ARG makes the entry nonmarking." | 1976 | Prefix argument ARG makes the entry nonmarking." |
| 1937 | (interactive "P") | 1977 | (interactive "P") |
| 1938 | (let ((calendar-date-display-form | 1978 | (diary-insert-entry-1 'yearly arg)) |
| 1939 | (if european-calendar-style | ||
| 1940 | '(day " " monthname) | ||
| 1941 | '(monthname " " day)))) | ||
| 1942 | (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t) | ||
| 1943 | arg))) | ||
| 1944 | 1979 | ||
| 1945 | ;;;###cal-autoload | 1980 | ;;;###cal-autoload |
| 1946 | (defun insert-anniversary-diary-entry (arg) | 1981 | (defun insert-anniversary-diary-entry (arg) |
| 1947 | "Insert an anniversary diary entry for the date given by point. | 1982 | "Insert an anniversary diary entry for the date given by point. |
| 1948 | Prefix argument ARG makes the entry nonmarking." | 1983 | Prefix argument ARG makes the entry nonmarking." |
| 1949 | (interactive "P") | 1984 | (interactive "P") |
| 1950 | (let ((calendar-date-display-form | 1985 | (let ((calendar-date-display-form (diary-date-display-form))) |
| 1951 | (if european-calendar-style | ||
| 1952 | '(day " " month " " year) | ||
| 1953 | '(month " " day " " year)))) | ||
| 1954 | (make-diary-entry | 1986 | (make-diary-entry |
| 1955 | (format "%s(diary-anniversary %s)" | 1987 | (format "%s(diary-anniversary %s)" |
| 1956 | sexp-diary-entry-symbol | 1988 | sexp-diary-entry-symbol |
| @@ -1962,10 +1994,7 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 1962 | "Insert a block diary entry for the days between the point and marked date. | 1994 | "Insert a block diary entry for the days between the point and marked date. |
| 1963 | Prefix argument ARG makes the entry nonmarking." | 1995 | Prefix argument ARG makes the entry nonmarking." |
| 1964 | (interactive "P") | 1996 | (interactive "P") |
| 1965 | (let ((calendar-date-display-form | 1997 | (let ((calendar-date-display-form (diary-date-display-form)) |
| 1966 | (if european-calendar-style | ||
| 1967 | '(day " " month " " year) | ||
| 1968 | '(month " " day " " year))) | ||
| 1969 | (cursor (calendar-cursor-to-date t)) | 1998 | (cursor (calendar-cursor-to-date t)) |
| 1970 | (mark (or (car calendar-mark-ring) | 1999 | (mark (or (car calendar-mark-ring) |
| 1971 | (error "No mark set in this buffer"))) | 2000 | (error "No mark set in this buffer"))) |
| @@ -1988,10 +2017,7 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 1988 | "Insert a cyclic diary entry starting at the date given by point. | 2017 | "Insert a cyclic diary entry starting at the date given by point. |
| 1989 | Prefix argument ARG makes the entry nonmarking." | 2018 | Prefix argument ARG makes the entry nonmarking." |
| 1990 | (interactive "P") | 2019 | (interactive "P") |
| 1991 | (let ((calendar-date-display-form | 2020 | (let ((calendar-date-display-form (diary-date-display-form))) |
| 1992 | (if european-calendar-style | ||
| 1993 | '(day " " month " " year) | ||
| 1994 | '(month " " day " " year)))) | ||
| 1995 | (make-diary-entry | 2021 | (make-diary-entry |
| 1996 | (format "%s(diary-cyclic %d %s)" | 2022 | (format "%s(diary-cyclic %d %s)" |
| 1997 | sexp-diary-entry-symbol | 2023 | sexp-diary-entry-symbol |