X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/2d3c9015c70fd05ac1bec42cc59d57c3fb6b82b5..c1b8b17a7ac22123fe8d2d647265f19d2cc92625:/lisp/calendar/diary-lib.el?ds=sidebyside diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index a4e36d9abe..29364b55b6 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1,6 +1,6 @@ ;;; diary-lib.el --- diary functions -;; Copyright (C) 1989-1990, 1992-1995, 2001-2014 Free Software +;; Copyright (C) 1989-1990, 1992-1995, 2001-2015 Free Software ;; Foundation, Inc. ;; Author: Edward M. Reingold @@ -49,13 +49,6 @@ are holidays." :type 'boolean :group 'diary) -(defcustom diary-face 'diary - "Face name to use for diary entries." - :type 'face - :group 'calendar-faces) -(make-obsolete-variable 'diary-face "customize the face `diary' instead." - "23.1") - (defface diary-anniversary '((t :inherit font-lock-keyword-face)) "Face used for anniversaries in the fancy diary display." :version "22.1" @@ -72,8 +65,6 @@ are holidays." :version "22.1" :group 'calendar-faces) -(define-obsolete-face-alias 'diary-button-face 'diary-button "22.1") - ;; Face markup of calendar and diary displays: Any entry line that ;; ends with [foo:value] where foo is a face attribute (except :box ;; :stipple) or with [face:blah] tags, will have these values applied @@ -133,9 +124,6 @@ are: `string', `symbol', `int', `tnil', `stringtnil.'" :type 'function :group 'diary) -(define-obsolete-variable-alias 'sexp-diary-entry-symbol - 'diary-sexp-entry-symbol "23.1") - (defcustom diary-sexp-entry-symbol "%%" "The string used to indicate a sexp diary entry in `diary-file'. See the documentation for the function `diary-list-sexp-entries'." @@ -168,18 +156,10 @@ Used for example by the appointment package - see `appt-activate'." :type 'hook :group 'diary) -(define-obsolete-variable-alias 'diary-display-hook 'diary-display-function - "23.1") - (defcustom diary-display-function 'diary-fancy-display "Function used to display the diary. The two standard options are `diary-fancy-display' and `diary-simple-display'. -For historical reasons, `nil' is the same as `diary-simple-display' -\(so you must use `ignore' for no display). Also for historical -reasons, this variable can be a list of functions to run. These -uses are not recommended and may be removed at some point. - When this function is called, the variable `diary-entries-list' is a list, in order by date, of all relevant diary entries in the form of ((MONTH DAY YEAR) STRING), where string is the diary @@ -188,17 +168,13 @@ produce a different buffer for display (perhaps combined with holidays), or hard copy output." :type '(choice (const diary-fancy-display :tag "Fancy display") (const diary-simple-display :tag "Basic display") - (const ignore :tag "No display") - (const nil :tag "Obsolete way to choose basic display") - (hook :tag "Obsolete form with list of display functions")) + (const :tag "No display" ignore) + (function :tag "User-specified function")) :initialize 'custom-initialize-default :set 'diary-set-maybe-redraw :version "23.2" ; simple->fancy :group 'diary) -(define-obsolete-variable-alias 'list-diary-entries-hook - 'diary-list-entries-hook "23.1") - (defcustom diary-list-entries-hook nil "Hook run after diary file is culled for relevant entries. @@ -227,9 +203,6 @@ the main file and all included files, you would use the nongregorian hook." :options '(diary-include-other-diary-files diary-sort-entries) :group 'diary) -(define-obsolete-variable-alias 'mark-diary-entries-hook - 'diary-mark-entries-hook "23.1") - (defcustom diary-mark-entries-hook nil "List of functions called after marking diary entries in the calendar. You might wish to add `diary-mark-included-diary-files', in which case @@ -244,9 +217,6 @@ differ only if you are using included diary files. In that case, :options '(diary-mark-included-diary-files) :group 'diary) -(define-obsolete-variable-alias 'nongregorian-diary-listing-hook - 'diary-nongregorian-listing-hook "23.1") - (defcustom diary-nongregorian-listing-hook nil "List of functions called for listing diary file and included files. As the files are processed for diary entries, these functions are used @@ -264,9 +234,6 @@ use `diary-list-entries-hook', which runs only for the main diary file." diary-islamic-list-entries) :group 'diary) -(define-obsolete-variable-alias 'nongregorian-diary-marking-hook - 'diary-nongregorian-marking-hook "23.1") - (defcustom diary-nongregorian-marking-hook nil "List of functions called for marking diary file and included files. As the files are processed for diary entries, these functions are used @@ -284,9 +251,6 @@ use `diary-mark-entries-hook', which runs only for the main diary file." diary-islamic-mark-entries) :group 'diary) -(define-obsolete-variable-alias 'print-diary-entries-hook - 'diary-print-entries-hook "23.1") - (defcustom diary-print-entries-hook 'lpr-buffer "Run by `diary-print-entries' after preparing a temporary diary buffer. The buffer shows only the diary entries currently visible in the @@ -334,9 +298,6 @@ expressions that can involve the keywords `days' (a number), `date' :type 'sexp :group 'diary) -(define-obsolete-variable-alias 'abbreviated-calendar-year - 'diary-abbreviated-year-flag "23.1") - (defcustom diary-abbreviated-year-flag t "Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. This applies to the Gregorian, Hebrew, Islamic, and Bahá'í calendars. @@ -468,7 +429,8 @@ Only used if `diary-header-line-flag' is non-nil." ;; just visiting the diary-file. This is i) unlikely, and ii) no great loss. ;;;###cal-autoload (defun diary-live-p () - "Return non-nil if the diary is being displayed." + "Return non-nil if the diary is being displayed. +The actual return value is a diary buffer." (or (get-buffer diary-fancy-buffer) (and diary-file (find-buffer-visiting diary-file)))) @@ -484,9 +446,6 @@ just visiting the `diary-file'), and SYMBOL's value is to be changed." ;; Note this assumes diary was called without prefix arg. (diary)))) -(define-obsolete-variable-alias 'number-of-diary-entries - 'diary-number-of-entries "23.1") - (defcustom diary-number-of-entries 1 "Specifies how many days of diary entries are to be displayed initially. This variable affects the diary display when the command \\[diary] is @@ -562,10 +521,6 @@ DFILE specifies the file to use as the diary file." (let ((diary-file dfile)) (diary-view-entries arg))) -;;;###cal-autoload -(define-obsolete-function-alias 'view-other-diary-entries - 'diary-view-other-diary-entries "23.1") - (defvar diary-syntax-table (let ((st (copy-syntax-table (standard-syntax-table)))) (modify-syntax-entry ?* "w" st) @@ -684,8 +639,6 @@ Also removes the region between `diary-comment-start' and (list marker dfile literal) globcolor))))))) -(define-obsolete-function-alias 'add-to-diary-list 'diary-add-to-list "23.1") - (defun diary-list-entries-2 (date mark globattr list-only &optional months symbol gdate) "Internal subroutine of `diary-list-entries'. @@ -901,12 +854,15 @@ LIST-ONLY is non-nil, in which case it just returns the list." ;;; (diary-include-other-diary-files) ; recurse ;;; (run-hooks 'diary-list-entries-hook)) (unless list-only - (if (and diary-display-function - (listp diary-display-function)) - ;; Backwards compatibility. - (run-hooks 'diary-display-function) - (funcall (or diary-display-function - 'diary-simple-display)))) + ;; Avoid M-x diary; M-x calendar; M-x diary + ;; clobbering the calendar window. + ;; FIXME this is not the right solution. + (let ((display-buffer-fallback-action + (list (delq + 'display-buffer-in-previous-window + (copy-sequence + (car display-buffer-fallback-action)))))) + (funcall diary-display-function))) (run-hooks 'diary-hook))))) (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff))) (or d-incp (message "Preparing diary...done")) @@ -967,9 +923,6 @@ For details, see `diary-include-files'. See also `diary-mark-included-diary-files'." (diary-include-files)) -(define-obsolete-function-alias 'include-other-diary-files - 'diary-include-other-diary-files "23.1") - (defvar date-string) ; bound in diary-list-entries (defun diary-display-no-entries () @@ -1028,9 +981,6 @@ in the mode line. This is an option for `diary-display-function'." (set-window-point window diary-saved-point) (set-window-start window (point-min))))))) -(define-obsolete-function-alias 'simple-diary-display - 'diary-simple-display "23.1") - (defvar diary-goto-entry-function 'diary-goto-entry "Function called to jump to a diary entry. Modes that require special handling of the included file @@ -1157,9 +1107,6 @@ This is an option for `diary-display-function'." (diary-fancy-display-mode)) (calendar-set-mode-line date-string)))) -(define-obsolete-function-alias 'fancy-diary-display - 'diary-fancy-display "23.1") - ;; FIXME modernize? (defun diary-print-entries () "Print a hard copy of the diary display. @@ -1204,9 +1151,6 @@ the actual printing." (run-hooks 'diary-print-entries-hook) (kill-buffer temp-buffer)))) -(define-obsolete-function-alias 'print-diary-entries - 'diary-print-entries "23.1") - ;;;###cal-autoload (defun diary-show-all-entries () "Show all of the diary entries in the diary file. @@ -1454,9 +1398,6 @@ marks. This is intended to deal with deleted diary entries." (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff))) (or d-incp (message "Marking diary entries...done")))) -;;;###cal-autoload -(define-obsolete-function-alias 'mark-diary-entries 'diary-mark-entries "23.1") - (defun diary-sexp-entry (sexp entry date) "Process a SEXP diary ENTRY for DATE." (let ((result (if calendar-debug-sexp @@ -1534,9 +1475,6 @@ is marked. See the documentation for the function `diary-list-sexp-entries'." (or (cadr (diary-pull-attrs entry file-glob-attrs)) (if (consp mark) (car mark))))))))) -(define-obsolete-function-alias 'mark-sexp-diary-entries - 'diary-mark-sexp-entries "23.1") - (defun diary-mark-included-diary-files () "Mark diary entries from included diary files. To use, add this function to `diary-mark-entries-hook'. @@ -1544,9 +1482,6 @@ For details, see `diary-include-files'. See also `diary-include-other-diary-files'." (diary-include-files t)) -(define-obsolete-function-alias 'mark-included-diary-files - 'diary-mark-included-diary-files "23.1") - (defun calendar-mark-days-named (dayname &optional color) "Mark all dates in the calendar window that are day DAYNAME of the week. 0 means all Sundays, 1 means all Mondays, and so on. @@ -1569,9 +1504,6 @@ Optional argument COLOR is passed to `calendar-mark-visible-date' as MARK." color) (setq day (+ day 7)))))) -(define-obsolete-function-alias 'mark-calendar-days-named - 'calendar-mark-days-named "23.1") - (defun calendar-mark-month (month year p-month p-day p-year &optional color) "Mark dates in the MONTH/YEAR that conform to pattern P-MONTH/P-DAY/P-YEAR. A value of 0 in any position of the pattern is a wildcard. @@ -1585,9 +1517,6 @@ Optional argument COLOR is passed to `calendar-mark-visible-date' as MARK." (calendar-mark-visible-date (list month (1+ i) year) color)) (calendar-mark-visible-date (list month p-day year) color)))) -(define-obsolete-function-alias 'mark-calendar-month - 'calendar-mark-month "23.1") - (defun calendar-mark-date-pattern (month day year &optional color) "Mark all dates in the calendar window that conform to MONTH/DAY/YEAR. A value of 0 in any position is a wildcard. Optional argument COLOR is @@ -1600,9 +1529,6 @@ passed to `calendar-mark-visible-date' as MARK." (calendar-mark-month m y month day year color) (calendar-increment-month m y 1))))) -(define-obsolete-function-alias 'mark-calendar-date-pattern - 'calendar-mark-date-pattern "23.1") - ;; Bahai, Hebrew, Islamic. (defun calendar-mark-complex (month day year fromabs &optional color) "Mark dates in the calendar conforming to MONTH DAY YEAR of some system. @@ -1661,8 +1587,7 @@ COLOR is passed to `calendar-mark-visible-date' as MARK." (setq date (calendar-gregorian-from-absolute (funcall toabs (list month day y))))) (calendar-mark-visible-date date color))))) - (calendar-mark-complex month day year - 'calendar-bahai-from-absolute color)))) + (calendar-mark-complex month day year fromabs color)))) (defun diary-entry-time (s) @@ -1709,8 +1634,6 @@ 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))) -(define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1") - (defun diary-list-sexp-entries (date) "Add sexp entries for DATE from the diary file to `diary-entries-list'. @@ -1869,9 +1792,6 @@ best if they are non-marking." (setq entry-found (or entry-found diary-entry))) entry-found)) -(define-obsolete-function-alias 'list-sexp-diary-entries - 'diary-list-sexp-entries "23.1") - (defun diary-make-date (a b c) "Convert A B C into the internal calendar date form. The expected order of the inputs depends on `calendar-date-style', @@ -2132,9 +2052,6 @@ If omitted, NONMARKING defaults to nil and FILE defaults to (if nonmarking diary-nonmarking-symbol "") string " ")) -;;;###cal-autoload -(define-obsolete-function-alias 'make-diary-entry 'diary-make-entry "23.1") - ;;;###cal-autoload (defun diary-insert-entry (arg &optional event) "Insert a diary entry for the date indicated by point. @@ -2144,9 +2061,6 @@ Prefix argument ARG makes the entry nonmarking." (diary-make-entry (calendar-date-string (calendar-cursor-to-date t event) t t) arg)) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-diary-entry 'diary-insert-entry "23.1") - ;;;###cal-autoload (defun diary-insert-weekly-entry (arg) "Insert a weekly diary entry for the day of the week indicated by point. @@ -2155,10 +2069,6 @@ Prefix argument ARG makes the entry nonmarking." (diary-make-entry (calendar-day-name (calendar-cursor-to-date t)) arg)) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-weekly-diary-entry - 'diary-insert-weekly-entry "23.1") - (defun diary-date-display-form (&optional type) "Return value for `calendar-date-display-form' using `calendar-date-style'. Optional symbol TYPE is either `monthly' or `yearly'." @@ -2213,10 +2123,6 @@ Prefix argument ARG makes the entry nonmarking." (interactive "P") (diary-insert-entry-1 'monthly arg)) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-monthly-diary-entry - 'diary-insert-monthly-entry "23.1") - ;;;###cal-autoload (defun diary-insert-yearly-entry (arg) "Insert an annual diary entry for the day of the year indicated by point. @@ -2224,10 +2130,6 @@ Prefix argument ARG makes the entry nonmarking." (interactive "P") (diary-insert-entry-1 'yearly arg)) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-yearly-diary-entry - 'diary-insert-yearly-entry "23.1") - ;;;###cal-autoload (defun diary-insert-anniversary-entry (arg) "Insert an anniversary diary entry for the date given by point. @@ -2240,10 +2142,6 @@ Prefix argument ARG makes the entry nonmarking." (calendar-date-string (calendar-cursor-to-date t) nil t)) arg))) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-anniversary-diary-entry - 'diary-insert-anniversary-entry "23.1") - ;;;###cal-autoload (defun diary-insert-block-entry (arg) "Insert a block diary entry for the days between the point and marked date. @@ -2267,10 +2165,6 @@ Prefix argument ARG makes the entry nonmarking." (calendar-date-string end nil t)) arg))) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-block-diary-entry - 'diary-insert-block-entry "23.1") - ;;;###cal-autoload (defun diary-insert-cyclic-entry (arg) "Insert a cyclic diary entry starting at the date given by point. @@ -2285,10 +2179,6 @@ Prefix argument ARG makes the entry nonmarking." (calendar-date-string (calendar-cursor-to-date t) nil t)) arg))) -;;;###cal-autoload -(define-obsolete-function-alias 'insert-cyclic-diary-entry - 'diary-insert-cyclic-entry "23.1") - ;;; Diary mode. (defun diary-redraw-calendar () @@ -2349,7 +2239,7 @@ full month names." (if (equal (car x) 'backup) (concat "\\)" (eval (car (reverse x)))) "\\)")) - '(1 diary-face))) + '(1 'diary))) diary-date-forms))) (defmacro diary-font-lock-keywords-1 (markfunc listfunc feature months symbol) @@ -2486,11 +2376,8 @@ This depends on the calendar date style." (put-text-property (match-beginning 0) (match-end 0) 'font-lock-multiline t) t)) -(define-obsolete-variable-alias 'fancy-diary-font-lock-keywords - 'diary-fancy-font-lock-keywords "23.1") - (defvar diary-fancy-font-lock-keywords - `((diary-fancy-date-matcher . diary-face) + `((diary-fancy-date-matcher . 'diary) ("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) ("^.*Yahrzeit.*$" . font-lock-constant-face) ("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) @@ -2537,9 +2424,6 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil." (list (cons t diary-fancy-overriding-map))) (view-mode 1)) -(define-obsolete-function-alias 'fancy-diary-display-mode - 'diary-fancy-display-mode "23.1") - ;; Following code from Dave Love . ;; Import Outlook-format appointments from mail messages in Gnus or ;; Rmail using command `diary-from-outlook'. This, or the specialized