aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-03-25 03:43:46 +0000
committerGlenn Morris2008-03-25 03:43:46 +0000
commit4ec69ba5d47891e63dc0d166f6622198d0445693 (patch)
tree28d8fc9162b75d1150b0d9d31f916d61bd14193e
parentf49f2a9eb11c211fa07e0946855af9f7495e1632 (diff)
downloademacs-4ec69ba5d47891e63dc0d166f6622198d0445693.tar.gz
emacs-4ec69ba5d47891e63dc0d166f6622198d0445693.zip
(diary-frame-parameters, calendar-frame-parameters)
(calendar-and-diary-frame-parameters): Doc fixes. (make-fancy-diary-buffer): Remove declaration. (calendar-dedicate-diary): Replace call to deleted function make-fancy-diary-buffer. (calendar-frame-setup): New function. (calendar-one-frame-setup, calendar-only-one-frame-setup) (calendar-two-frame-setup): Call calendar-frame-setup to do the actual work, and mark as obsolete. (special-display-buffer-names): Don't mess with this; it's not our business. (cal-x-load-hook): Defvar it, and mark as obsolete.
-rw-r--r--lisp/ChangeLog41
-rw-r--r--lisp/calendar/cal-x.el139
2 files changed, 111 insertions, 69 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d300ae50324..91c5bb74d8b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,8 +1,47 @@
12008-03-25 Glenn Morris <rgm@gnu.org>
2
3 * calendar/cal-bahai.el (calendar-bahai-read-date): New name for
4 calendar-bahai-prompt-for-date. Update callers, make old name an
5 obsolete alias. Doc fix.
6 * calendar/cal-coptic.el (calendar-coptic-read-date): New name for
7 coptic-prompt-for-date. Update callers, make old name an
8 obsolete alias. Doc fix.
9 * calendar/cal-hebrew.el (calendar-hebrew-read-date): New name for
10 calendar-hebrew-prompt-for-date. Update callers. Doc fix.
11 * calendar/cal-islam.el (calendar-islamic-read-date): New name for
12 calendar-islamic-prompt-for-date. Update callers. Doc fix.
13 * calendar/cal-iso.el (calendar-iso-read-date): New name for
14 calendar-iso-read-args. Update callers, make old name an obsolete
15 alias.
16 * calendar/cal-persia.el (calendar-persian-read-date): New name for
17 persian-prompt-for-date. Update callers, make old name an
18 obsolete alias. Doc fix. Move definition before use.
19
20 * calendar/cal-x.el (diary-frame-parameters)
21 (calendar-frame-parameters, calendar-and-diary-frame-parameters):
22 Doc fixes.
23 (make-fancy-diary-buffer): Remove declaration.
24 (calendar-dedicate-diary): Replace call to deleted function
25 make-fancy-diary-buffer.
26 (calendar-frame-setup): New function.
27 (calendar-one-frame-setup, calendar-only-one-frame-setup)
28 (calendar-two-frame-setup): Call calendar-frame-setup to do the actual
29 work, and mark as obsolete.
30 (special-display-buffer-names): Don't mess with this; it's not our
31 business.
32 (cal-x-load-hook): Defvar it, and mark as obsolete.
33
34 * calendar/calendar.el (calendar-remove-frame-by-deleting):
35 Default to t. Add to 'calendar group.
36 (calendar): Doc fix. Use calendar-frame-setup.
37 (calendar-basic-setup): Doc fix. Add optional NODISPLAY argument.
38 (generate-calendar-window): Doc fix.
39
12008-03-24 Stefan Monnier <monnier@iro.umontreal.ca> 402008-03-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 41
3 * vc-bzr.el (vc-bzr-print-log, vc-bzr-diff): Do it asynchronously. 42 * vc-bzr.el (vc-bzr-print-log, vc-bzr-diff): Do it asynchronously.
4 43
52008-03-22 Drew Adams <drew.adams@oracle.com> 442008-03-24 Drew Adams <drew.adams@oracle.com>
6 45
7 * finder.el (finder-mode-syntax-table, finder-font-lock-keywords): 46 * finder.el (finder-mode-syntax-table, finder-font-lock-keywords):
8 New variables. 47 New variables.
diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el
index 1d45d32a994..e9cd202a71c 100644
--- a/lisp/calendar/cal-x.el
+++ b/lisp/calendar/cal-x.el
@@ -39,7 +39,7 @@
39 '((name . "Diary") (title . "Diary") (height . 10) (width . 80) 39 '((name . "Diary") (title . "Diary") (height . 10) (width . 80)
40 (unsplittable . t) (minibuffer . nil)) 40 (unsplittable . t) (minibuffer . nil))
41 "Parameters of the diary frame, if the diary is in its own frame. 41 "Parameters of the diary frame, if the diary is in its own frame.
42Location and color should be set in .Xdefaults." ; why? 42Relevant if `calendar-setup' has the value `two-frames'."
43 :type 'alist 43 :type 'alist
44 :options '((name string) (title string) (height integer) (width integer) 44 :options '((name string) (title string) (height integer) (width integer)
45 (unsplittable boolean) (minibuffer boolean) 45 (unsplittable boolean) (minibuffer boolean)
@@ -50,7 +50,7 @@ Location and color should be set in .Xdefaults." ; why?
50 '((name . "Calendar") (title . "Calendar") (height . 10) (width . 80) 50 '((name . "Calendar") (title . "Calendar") (height . 10) (width . 80)
51 (unsplittable . t) (minibuffer . nil) (vertical-scroll-bars . nil)) 51 (unsplittable . t) (minibuffer . nil) (vertical-scroll-bars . nil))
52 "Parameters of the calendar frame, if the calendar is in a separate frame. 52 "Parameters of the calendar frame, if the calendar is in a separate frame.
53Location and color should be set in .Xdefaults." 53Relevant if `calendar-setup' has the value `calendar-only' or `two-frames'."
54 :type 'alist 54 :type 'alist
55 :options '((name string) (title string) (height integer) (width integer) 55 :options '((name string) (title string) (height integer) (width integer)
56 (unsplittable boolean) (minibuffer boolean) 56 (unsplittable boolean) (minibuffer boolean)
@@ -61,7 +61,7 @@ Location and color should be set in .Xdefaults."
61 '((name . "Calendar") (title . "Calendar") (height . 28) (width . 80) 61 '((name . "Calendar") (title . "Calendar") (height . 28) (width . 80)
62 (minibuffer . nil)) 62 (minibuffer . nil))
63 "Parameters of the frame that displays both the calendar and the diary. 63 "Parameters of the frame that displays both the calendar and the diary.
64Location and color should be set in .Xdefaults." 64Relevant if `calendar-setup' has the value `one-frame'."
65 :type 'alist 65 :type 'alist
66 :options '((name string) (title string) (height integer) (width integer) 66 :options '((name string) (title string) (height integer) (width integer)
67 (unsplittable boolean) (minibuffer boolean) 67 (unsplittable boolean) (minibuffer boolean)
@@ -89,92 +89,95 @@ Can be used to change frame parameters, such as font, color, location, etc."
89 (if (eq 'icon (cdr (assoc 'visibility (frame-parameters frame)))) 89 (if (eq 'icon (cdr (assoc 'visibility (frame-parameters frame))))
90 (iconify-or-deiconify-frame))) 90 (iconify-or-deiconify-frame)))
91 91
92;; calendar-basic-setup is called first, and will autoload diary-lib.
93(declare-function make-fancy-diary-buffer "diary-lib" nil)
94
95(defun calendar-dedicate-diary () 92(defun calendar-dedicate-diary ()
96 "Dedicate the window associated with the diary buffer." 93 "Display and dedicate the window associated with the diary buffer."
97 (set-window-dedicated-p 94 (set-window-dedicated-p
98 (display-buffer 95 (display-buffer
99 (if (not (memq 'fancy-diary-display diary-display-hook)) 96 (if (not (memq 'fancy-diary-display diary-display-hook))
100 (get-file-buffer diary-file) 97 (get-file-buffer diary-file)
98 ;; If there are no diary entries, there won't be a fancy-diary
99 ;; to dedicate, so make a basic one.
101 (or (buffer-live-p fancy-diary-buffer) 100 (or (buffer-live-p fancy-diary-buffer)
102 (make-fancy-diary-buffer)) 101 (calendar-in-read-only-buffer fancy-diary-buffer
102 (calendar-set-mode-line "Diary Entries")))
103 fancy-diary-buffer)) 103 fancy-diary-buffer))
104 t)) 104 t))
105 105
106;;; FIXME ../../src/emacs -Q --eval "(setq calendar-setup 'calendar-only)" -f calendar
107;;;###cal-autoload 106;;;###cal-autoload
108(defun calendar-one-frame-setup (&optional arg only) 107(defun calendar-frame-setup (config &optional prompt)
109 "Start calendar and display it in a dedicated frame. 108 "Display the calendar, and optionally the diary, in a separate frame.
110Also show the diary in that frame, unless ONLY is non-nil. The optional 109CONFIG should be one of:
111argument ARG is passed to `calendar-basic-setup'. If the display 110`calendar-only' - just the calendar, no diary
112is not capable of multiple frames, `calendar-basic-setup' is all 111`one-frame' - calendar and diary in a single frame
113that is used." 112`two-frames' - calendar and diary each in a separate frame
114 (if (not (display-multi-frame-p)) 113
115 (calendar-basic-setup arg) 114If CONFIG has any other value, or if the display is not capable of
115multiple frames, then `calendar-basic-setup' is called.
116
117If PROMPT is non-nil, prompt for the month and year to use."
118 (if (not (and (display-multi-frame-p)
119 (memq config '(calendar-only one-frame two-frames))))
120 (calendar-basic-setup prompt)
116 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) 121 (if (frame-live-p calendar-frame) (delete-frame calendar-frame))
117 (unless only 122 (unless (eq config 'calendar-only)
118 (if (frame-live-p diary-frame) (delete-frame diary-frame))) 123 (if (frame-live-p diary-frame) (delete-frame diary-frame)))
119 (let ((special-display-buffer-names nil) 124 (let ((view-diary-entries-initially (eq config 'one-frame))
120 (view-diary-entries-initially (not only))) 125 ;; For final calendar-dedicate-diary in two-frames case.
126 (pop-up-windows nil))
121 (save-window-excursion 127 (save-window-excursion
122 (save-excursion 128 ;; Do diary first so that calendar is always left current.
129 (when (eq config 'two-frames)
123 (calendar-frame-1 130 (calendar-frame-1
124 (setq calendar-frame 131 (setq diary-frame (make-frame diary-frame-parameters)))
125 (make-frame (if only 132 (diary)
126 calendar-frame-parameters 133 (calendar-dedicate-diary))
127 calendar-and-diary-frame-parameters)))) 134 (calendar-frame-1
128 (calendar-basic-setup arg) ; FIXME move? 135 (setq calendar-frame
129 ;; FIXME display-buffer? 136 (make-frame (if (eq config 'one-frame)
130 (set-window-dedicated-p (selected-window) t) 137 calendar-and-diary-frame-parameters
131 (unless only (calendar-dedicate-diary))))))) 138 calendar-frame-parameters))))
139 (calendar-basic-setup prompt (not (eq config 'one-frame)))
140 (set-window-buffer (selected-window) calendar-buffer)
141 (set-window-dedicated-p (selected-window) t)
142 (if (eq config 'one-frame)
143 (calendar-dedicate-diary))))))
144
132 145
133;;;###cal-autoload 146;;;###cal-autoload
134(defun calendar-only-one-frame-setup (&optional arg) 147(defun calendar-one-frame-setup (&optional prompt)
135 "Start calendar and display it in a dedicated frame. 148 "Display calendar and diary in a single dedicated frame.
136The optional argument ARG is passed to `calendar-basic-setup'. 149See `calendar-frame-setup' for more information."
137If the display is not capable of multiple frames, `calendar-basic-setup' 150 (calendar-frame-setup 'one-frame prompt))
138is all that is used." 151
139 (calendar-one-frame-setup arg t)) 152(make-obsolete 'calendar-one-frame-setup 'calendar-frame-setup "23.1")
153
140 154
141;;;###cal-autoload 155;;;###cal-autoload
142(defun calendar-two-frame-setup (&optional arg) 156(defun calendar-only-one-frame-setup (&optional prompt)
143 "Start calendar and diary in separate, dedicated frames. 157 "Display calendar in a dedicated frame.
144The optional argument ARG is passed to `calendar-basic-setup'. 158See `calendar-frame-setup' for more information."
145If the display is not capable of multiple frames, `calendar-basic-setup' 159 (calendar-frame-setup 'calendar-only prompt))
146is all that is used." 160
147 (if (not (display-multi-frame-p)) 161
148 (calendar-basic-setup arg) 162(make-obsolete 'calendar-only-one-frame-setup 'calendar-frame-setup "23.1")
149 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) 163
150 (if (frame-live-p diary-frame) (delete-frame diary-frame)) 164;;;###cal-autoload
151 (let ((pop-up-windows nil) 165(defun calendar-two-frame-setup (&optional prompt)
152 (view-diary-entries-initially nil) 166 "Display calendar and diary in separate, dedicated frames.
153 (special-display-buffer-names nil)) 167See `calendar-frame-setup' for more information."
154 (save-window-excursion 168 (calendar-frame-setup 'two-frames prompt))
155 ;; FIXME why does this do things in a slightly different order 169
156 ;; to calendar-one-frame-setup? 170(make-obsolete 'calendar-two-frame-setup 'calendar-frame-setup "23.1")
157 (save-excursion (calendar-basic-setup arg)) 171
158 (calendar-frame-1 172
159 (setq calendar-frame (make-frame calendar-frame-parameters))) 173;; Undocumented and probably useless.
160 (display-buffer calendar-buffer) 174(defvar cal-x-load-hook nil
161 (set-window-dedicated-p (selected-window) t) 175 "Hook run on loading of the `cal-x' package.")
162 (calendar-frame-1 176(make-obsolete-variable 'cal-x-load-hook "it will be removed in future." "23.1")
163 (setq diary-frame (make-frame diary-frame-parameters)))
164 (save-excursion (diary))
165 (calendar-dedicate-diary)))))
166
167;; Formerly (get-file-buffer diary-file) was added to the list here,
168;; but that isn't clean, and the value could even be nil.
169;; FIXME is this really our business?
170(setq special-display-buffer-names
171 (append special-display-buffer-names
172 (list cal-hebrew-yahrzeit-buffer
173 lunar-phases-buffer holiday-buffer fancy-diary-buffer
174 other-calendars-buffer calendar-buffer)))
175 177
176(run-hooks 'cal-x-load-hook) 178(run-hooks 'cal-x-load-hook)
177 179
180
178(provide 'cal-x) 181(provide 'cal-x)
179 182
180;; arch-tag: c6dbddca-ae84-442d-87fc-244b76e38e17 183;; arch-tag: c6dbddca-ae84-442d-87fc-244b76e38e17