annotate lisp/calendar/cal-x.el @ 92754:6984a176570c

(message-ignored-resent-headers): Add "Delivered-To".
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 12 Mar 2008 13:06:58 +0000
parents fce91e69b8d6
children d2480af27611
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14269
af156af979be Fix doc strings at top of file.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
1 ;;; cal-x.el --- calendar windows in dedicated frames in X
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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,
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
4 ;; 2008 Free Software Foundation, Inc.
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
5
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
6 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9 ;; Keywords: calendar
14269
af156af979be Fix doc strings at top of file.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
10 ;; Human-Keywords: calendar, dedicated frames, X Window System
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
11
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
13
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
78216
93e11478c954 Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 77279
diff changeset
16 ;; the Free Software Foundation; either version 3, or (at your option)
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
17 ;; any later version.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
18
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22 ;; GNU General Public License for more details.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
23
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13441
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61142
diff changeset
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61142
diff changeset
27 ;; Boston, MA 02110-1301, USA.
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
29 ;;; Commentary:
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
30
14269
af156af979be Fix doc strings at top of file.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
31 ;; This collection of functions implements dedicated frames in X for
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
32 ;; calendar.el.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
33
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
34 ;;; Code:
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
35
13441
3d2e58f4385f Require calendar.
Richard M. Stallman <rms@gnu.org>
parents: 13046
diff changeset
36 (require 'calendar)
3d2e58f4385f Require calendar.
Richard M. Stallman <rms@gnu.org>
parents: 13046
diff changeset
37
92605
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
38 (defcustom diary-frame-parameters
23552
905aab3037e8 Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22262
diff changeset
39 '((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
40 (unsplittable . t) (minibuffer . nil))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
41 "Parameters of the diary frame, if the diary is in its own frame.
92605
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
42 Location and color should be set in .Xdefaults."
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
43 :type 'sexp
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
44 :group 'calendar)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 37431
diff changeset
45
92623
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
46 (defcustom calendar-frame-parameters
23552
905aab3037e8 Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22262
diff changeset
47 '((name . "Calendar") (title . "Calendar") (minibuffer . nil)
905aab3037e8 Add title parameters to frames.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22262
diff changeset
48 (height . 10) (width . 80) (unsplittable . t) (vertical-scroll-bars . nil))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
49 "Parameters of the calendar frame, if the calendar is in a separate frame.
92605
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
50 Location and color should be set in .Xdefaults."
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
51 :type 'sexp
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
52 :group 'calendar)
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
53
92623
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
54 (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
55 '((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
56 (minibuffer . nil))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
57 "Parameters of the frame that displays both the calendar and the diary.
92605
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
58 Location and color should be set in .Xdefaults."
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
59 :type 'sexp
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
60 :group 'calendar)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 37431
diff changeset
61
92605
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
62 (defcustom calendar-after-frame-setup-hooks nil
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
63 "Hooks to be run just after setting up a calendar frame.
92605
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
64 Can be used to change frame parameters, such as font, color, location, etc."
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
65 :type 'hook
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
66 :group 'calendar-hooks)
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
67
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
68 ;;; End of user options.
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
69
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
70 (defvar calendar-frame nil
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
71 "Frame in which to display the calendar.")
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
72
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
73 (defvar diary-frame nil
5fb3b5d72071 (diary-frame-parameters, calendar-frame-parameters)
Glenn Morris <rgm@gnu.org>
parents: 92593
diff changeset
74 "Frame in which to display the diary.")
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 37431
diff changeset
75
86492
62e8353f2872 (make-fancy-diary-buffer): Declare as function.
Glenn Morris <rgm@gnu.org>
parents: 82140
diff changeset
76 ;; calendar-basic-setup is called first, and will autoload diary-lib.
62e8353f2872 (make-fancy-diary-buffer): Declare as function.
Glenn Morris <rgm@gnu.org>
parents: 82140
diff changeset
77 (declare-function make-fancy-diary-buffer "diary-lib" nil)
62e8353f2872 (make-fancy-diary-buffer): Declare as function.
Glenn Morris <rgm@gnu.org>
parents: 82140
diff changeset
78
92593
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
79 ;;;###autoload
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
80 (defun calendar-one-frame-setup (&optional arg)
53558
2c8dcca3af26 (calendar-one-frame-setup)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
81 "Start calendar and display it in a dedicated frame together with the diary.
2c8dcca3af26 (calendar-one-frame-setup)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
82 This function requires a display capable of multiple frames, else
92623
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
83 `calendar-basic-setup' is used instead. The optional argument ARG is
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
84 passed to `calendar-basic-setup'."
37431
bd1a8b1c88d7 (calendar-two-frame-setup, calendar-only-one-frame-setup)
Eli Zaretskii <eliz@gnu.org>
parents: 24890
diff changeset
85 (if (not (display-multi-frame-p))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
86 (calendar-basic-setup arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
87 (if (frame-live-p calendar-frame) (delete-frame calendar-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
88 (if (frame-live-p diary-frame) (delete-frame diary-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
89 (let ((special-display-buffer-names nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
90 (view-diary-entries-initially t))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
91 (save-window-excursion
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
92 (save-excursion
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
93 (setq calendar-frame
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
94 (make-frame calendar-and-diary-frame-parameters))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
95 (run-hooks 'calendar-after-frame-setup-hooks)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
96 (select-frame calendar-frame)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
97 (if (eq 'icon (cdr (assoc 'visibility
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
98 (frame-parameters calendar-frame))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
99 (iconify-or-deiconify-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
100 (calendar-basic-setup arg)
61142
1b5d0d3282a7 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 53558
diff changeset
101 (set-window-dedicated-p (selected-window) t)
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
102 (set-window-dedicated-p
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
103 (display-buffer
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
104 (if (not (memq 'fancy-diary-display diary-display-hook))
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
105 (get-file-buffer diary-file)
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
106 (if (not (bufferp (get-buffer fancy-diary-buffer)))
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
107 (make-fancy-diary-buffer))
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
108 fancy-diary-buffer))
61142
1b5d0d3282a7 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 53558
diff changeset
109 t))))))
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
110
92593
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
111 ;;;###autoload
24890
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
112 (defun calendar-only-one-frame-setup (&optional arg)
53558
2c8dcca3af26 (calendar-one-frame-setup)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
113 "Start calendar and display it in a dedicated frame.
2c8dcca3af26 (calendar-one-frame-setup)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
114 This function requires a display capable of multiple frames, else
92623
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
115 `calendar-basic-setup' is used instead. The optional argument
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
116 ARG is passed to `calendar-basic-setup'"
37431
bd1a8b1c88d7 (calendar-two-frame-setup, calendar-only-one-frame-setup)
Eli Zaretskii <eliz@gnu.org>
parents: 24890
diff changeset
117 (if (not (display-multi-frame-p))
24890
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
118 (calendar-basic-setup arg)
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
119 (if (frame-live-p calendar-frame) (delete-frame calendar-frame))
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
120 (let ((special-display-buffer-names nil)
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
121 (view-diary-entries-initially nil))
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
122 (save-window-excursion
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
123 (save-excursion
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
124 (setq calendar-frame
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
125 (make-frame calendar-frame-parameters))
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
126 (run-hooks 'calendar-after-frame-setup-hooks)
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
127 (select-frame calendar-frame)
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
128 (if (eq 'icon (cdr (assoc 'visibility
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
129 (frame-parameters calendar-frame))))
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
130 (iconify-or-deiconify-frame))
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
131 (calendar-basic-setup arg)
61142
1b5d0d3282a7 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 53558
diff changeset
132 (set-window-dedicated-p (selected-window) t))))))
24890
5f37b93c8538 (calendar-only-one-frame-setup): New function.
Karl Heuer <kwzh@gnu.org>
parents: 24860
diff changeset
133
92593
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
134 ;;;###autoload
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
135 (defun calendar-two-frame-setup (&optional arg)
53558
2c8dcca3af26 (calendar-one-frame-setup)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
136 "Start calendar and diary in separate, dedicated frames.
2c8dcca3af26 (calendar-one-frame-setup)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
137 This function requires a display capable of multiple frames, else
92623
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
138 `calendar-basic-setup' is used instead. The optional argument
fce91e69b8d6 (calendar-frame-parameters, calendar-and-diary-frame-parameters): Fix
Glenn Morris <rgm@gnu.org>
parents: 92605
diff changeset
139 ARG is passed to `calendar-basic-setup'"
37431
bd1a8b1c88d7 (calendar-two-frame-setup, calendar-only-one-frame-setup)
Eli Zaretskii <eliz@gnu.org>
parents: 24890
diff changeset
140 (if (not (display-multi-frame-p))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
141 (calendar-basic-setup arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
142 (if (frame-live-p calendar-frame) (delete-frame calendar-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
143 (if (frame-live-p diary-frame) (delete-frame diary-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
144 (let ((pop-up-windows nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
145 (view-diary-entries-initially nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
146 (special-display-buffer-names nil))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
147 (save-window-excursion
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
148 (save-excursion (calendar-basic-setup arg))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
149 (setq calendar-frame (make-frame calendar-frame-parameters))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
150 (run-hooks 'calendar-after-frame-setup-hooks)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
151 (select-frame calendar-frame)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
152 (if (eq 'icon (cdr (assoc 'visibility
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
153 (frame-parameters calendar-frame))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
154 (iconify-or-deiconify-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
155 (display-buffer calendar-buffer)
61142
1b5d0d3282a7 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 53558
diff changeset
156 (set-window-dedicated-p (selected-window) t)
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
157 (setq diary-frame (make-frame diary-frame-parameters))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
158 (run-hooks 'calendar-after-frame-setup-hooks)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
159 (select-frame diary-frame)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
160 (if (eq 'icon (cdr (assoc 'visibility
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
161 (frame-parameters diary-frame))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
162 (iconify-or-deiconify-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
163 (save-excursion (diary))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
164 (set-window-dedicated-p
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
165 (display-buffer
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
166 (if (not (memq 'fancy-diary-display diary-display-hook))
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
167 (get-file-buffer diary-file)
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
168 (if (not (bufferp (get-buffer fancy-diary-buffer)))
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
169 (make-fancy-diary-buffer))
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
170 fancy-diary-buffer))
61142
1b5d0d3282a7 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 53558
diff changeset
171 t)))))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
172
24860
069cad4a56ef (special-display-buffer-names):
Karl Heuer <kwzh@gnu.org>
parents: 23552
diff changeset
173 ;; Formerly (get-file-buffer diary-file) was added to the list here,
069cad4a56ef (special-display-buffer-names):
Karl Heuer <kwzh@gnu.org>
parents: 23552
diff changeset
174 ;; but that isn't clean, and the value could even be nil.
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
175 (setq special-display-buffer-names
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
176 (append special-display-buffer-names
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
177 (list "*Yahrzeits*" lunar-phases-buffer holiday-buffer
24860
069cad4a56ef (special-display-buffer-names):
Karl Heuer <kwzh@gnu.org>
parents: 23552
diff changeset
178 fancy-diary-buffer
22262
ac47a12e523c Fix list of "special" buffers.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15114
diff changeset
179 other-calendars-buffer calendar-buffer)))
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
180
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
181 (run-hooks 'cal-x-load-hook)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
182
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
183 (provide 'cal-x)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
184
92593
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
185 ;; Local Variables:
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
186 ;; generated-autoload-file: "cal-loaddefs.el"
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
187 ;; End:
d5d618fbbbab Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
188
82116
f8b17fd6cf74 Trivial comment style change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
189 ;; arch-tag: c6dbddca-ae84-442d-87fc-244b76e38e17
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
190 ;;; cal-x.el ends here