Mercurial > emacs
annotate lisp/calendar/cal-x.el @ 110682:ba6a1c230532
gnus-html.el (gnus-html-prefetch-images): Adjust regexp to avoid regexp backtrace overflows.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Fri, 01 Oct 2010 13:33:03 +0000 |
parents | 280c8ae2476d |
children | 417b1e4d63cd |
rev | line source |
---|---|
93483
a4a2b2f63116
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93226
diff
changeset
|
1 ;;; cal-x.el --- calendar windows in dedicated frames |
10088 | 2 |
92623
fce91e69b8d6
(calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents:
92605
diff
changeset
|
3 ;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
106815 | 4 ;; 2008, 2009, 2010 Free Software Foundation, Inc. |
10088 | 5 |
6 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | |
92857 | 7 ;; Edward M. Reingold <reingold@cs.uiuc.edu> |
65919
5c09efcfc1d9
Update maintainer email address.
Glenn Morris <rgm@gnu.org>
parents:
64085
diff
changeset
|
8 ;; Maintainer: Glenn Morris <rgm@gnu.org> |
10088 | 9 ;; Keywords: calendar |
93483
a4a2b2f63116
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93226
diff
changeset
|
10 ;; Human-Keywords: calendar, dedicated frames |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
11 ;; Package: calendar |
10088 | 12 |
13 ;; This file is part of GNU Emacs. | |
14 | |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94021
diff
changeset
|
15 ;; GNU Emacs is free software: you can redistribute it and/or modify |
10088 | 16 ;; it under the terms of the GNU General Public License as published by |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94021
diff
changeset
|
17 ;; the Free Software Foundation, either version 3 of the License, or |
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94021
diff
changeset
|
18 ;; (at your option) any later version. |
10088 | 19 |
20 ;; GNU Emacs is distributed in the hope that it will be useful, | |
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 ;; GNU General Public License for more details. | |
24 | |
25 ;; You should have received a copy of the GNU General Public License | |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94021
diff
changeset
|
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
10088 | 27 |
28 ;;; Commentary: | |
29 | |
93483
a4a2b2f63116
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93226
diff
changeset
|
30 ;; See calendar.el. |
10088 | 31 |
32 ;;; Code: | |
33 | |
13441 | 34 (require 'calendar) |
35 | |
92605
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
36 (defcustom diary-frame-parameters |
23552
905aab3037e8
Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22262
diff
changeset
|
37 '((name . "Diary") (title . "Diary") (height . 10) (width . 80) |
905aab3037e8
Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22262
diff
changeset
|
38 (unsplittable . t) (minibuffer . nil)) |
10088 | 39 "Parameters of the diary frame, if the diary is in its own frame. |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
40 Relevant if `calendar-setup' has the value `two-frames'." |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
41 :type 'alist |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
42 :options '((name string) (title string) (height integer) (width integer) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
43 (unsplittable boolean) (minibuffer boolean) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
44 (vertical-scroll-bars boolean)) |
92605
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
45 :group 'calendar) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
37431
diff
changeset
|
46 |
92623
fce91e69b8d6
(calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents:
92605
diff
changeset
|
47 (defcustom calendar-frame-parameters |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
48 '((name . "Calendar") (title . "Calendar") (height . 10) (width . 80) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
49 (unsplittable . t) (minibuffer . nil) (vertical-scroll-bars . nil)) |
10088 | 50 "Parameters of the calendar frame, if the calendar is in a separate frame. |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
51 Relevant if `calendar-setup' has the value `calendar-only' or `two-frames'." |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
52 :type 'alist |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
53 :options '((name string) (title string) (height integer) (width integer) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
54 (unsplittable boolean) (minibuffer boolean) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
55 (vertical-scroll-bars boolean)) |
92605
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
56 :group 'calendar) |
10088 | 57 |
92623
fce91e69b8d6
(calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents:
92605
diff
changeset
|
58 (defcustom calendar-and-diary-frame-parameters |
23552
905aab3037e8
Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22262
diff
changeset
|
59 '((name . "Calendar") (title . "Calendar") (height . 28) (width . 80) |
905aab3037e8
Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22262
diff
changeset
|
60 (minibuffer . nil)) |
10088 | 61 "Parameters of the frame that displays both the calendar and the diary. |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
62 Relevant if `calendar-setup' has the value `one-frame'." |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
63 :type 'alist |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
64 :options '((name string) (title string) (height integer) (width integer) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
65 (unsplittable boolean) (minibuffer boolean) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
66 (vertical-scroll-bars boolean)) |
92605
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
67 :group 'calendar) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
37431
diff
changeset
|
68 |
94021
ae1387262a67
Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents:
93949
diff
changeset
|
69 (define-obsolete-variable-alias 'calendar-after-frame-setup-hooks |
ae1387262a67
Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents:
93949
diff
changeset
|
70 'calendar-after-frame-setup-hook "23.1") |
ae1387262a67
Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents:
93949
diff
changeset
|
71 |
93226
41e41843fac2
(calendar-after-frame-setup-hook): New name for
Glenn Morris <rgm@gnu.org>
parents:
93193
diff
changeset
|
72 (defcustom calendar-after-frame-setup-hook nil |
41e41843fac2
(calendar-after-frame-setup-hook): New name for
Glenn Morris <rgm@gnu.org>
parents:
93193
diff
changeset
|
73 "List of functions to be run after creating a calendar and/or diary frame." |
92605
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
74 :type 'hook |
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
75 :group 'calendar-hooks) |
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
76 |
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
77 ;;; End of user options. |
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
78 |
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
79 (defvar calendar-frame nil |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
80 "Frame in which the calendar was last displayed.") |
92605
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
81 |
5fb3b5d72071
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92593
diff
changeset
|
82 (defvar diary-frame nil |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
83 "Frame in which the diary was last displayed.") |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
84 |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
85 (defun calendar-frame-1 (frame) |
93226
41e41843fac2
(calendar-after-frame-setup-hook): New name for
Glenn Morris <rgm@gnu.org>
parents:
93193
diff
changeset
|
86 "Subroutine used by `calendar-frame-setup'. |
41e41843fac2
(calendar-after-frame-setup-hook): New name for
Glenn Morris <rgm@gnu.org>
parents:
93193
diff
changeset
|
87 Runs `calendar-after-frame-setup-hook', selects frame, iconifies if needed." |
41e41843fac2
(calendar-after-frame-setup-hook): New name for
Glenn Morris <rgm@gnu.org>
parents:
93193
diff
changeset
|
88 (run-hooks 'calendar-after-frame-setup-hook) |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
89 (select-frame frame) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
90 (if (eq 'icon (cdr (assoc 'visibility (frame-parameters frame)))) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
91 (iconify-or-deiconify-frame))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
37431
diff
changeset
|
92 |
93949
1f90229f007f
(diary-display-hook): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
93809
diff
changeset
|
93 ;; c-d-d is only called after (diary) has been run. |
95412
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
94 (defvar diary-display-function) |
93949
1f90229f007f
(diary-display-hook): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
93809
diff
changeset
|
95 |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
96 (defun calendar-dedicate-diary () |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
97 "Display and dedicate the window associated with the diary buffer." |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
98 (set-window-dedicated-p |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
99 (display-buffer |
95412
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
100 (if (if (listp diary-display-function) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
101 (or (memq 'diary-fancy-display diary-display-function) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
102 (memq 'fancy-diary-display diary-display-function)) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
103 (memq diary-display-function '(diary-fancy-display |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
104 fancy-diary-display))) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
105 (progn |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
106 ;; If there are no diary entries, there won't be a fancy-diary |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
107 ;; to dedicate, so make a basic one. |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
108 (or (get-buffer diary-fancy-buffer) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
109 (calendar-in-read-only-buffer diary-fancy-buffer |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
110 (calendar-set-mode-line "Diary Entries"))) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
111 diary-fancy-buffer) |
f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
Glenn Morris <rgm@gnu.org>
parents:
94653
diff
changeset
|
112 (get-file-buffer diary-file))) |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
113 t)) |
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
114 |
92839
2daf404f568f
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92821
diff
changeset
|
115 ;;;###cal-autoload |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
116 (defun calendar-frame-setup (config &optional prompt) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
117 "Display the calendar, and optionally the diary, in a separate frame. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
118 CONFIG should be one of: |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
119 `calendar-only' - just the calendar, no diary |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
120 `one-frame' - calendar and diary in a single frame |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
121 `two-frames' - calendar and diary each in a separate frame |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
122 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
123 If CONFIG has any other value, or if the display is not capable of |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
124 multiple frames, then `calendar-basic-setup' is called. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
125 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
126 If PROMPT is non-nil, prompt for the month and year to use." |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
127 (if (not (and (display-multi-frame-p) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
128 (memq config '(calendar-only one-frame two-frames)))) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
129 (calendar-basic-setup prompt) |
10088 | 130 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
131 (unless (eq config 'calendar-only) |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
132 (if (frame-live-p diary-frame) (delete-frame diary-frame))) |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93792
diff
changeset
|
133 (let ((calendar-view-diary-initially-flag (eq config 'one-frame)) |
93193 | 134 ;; For calendar-dedicate-diary in two-frames case. |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
135 (pop-up-windows nil)) |
10088 | 136 (save-window-excursion |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
137 ;; Do diary first so that calendar is always left current. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
138 (when (eq config 'two-frames) |
93028
531ac371602f
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
92857
diff
changeset
|
139 (calendar-frame-1 |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
140 (setq diary-frame (make-frame diary-frame-parameters))) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
141 (diary) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
142 (calendar-dedicate-diary)) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
143 (calendar-frame-1 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
144 (setq calendar-frame |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
145 (make-frame (if (eq config 'one-frame) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
146 calendar-and-diary-frame-parameters |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
147 calendar-frame-parameters)))) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
148 (calendar-basic-setup prompt (not (eq config 'one-frame))) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
149 (set-window-buffer (selected-window) calendar-buffer) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
150 (set-window-dedicated-p (selected-window) t) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
151 (if (eq config 'one-frame) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
152 (calendar-dedicate-diary)))))) |
12060
b163768a998f
Fix cal-x.el to create an empty fancy-diary-buffer, if needed.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12049
diff
changeset
|
153 |
24890
5f37b93c8538
(calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents:
24860
diff
changeset
|
154 |
92839
2daf404f568f
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92821
diff
changeset
|
155 ;;;###cal-autoload |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
156 (defun calendar-one-frame-setup (&optional prompt) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
157 "Display calendar and diary in a single dedicated frame. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
158 See `calendar-frame-setup' for more information." |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
159 (calendar-frame-setup 'one-frame prompt)) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
160 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
161 (make-obsolete 'calendar-one-frame-setup 'calendar-frame-setup "23.1") |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
162 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
163 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
164 ;;;###cal-autoload |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
165 (defun calendar-only-one-frame-setup (&optional prompt) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
166 "Display calendar in a dedicated frame. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
167 See `calendar-frame-setup' for more information." |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
168 (calendar-frame-setup 'calendar-only prompt)) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
169 |
93193 | 170 (make-obsolete 'calendar-only-one-frame-setup 'calendar-frame-setup "23.1") |
10088 | 171 |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
172 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
173 ;;;###cal-autoload |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
174 (defun calendar-two-frame-setup (&optional prompt) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
175 "Display calendar and diary in separate, dedicated frames. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
176 See `calendar-frame-setup' for more information." |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
177 (calendar-frame-setup 'two-frames prompt)) |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
178 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
179 (make-obsolete 'calendar-two-frame-setup 'calendar-frame-setup "23.1") |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
180 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
181 |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
182 ;; Undocumented and probably useless. |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
183 (defvar cal-x-load-hook nil |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
184 "Hook run on loading of the `cal-x' package.") |
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
185 (make-obsolete-variable 'cal-x-load-hook "it will be removed in future." "23.1") |
10088 | 186 |
187 (run-hooks 'cal-x-load-hook) | |
188 | |
93188
bb7e96e383ab
(diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents:
93028
diff
changeset
|
189 |
10088 | 190 (provide 'cal-x) |
191 | |
82116
f8b17fd6cf74
Trivial comment style change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
192 ;; arch-tag: c6dbddca-ae84-442d-87fc-244b76e38e17 |
10088 | 193 ;;; cal-x.el ends here |