Mercurial > emacs
annotate lisp/calendar/cal-x.el @ 15462:6418750a8408 libc-1-92 libc-960621 libc-960622 libc-960623 libc-960624 libc-960625 libc-960626 libc-960627 libc-960628
Add support for PowerPC Linux
author | Michael Meissner <gnu@the-meissners.org> |
---|---|
date | Thu, 20 Jun 1996 16:20:05 +0000 |
parents | 2151ff2428aa |
children | ac47a12e523c |
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 | 2 |
13046
eafe26212f32
Moved stuff to calendar.el, as per RSM's request.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12060
diff
changeset
|
3 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. |
10088 | 4 |
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | |
6 ;; Edward M. Reingold <reingold@cs.uiuc.edu> | |
7 ;; Keywords: calendar | |
14269
af156af979be
Fix doc strings at top of file.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14169
diff
changeset
|
8 ;; Human-Keywords: calendar, dedicated frames, X Window System |
10088 | 9 |
10 ;; This file is part of GNU Emacs. | |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 ;; Boston, MA 02111-1307, USA. | |
10088 | 26 |
27 ;;; Commentary: | |
28 | |
14269
af156af979be
Fix doc strings at top of file.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14169
diff
changeset
|
29 ;; This collection of functions implements dedicated frames in X for |
10088 | 30 ;; calendar.el. |
31 | |
32 ;; Comments, corrections, and improvements should be sent to | |
33 ;; Edward M. Reingold Department of Computer Science | |
34 ;; (217) 333-6733 University of Illinois at Urbana-Champaign | |
35 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue | |
36 ;; Urbana, Illinois 61801 | |
37 | |
38 ;;; Code: | |
39 | |
13441 | 40 (require 'calendar) |
41 | |
10088 | 42 (defvar calendar-frame nil "Frame in which to display the calendar.") |
43 | |
44 (defvar diary-frame nil "Frame in which to display the diary.") | |
45 | |
15114
2151ff2428aa
(diary-frame-parameters, calendar-frame-parameters)
Richard M. Stallman <rms@gnu.org>
parents:
14269
diff
changeset
|
46 ;; This should not specify the font. That's up to the user. |
2151ff2428aa
(diary-frame-parameters, calendar-frame-parameters)
Richard M. Stallman <rms@gnu.org>
parents:
14269
diff
changeset
|
47 ;; Certainly it should not specify auto-lower and auto-raise |
2151ff2428aa
(diary-frame-parameters, calendar-frame-parameters)
Richard M. Stallman <rms@gnu.org>
parents:
14269
diff
changeset
|
48 ;; since most users won't like that. |
10088 | 49 (defvar diary-frame-parameters |
50 '((name . "Diary") (height . 10) (width . 80) (unsplittable . t) | |
15114
2151ff2428aa
(diary-frame-parameters, calendar-frame-parameters)
Richard M. Stallman <rms@gnu.org>
parents:
14269
diff
changeset
|
51 (minibuffer . nil)) |
10088 | 52 "Parameters of the diary frame, if the diary is in its own frame. |
53 Location and color should be set in .Xdefaults.") | |
54 | |
55 (defvar calendar-frame-parameters | |
56 '((name . "Calendar") (minibuffer . nil) (height . 10) (width . 80) | |
15114
2151ff2428aa
(diary-frame-parameters, calendar-frame-parameters)
Richard M. Stallman <rms@gnu.org>
parents:
14269
diff
changeset
|
57 (unsplittable . t) (vertical-scroll-bars . nil)) |
10088 | 58 "Parameters of the calendar frame, if the calendar is in a separate frame. |
59 Location and color should be set in .Xdefaults.") | |
60 | |
61 (defvar calendar-and-diary-frame-parameters | |
15114
2151ff2428aa
(diary-frame-parameters, calendar-frame-parameters)
Richard M. Stallman <rms@gnu.org>
parents:
14269
diff
changeset
|
62 '((name . "Calendar") (height . 28) (width . 80) (minibuffer . nil)) |
10088 | 63 "Parameters of the frame that displays both the calendar and the diary. |
64 Location and color should be set in .Xdefaults.") | |
65 | |
66 (defvar calendar-after-frame-setup-hooks nil | |
67 "Hooks to be run just after setting up a calendar frame. | |
68 Can be used to change frame parameters, such as font, color, location, etc.") | |
69 | |
70 (defun calendar-one-frame-setup (&optional arg) | |
71 "Start calendar and display it in a dedicated frame together with the diary." | |
72 (if (not window-system) | |
73 (calendar-basic-setup arg) | |
74 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) | |
75 (if (frame-live-p diary-frame) (delete-frame diary-frame)) | |
76 (let ((special-display-buffer-names nil) | |
77 (view-diary-entries-initially t)) | |
78 (save-window-excursion | |
79 (save-excursion | |
80 (setq calendar-frame | |
81 (make-frame calendar-and-diary-frame-parameters)) | |
82 (run-hooks 'calendar-after-frame-setup-hooks) | |
83 (select-frame calendar-frame) | |
84 (if (eq 'icon (cdr (assoc 'visibility | |
85 (frame-parameters calendar-frame)))) | |
86 (iconify-or-deiconify-frame)) | |
87 (calendar-basic-setup arg) | |
88 (set-window-dedicated-p (selected-window) 'calendar) | |
89 (set-window-dedicated-p | |
90 (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
|
91 (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
|
92 (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
|
93 (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
|
94 (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
|
95 fancy-diary-buffer)) |
10088 | 96 '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
|
97 |
10088 | 98 (defun calendar-two-frame-setup (&optional arg) |
99 "Start calendar and diary in separate, dedicated frames." | |
100 (if (not window-system) | |
101 (calendar-basic-setup arg) | |
102 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) | |
103 (if (frame-live-p diary-frame) (delete-frame diary-frame)) | |
104 (let ((pop-up-windows nil) | |
105 (view-diary-entries-initially nil) | |
106 (special-display-buffer-names nil)) | |
107 (save-window-excursion | |
108 (save-excursion (calendar-basic-setup arg)) | |
109 (setq calendar-frame (make-frame calendar-frame-parameters)) | |
110 (run-hooks 'calendar-after-frame-setup-hooks) | |
111 (select-frame calendar-frame) | |
112 (if (eq 'icon (cdr (assoc 'visibility | |
113 (frame-parameters calendar-frame)))) | |
114 (iconify-or-deiconify-frame)) | |
115 (display-buffer calendar-buffer) | |
116 (set-window-dedicated-p (selected-window) 'calendar) | |
117 (setq diary-frame (make-frame diary-frame-parameters)) | |
118 (run-hooks 'calendar-after-frame-setup-hooks) | |
119 (select-frame diary-frame) | |
120 (if (eq 'icon (cdr (assoc 'visibility | |
121 (frame-parameters diary-frame)))) | |
122 (iconify-or-deiconify-frame)) | |
123 (save-excursion (diary)) | |
124 (set-window-dedicated-p | |
125 (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
|
126 (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
|
127 (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
|
128 (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
|
129 (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
|
130 fancy-diary-buffer)) |
10088 | 131 'diary))))) |
132 | |
133 (setq special-display-buffer-names | |
134 (append special-display-buffer-names | |
135 (list "*Yahrzeits*" lunar-phases-buffer holiday-buffer | |
136 fancy-diary-buffer (get-file-buffer diary-file) | |
137 calendar-buffer))) | |
138 | |
139 (run-hooks 'cal-x-load-hook) | |
140 | |
141 (provide 'cal-x) | |
142 | |
143 ;;; cal-x.el ends here |