;;; diary-lib.el --- diary functions
-;; Copyright (C) 1989-1990, 1992-1995, 2001-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1989-1990, 1992-1995, 2001-2015 Free Software
+;; Foundation, Inc.
;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
: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"
: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
: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'."
: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
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.
: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
: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
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
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
: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.
;; 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
(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)
(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'.
'display-buffer-in-previous-window
(copy-sequence
(car display-buffer-fallback-action))))))
- (if (and diary-display-function
- (listp diary-display-function))
- ;; Backwards compatibility.
- (run-hooks 'diary-display-function)
- (funcall (or diary-display-function
- 'diary-simple-display)))))
+ (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"))
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 ()
(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
(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.
(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.
(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
(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'.
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.
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.
(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
(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.
(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)
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'.
(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',
(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.
(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.
(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'."
(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.
(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.
(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.
(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.
(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 ()
(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)
(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)
(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 <fx@gnu.org>.
;; Import Outlook-format appointments from mail messages in Gnus or
;; Rmail using command `diary-from-outlook'. This, or the specialized