Mercurial > emacs
annotate lisp/calendar/cal-x.el @ 13287:f25084d29719
(Info-following-node-name, Info-extract-menu-node-name)
(Info-select-node): Use buffer-substring-no-properties.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 24 Oct 1995 16:36:52 +0000 |
parents | eafe26212f32 |
children | 3d2e58f4385f |
rev | line source |
---|---|
10088 | 1 ;;; cal-x.el --- calendar windows in dedicated frames in x-windows |
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 | |
8 ;; Human-Keywords: calendar, dedicated frames, x-windows | |
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 | |
23 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
24 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;; This collection of functions implements dedicated frames in x-windows for | |
29 ;; calendar.el. | |
30 | |
31 ;; Comments, corrections, and improvements should be sent to | |
32 ;; Edward M. Reingold Department of Computer Science | |
33 ;; (217) 333-6733 University of Illinois at Urbana-Champaign | |
34 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue | |
35 ;; Urbana, Illinois 61801 | |
36 | |
37 ;;; Code: | |
38 | |
39 (defvar calendar-frame nil "Frame in which to display the calendar.") | |
40 | |
41 (defvar diary-frame nil "Frame in which to display the diary.") | |
42 | |
43 (defvar diary-frame-parameters | |
44 '((name . "Diary") (height . 10) (width . 80) (unsplittable . t) | |
45 (font . "6x13") (auto-lower . t) (auto-raise . t) (minibuffer . nil)) | |
46 "Parameters of the diary frame, if the diary is in its own frame. | |
47 Location and color should be set in .Xdefaults.") | |
48 | |
49 (defvar calendar-frame-parameters | |
50 '((name . "Calendar") (minibuffer . nil) (height . 10) (width . 80) | |
51 (auto-raise . t) (auto-lower . t) (font . "6x13") (unsplittable . t) | |
52 (vertical-scroll-bars . nil)) | |
53 "Parameters of the calendar frame, if the calendar is in a separate frame. | |
54 Location and color should be set in .Xdefaults.") | |
55 | |
56 (defvar calendar-and-diary-frame-parameters | |
57 '((name . "Calendar") (height . 28) (width . 80) (minibuffer . nil) | |
58 (font . "6x13") (auto-raise . t) (auto-lower . t)) | |
59 "Parameters of the frame that displays both the calendar and the diary. | |
60 Location and color should be set in .Xdefaults.") | |
61 | |
62 (defvar calendar-after-frame-setup-hooks nil | |
63 "Hooks to be run just after setting up a calendar frame. | |
64 Can be used to change frame parameters, such as font, color, location, etc.") | |
65 | |
66 (defun calendar-one-frame-setup (&optional arg) | |
67 "Start calendar and display it in a dedicated frame together with the diary." | |
68 (if (not window-system) | |
69 (calendar-basic-setup arg) | |
70 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) | |
71 (if (frame-live-p diary-frame) (delete-frame diary-frame)) | |
72 (let ((special-display-buffer-names nil) | |
73 (view-diary-entries-initially t)) | |
74 (save-window-excursion | |
75 (save-excursion | |
76 (setq calendar-frame | |
77 (make-frame calendar-and-diary-frame-parameters)) | |
78 (run-hooks 'calendar-after-frame-setup-hooks) | |
79 (select-frame calendar-frame) | |
80 (if (eq 'icon (cdr (assoc 'visibility | |
81 (frame-parameters calendar-frame)))) | |
82 (iconify-or-deiconify-frame)) | |
83 (calendar-basic-setup arg) | |
84 (set-window-dedicated-p (selected-window) 'calendar) | |
85 (set-window-dedicated-p | |
86 (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
|
87 (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
|
88 (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
|
89 (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
|
90 (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
|
91 fancy-diary-buffer)) |
10088 | 92 '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
|
93 |
10088 | 94 (defun calendar-two-frame-setup (&optional arg) |
95 "Start calendar and diary in separate, dedicated frames." | |
96 (if (not window-system) | |
97 (calendar-basic-setup arg) | |
98 (if (frame-live-p calendar-frame) (delete-frame calendar-frame)) | |
99 (if (frame-live-p diary-frame) (delete-frame diary-frame)) | |
100 (let ((pop-up-windows nil) | |
101 (view-diary-entries-initially nil) | |
102 (special-display-buffer-names nil)) | |
103 (save-window-excursion | |
104 (save-excursion (calendar-basic-setup arg)) | |
105 (setq calendar-frame (make-frame calendar-frame-parameters)) | |
106 (run-hooks 'calendar-after-frame-setup-hooks) | |
107 (select-frame calendar-frame) | |
108 (if (eq 'icon (cdr (assoc 'visibility | |
109 (frame-parameters calendar-frame)))) | |
110 (iconify-or-deiconify-frame)) | |
111 (display-buffer calendar-buffer) | |
112 (set-window-dedicated-p (selected-window) 'calendar) | |
113 (setq diary-frame (make-frame diary-frame-parameters)) | |
114 (run-hooks 'calendar-after-frame-setup-hooks) | |
115 (select-frame diary-frame) | |
116 (if (eq 'icon (cdr (assoc 'visibility | |
117 (frame-parameters diary-frame)))) | |
118 (iconify-or-deiconify-frame)) | |
119 (save-excursion (diary)) | |
120 (set-window-dedicated-p | |
121 (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
|
122 (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
|
123 (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
|
124 (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
|
125 (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
|
126 fancy-diary-buffer)) |
10088 | 127 'diary))))) |
128 | |
129 (setq special-display-buffer-names | |
130 (append special-display-buffer-names | |
131 (list "*Yahrzeits*" lunar-phases-buffer holiday-buffer | |
132 fancy-diary-buffer (get-file-buffer diary-file) | |
133 calendar-buffer))) | |
134 | |
135 (run-hooks 'cal-x-load-hook) | |
136 | |
137 (provide 'cal-x) | |
138 | |
139 ;;; cal-x.el ends here |