Commit 4f44bf18 authored by Glenn Morris's avatar Glenn Morris
Browse files

(simple-diary-display, diary-show-all-entries, make-diary-entry):

Respect non-nil values of pop-up-frames (sync from trunk 2008-03-28).
(list-sexp-diary-entries, diary-float): Doc fixes (sync from trunk 2008-04-29).
parent 59c4743d
...@@ -607,7 +607,8 @@ changing the variable `diary-include-string'." ...@@ -607,7 +607,8 @@ changing the variable `diary-include-string'."
(msg (format "No diary entries for %s" hol-string)) (msg (format "No diary entries for %s" hol-string))
;; If selected window is dedicated (to the calendar), ;; If selected window is dedicated (to the calendar),
;; need a new one to display the diary. ;; need a new one to display the diary.
(pop-up-frames (window-dedicated-p (selected-window)))) (pop-up-frames (or pop-up-frames
(window-dedicated-p (selected-window)))))
(calendar-set-mode-line (format "Diary for %s" hol-string)) (calendar-set-mode-line (format "Diary for %s" hol-string))
(if (or (not diary-entries-list) (if (or (not diary-entries-list)
(and (not (cdr diary-entries-list)) (and (not (cdr diary-entries-list))
...@@ -864,7 +865,8 @@ all entries, not just some, are visible. If there is no diary buffer, one ...@@ -864,7 +865,8 @@ all entries, not just some, are visible. If there is no diary buffer, one
is created." is created."
(interactive) (interactive)
(let ((d-file (diary-check-diary-file)) (let ((d-file (diary-check-diary-file))
(pop-up-frames (window-dedicated-p (selected-window)))) (pop-up-frames (or pop-up-frames
(window-dedicated-p (selected-window)))))
(with-current-buffer (or (find-buffer-visiting d-file) (with-current-buffer (or (find-buffer-visiting d-file)
(find-file-noselect d-file t)) (find-file-noselect d-file t))
(when (eq major-mode default-major-mode) (diary-mode)) (when (eq major-mode default-major-mode) (diary-mode))
...@@ -1297,7 +1299,7 @@ A number of built-in functions are available for this type of diary entry: ...@@ -1297,7 +1299,7 @@ A number of built-in functions are available for this type of diary entry:
when highlighting the day in the calendar. when highlighting the day in the calendar.
%%(diary-float MONTH DAYNAME N &optional DAY MARK) text %%(diary-float MONTH DAYNAME N &optional DAY MARK) text
Entry will appear on the Nth DAYNAME of MONTH. Entry will appear on the Nth DAYNAME after/before MONTH DAY.
(DAYNAME=0 means Sunday, 1 means Monday, and so on; (DAYNAME=0 means Sunday, 1 means Monday, and so on;
if N is negative it counts backward from the end of if N is negative it counts backward from the end of
the month. MONTH can be a list of months, a single the month. MONTH can be a list of months, a single
...@@ -1554,12 +1556,12 @@ use when highlighting the day in the calendar." ...@@ -1554,12 +1556,12 @@ use when highlighting the day in the calendar."
(cons mark entry)))) (cons mark entry))))
(defun diary-float (month dayname n &optional day mark) (defun diary-float (month dayname n &optional day mark)
"Floating diary entry--entry applies if date is the nth dayname of month. "Diary entry for the Nth DAYNAME after/before MONTH DAY.
Parameters are MONTH, DAYNAME, N. MONTH can be a list of months, the constant DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on.
t, or an integer. The constant t means all months. If N is negative, count If N>0, use the Nth DAYNAME after MONTH DAY.
backward from the end of the month. If N<0, use the Nth DAYNAME before MONTH DAY.
DAY defaults to 1 if N>0, and MONTH's last day otherwise.
An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY. MONTH can be a list of months, an integer, or `t' (meaning all months).
Optional MARK specifies a face or single-character string to use when Optional MARK specifies a face or single-character string to use when
highlighting the day in the calendar." highlighting the day in the calendar."
;; This is messy because the diary entry may apply, but the date on which it ;; This is messy because the diary entry may apply, but the date on which it
...@@ -1743,7 +1745,8 @@ marked on the calendar." ...@@ -1743,7 +1745,8 @@ marked on the calendar."
"Insert a diary entry STRING which may be NONMARKING in FILE. "Insert a diary entry STRING which may be NONMARKING in FILE.
If omitted, NONMARKING defaults to nil and FILE defaults to If omitted, NONMARKING defaults to nil and FILE defaults to
`diary-file'." `diary-file'."
(let ((pop-up-frames (window-dedicated-p (selected-window)))) (let ((pop-up-frames (or pop-up-frames
(window-dedicated-p (selected-window)))))
(find-file-other-window (substitute-in-file-name (or file diary-file)))) (find-file-other-window (substitute-in-file-name (or file diary-file))))
(when (eq major-mode default-major-mode) (diary-mode)) (when (eq major-mode default-major-mode) (diary-mode))
(widen) (widen)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment