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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10088
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1 ;;; cal-x.el --- calendar windows in dedicated frames in x-windows
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
4
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
6 ;; Edward M. Reingold <reingold@cs.uiuc.edu>
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
7 ;; Keywords: calendar
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
8 ;; Human-Keywords: calendar, dedicated frames, x-windows
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
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 ;; 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
13 ;; it under the terms of the GNU General Public License as published by
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
15 ;; any later version.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
16
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
17 ;; 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
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; GNU General Public License for more details.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
21
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
24 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
25
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
26 ;;; Commentary:
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
27
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28 ;; This collection of functions implements dedicated frames in x-windows for
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
29 ;; calendar.el.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
30
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
31 ;; Comments, corrections, and improvements should be sent to
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
32 ;; Edward M. Reingold Department of Computer Science
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
33 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
34 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
35 ;; Urbana, Illinois 61801
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
36
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
37 ;;; Code:
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
38
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
39 (defvar calendar-frame nil "Frame in which to display the calendar.")
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
40
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
41 (defvar diary-frame nil "Frame in which to display the diary.")
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
42
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
43 (defvar diary-frame-parameters
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
44 '((name . "Diary") (height . 10) (width . 80) (unsplittable . t)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
45 (font . "6x13") (auto-lower . t) (auto-raise . t) (minibuffer . nil))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
46 "Parameters of the diary frame, if the diary is in its own frame.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
47 Location and color should be set in .Xdefaults.")
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
48
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
49 (defvar calendar-frame-parameters
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
50 '((name . "Calendar") (minibuffer . nil) (height . 10) (width . 80)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
51 (auto-raise . t) (auto-lower . t) (font . "6x13") (unsplittable . t)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
52 (vertical-scroll-bars . nil))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
53 "Parameters of the calendar frame, if the calendar is in a separate frame.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
54 Location and color should be set in .Xdefaults.")
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
55
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
56 (defvar calendar-and-diary-frame-parameters
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
57 '((name . "Calendar") (height . 28) (width . 80) (minibuffer . nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
58 (font . "6x13") (auto-raise . t) (auto-lower . t))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
59 "Parameters of the frame that displays both the calendar and the diary.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
60 Location and color should be set in .Xdefaults.")
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
61
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
62 (defvar calendar-after-frame-setup-hooks nil
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.
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
64 Can be used to change frame parameters, such as font, color, location, etc.")
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
65
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
66 (defun calendar-one-frame-setup (&optional arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
67 "Start calendar and display it in a dedicated frame together with the diary."
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
68 (if (not window-system)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
69 (calendar-basic-setup arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
70 (if (frame-live-p calendar-frame) (delete-frame calendar-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
71 (if (frame-live-p diary-frame) (delete-frame diary-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
72 (let ((special-display-buffer-names nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
73 (view-diary-entries-initially t))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
74 (save-window-excursion
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
75 (save-excursion
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
76 (setq calendar-frame
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
77 (make-frame calendar-and-diary-frame-parameters))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
78 (run-hooks 'calendar-after-frame-setup-hooks)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
79 (select-frame calendar-frame)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
80 (if (eq 'icon (cdr (assoc 'visibility
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
81 (frame-parameters calendar-frame))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
82 (iconify-or-deiconify-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
83 (calendar-basic-setup arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
84 (set-window-dedicated-p (selected-window) 'calendar)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
85 (set-window-dedicated-p
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
94 (defun calendar-two-frame-setup (&optional arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
95 "Start calendar and diary in separate, dedicated frames."
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
96 (if (not window-system)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
97 (calendar-basic-setup arg)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
98 (if (frame-live-p calendar-frame) (delete-frame calendar-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
99 (if (frame-live-p diary-frame) (delete-frame diary-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
100 (let ((pop-up-windows nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
101 (view-diary-entries-initially nil)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
102 (special-display-buffer-names nil))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
103 (save-window-excursion
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
104 (save-excursion (calendar-basic-setup arg))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
105 (setq calendar-frame (make-frame calendar-frame-parameters))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
106 (run-hooks 'calendar-after-frame-setup-hooks)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
107 (select-frame calendar-frame)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
108 (if (eq 'icon (cdr (assoc 'visibility
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
109 (frame-parameters calendar-frame))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
110 (iconify-or-deiconify-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
111 (display-buffer calendar-buffer)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
112 (set-window-dedicated-p (selected-window) 'calendar)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
113 (setq diary-frame (make-frame diary-frame-parameters))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
114 (run-hooks 'calendar-after-frame-setup-hooks)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
115 (select-frame diary-frame)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
116 (if (eq 'icon (cdr (assoc 'visibility
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
117 (frame-parameters diary-frame))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
118 (iconify-or-deiconify-frame))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
119 (save-excursion (diary))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
120 (set-window-dedicated-p
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
127 'diary)))))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
128
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
129 (setq special-display-buffer-names
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
130 (append special-display-buffer-names
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
131 (list "*Yahrzeits*" lunar-phases-buffer holiday-buffer
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
132 fancy-diary-buffer (get-file-buffer diary-file)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
133 calendar-buffer)))
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
134
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
135 (run-hooks 'cal-x-load-hook)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
136
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
137 (provide 'cal-x)
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
138
283559c9d0ad Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
139 ;;; cal-x.el ends here