diff options
| author | Glenn Morris | 2003-08-24 15:20:38 +0000 |
|---|---|---|
| committer | Glenn Morris | 2003-08-24 15:20:38 +0000 |
| commit | 8ec6d48ac269fd6715585c948e96f3da96da5bb4 (patch) | |
| tree | 26621986fa3c53687b37d1c85e41f529b1a371f6 | |
| parent | 783bf2100183083fbce45f639e612a6afb88362c (diff) | |
| download | emacs-8ec6d48ac269fd6715585c948e96f3da96da5bb4.tar.gz emacs-8ec6d48ac269fd6715585c948e96f3da96da5bb4.zip | |
(simple-diary-display, make-diary-entry): Allow the diary to pop up a
new frame, if needed.
| -rw-r--r-- | lisp/calendar/diary-lib.el | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 3e516aed3b9..3ed8e913796 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -409,7 +409,6 @@ These hooks have the following distinct roles: | |||
| 409 | 'list-diary-entries-hook) | 409 | 'list-diary-entries-hook) |
| 410 | (if diary-display-hook | 410 | (if diary-display-hook |
| 411 | (run-hooks 'diary-display-hook) | 411 | (run-hooks 'diary-display-hook) |
| 412 | ;; FIXME Error if calendar-setup 'calendar-only -- gm. | ||
| 413 | (simple-diary-display)) | 412 | (simple-diary-display)) |
| 414 | (run-hooks 'diary-hook) | 413 | (run-hooks 'diary-hook) |
| 415 | diary-entries-list)))) | 414 | diary-entries-list)))) |
| @@ -466,17 +465,19 @@ changing the variable `diary-include-string'." | |||
| 466 | "Display the diary buffer if there are any relevant entries or holidays." | 465 | "Display the diary buffer if there are any relevant entries or holidays." |
| 467 | (let* ((holiday-list (if holidays-in-diary-buffer | 466 | (let* ((holiday-list (if holidays-in-diary-buffer |
| 468 | (check-calendar-holidays original-date))) | 467 | (check-calendar-holidays original-date))) |
| 469 | (msg (format "No diary entries for %s %s" | 468 | (hol-string (format "%s%s%s" |
| 470 | (concat date-string (if holiday-list ":" "")) | 469 | date-string |
| 471 | (mapconcat 'identity holiday-list "; ")))) | 470 | (if holiday-list ": " "") |
| 472 | (calendar-set-mode-line | 471 | (mapconcat 'identity holiday-list "; "))) |
| 473 | (concat "Diary for " date-string | 472 | (msg (format "No diary entries for %s" hol-string)) |
| 474 | (if holiday-list ": " "") | 473 | ;; If selected window is dedicated (to the calendar), |
| 475 | (mapconcat 'identity holiday-list "; "))) | 474 | ;; need a new one to display the diary. |
| 475 | (pop-up-frames (window-dedicated-p (selected-window)))) | ||
| 476 | (calendar-set-mode-line (format "Diary for %s" hol-string)) | ||
| 476 | (if (or (not diary-entries-list) | 477 | (if (or (not diary-entries-list) |
| 477 | (and (not (cdr diary-entries-list)) | 478 | (and (not (cdr diary-entries-list)) |
| 478 | (string-equal (car (cdr (car diary-entries-list))) ""))) | 479 | (string-equal (car (cdr (car diary-entries-list))) ""))) |
| 479 | (if (<= (length msg) (frame-width)) | 480 | (if (< (length msg) (frame-width)) |
| 480 | (message "%s" msg) | 481 | (message "%s" msg) |
| 481 | (set-buffer (get-buffer-create holiday-buffer)) | 482 | (set-buffer (get-buffer-create holiday-buffer)) |
| 482 | (setq buffer-read-only nil) | 483 | (setq buffer-read-only nil) |
| @@ -1589,7 +1590,8 @@ Do nothing if DATE or STRING is nil." | |||
| 1589 | (defun make-diary-entry (string &optional nonmarking file) | 1590 | (defun make-diary-entry (string &optional nonmarking file) |
| 1590 | "Insert a diary entry STRING which may be NONMARKING in FILE. | 1591 | "Insert a diary entry STRING which may be NONMARKING in FILE. |
| 1591 | If omitted, NONMARKING defaults to nil and FILE defaults to `diary-file'." | 1592 | If omitted, NONMARKING defaults to nil and FILE defaults to `diary-file'." |
| 1592 | (find-file-other-window (substitute-in-file-name (or file diary-file))) | 1593 | (let ((pop-up-frames (window-dedicated-p (selected-window)))) |
| 1594 | (find-file-other-window (substitute-in-file-name (or file diary-file)))) | ||
| 1593 | (widen) | 1595 | (widen) |
| 1594 | (goto-char (point-max)) | 1596 | (goto-char (point-max)) |
| 1595 | (when (let ((case-fold-search t)) | 1597 | (when (let ((case-fold-search t)) |