annotate lisp/vm/vm-window.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 49a24b4fd526
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Window management code for VM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995 Kyle E. Jones
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; the Free Software Foundation; either version 1, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (provide 'vm-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 (defun vm-display (buffer display commands configs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; the clearinghouse VM display function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; First arg BUFFER non-nil is a buffer to display or undisplay.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; nil means there is no request to display or undisplay a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; Second arg DISPLAY non-nil means to display the buffer, nil means
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; to undisplay it. This function guarantees to display the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; buffer if requested. Undisplay is not guaranteed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; Third arg COMMANDS is a list of symbols. this-command must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; match one of these symbols for a window configuration to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; applied.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; Fourth arg CONFIGS is a list of window configurations to try.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; vm-set-window-configuration will step through the list looking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; for an existing configuration, and apply the one it finds.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; Display is done this way:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; 1. if the buffer is visible in an invisible frame, make that frame visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; 2. if the buffer is already displayed, quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; 3. if vm-display-buffer-hook in non-nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; run the hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; use the selected window/frame to display the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; 4. apply a window configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; if the buffer is displayed now, quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; 5. call vm-display-buffer which will display the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; Undisplay is done this way:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; 1. if the buffer is not displayed, quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;; 2. if vm-undisplay-buffer-hook is non-nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; run the hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;; 3. apply a window configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; 4, if a window configuration was applied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; quit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; 5. call vm-undisplay-buffer which will make the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;; disappear from at least one window/frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; If display/undisplay is not requested, only window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; configuration is done, and only then if the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; this-command is found in the COMMANDS list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (vm-save-buffer-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (let ((w (and buffer (vm-get-buffer-window buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (and buffer (set-buffer buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ; (and w display (vm-raise-frame (vm-window-frame w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (and w display (vm-window-frame w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (and w display (not (eq (vm-selected-frame) (vm-window-frame w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (vm-select-frame (vm-window-frame w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (cond ((and buffer display)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (if (and vm-display-buffer-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (null (vm-get-visible-buffer-window buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (progn (run-hooks 'vm-display-buffer-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (switch-to-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (vm-record-current-window-configuration nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (if (not (and (memq this-command commands)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (apply 'vm-set-window-configuration configs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (vm-get-visible-buffer-window buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (vm-display-buffer buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ((and buffer (not display))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (if (and vm-undisplay-buffer-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (vm-get-visible-buffer-window buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (progn (run-hooks 'vm-undisplay-buffer-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (vm-record-current-window-configuration nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (if (not (and (memq this-command commands)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (apply 'vm-set-window-configuration configs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (vm-undisplay-buffer buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ((memq this-command commands)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (apply 'vm-set-window-configuration configs))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (defun vm-display-buffer (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (let ((pop-up-windows (eq vm-mutable-windows t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (pop-up-frames vm-mutable-frames))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (vm-record-current-window-configuration nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (if (or pop-up-frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (and (eq vm-mutable-windows t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (symbolp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (vm-buffer-to-label
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (window-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (selected-window))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (select-window (display-buffer buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (switch-to-buffer buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defun vm-undisplay-buffer (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (vm-save-buffer-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (vm-delete-windows-or-frames-on buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (let ((w (vm-get-buffer-window buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (and w (set-window-buffer w (other-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defun vm-load-window-configurations (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (let ((work-buffer nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (set-buffer (setq work-buffer (get-buffer-create "*vm-wconfig*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (setq vm-window-configurations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (insert-file-contents file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (read (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (error nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (and work-buffer (kill-buffer work-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (defun vm-store-window-configurations (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (let ((work-buffer nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (set-buffer (setq work-buffer (get-buffer-create "*vm-wconfig*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (print vm-window-configurations (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (write-region (point-min) (point-max) file nil 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (and work-buffer (kill-buffer work-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defun vm-set-window-configuration (&rest tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (catch 'done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (if (not vm-mutable-windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (throw 'done nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (let ((nonexistent " *vm-nonexistent*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (nonexistent-summary " *vm-nonexistent-summary*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (selected-frame (vm-selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 summary message composition edit config)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (while (and tags (null config))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (setq config (assq (car tags) vm-window-configurations)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 tags (cdr tags)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (or config (setq config (assq 'default vm-window-configurations)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (or config (throw 'done nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (setq config (vm-copy config))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (setq composition (vm-find-composition-buffer t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (cond ((eq major-mode 'vm-summary-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (throw 'done nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (setq summary (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (setq message vm-mail-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ((eq major-mode 'vm-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (setq message (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ((eq major-mode 'vm-virtual-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (setq message (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ((eq major-mode 'mail-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (throw 'done nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (setq message vm-mail-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ((eq vm-system-state 'editing)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (throw 'done nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (setq edit (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (setq message vm-mail-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ;; not in a VM related buffer, bail...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (t (throw 'done nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (set-buffer message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ;; if this configuration is already the current one, don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ;; set it up again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (if (or (and vm-mutable-frames (eq (car config) vm-window-configuration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (and (not vm-mutable-frames)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (listp vm-window-configuration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (eq (car config)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (cdr (assq selected-frame vm-window-configuration)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (throw 'done nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (or summary (setq summary (or vm-summary-buffer nonexistent-summary)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (or composition (setq composition nonexistent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (or edit (setq edit nonexistent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (tapestry-replace-tapestry-element (nth 1 config) 'buffer-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (if (symbolp x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (symbol-value x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 x ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (set-tapestry (nth 1 config) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (and (get-buffer nonexistent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (vm-delete-windows-or-frames-on nonexistent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (if (and (vm-get-buffer-window nonexistent-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (not (vm-get-buffer-window message)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ;; user asked for summary to be displayed but doesn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;; have one, nor is the folder buffer displayed. Help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ;; the user not to lose here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (vm-replace-buffer-in-windows nonexistent-summary message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (and (get-buffer nonexistent-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (vm-delete-windows-or-frames-on nonexistent-summary)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (vm-record-current-window-configuration config)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 config )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defun vm-record-current-window-configuration (config)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;; this function continues to be a no-op.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ;; the idea behind this function is that VM can remember what
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ;; the current window configuration is and not rebuild the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ;; configuration for the next command if it matches what we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ;; have recorded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ;; the problem with this idea is that the user can do things
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ;; like C-x 0 and VM has no way of knowing. So VM thinks the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ;; right configuration is displayed when in fact it is not,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;; which can cause incorrect displays.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 '(let (cell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (if (and (listp vm-window-configuration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (setq cell (assq (vm-selected-frame) vm-window-configuration)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (setcdr cell (car config))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (setq vm-window-configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (cons (vm-selected-frame) (car config))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 vm-window-configuration)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (defun vm-save-window-configuration (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 "Name and save the current window configuration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 With this command you associate the current window setup with an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 action. Each time you perform this action VM will duplicate this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 window setup.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 Nearly every VM command can have a window configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 associated with it. VM also allows some category configurations,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 `startup', `reading-message', `composing-message', `editing-message',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 `marking-message' and `searching-message' for the commands that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 do these things. There is also a `default' configuration that VM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 will use if no other configuration is applicable. Command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 specific configurations are searched for first, then the category
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 configurations and then the default configuration. The first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 configuration found is the one that is applied.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 The value of vm-mutable-windows must be non-nil for VM to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 window configurations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 If vm-mutable-frames is non-nil and Emacs is running under X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 windows, then VM will use all existing frames. Otherwise VM will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 restrict its changes to the frame in which it was started."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (let ((last-command last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (this-command this-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (if (null vm-window-configuration-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (error "Configurable windows not enabled. Set vm-window-configuration-file to enable."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (intern
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (completing-read "Name this window configuration: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 vm-supported-window-configurations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 'identity t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (if (null vm-window-configuration-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (error "Configurable windows not enabled. Set vm-window-configuration-file to enable."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (let (map p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (setq map (tapestry (list (vm-selected-frame))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; set frame map to nil since we don't use it. this prevents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; cursor objects and any other objects that have an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; "unreadable" read syntax appearing in the window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;; configuration file by way of frame-parameters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (setcar map nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (tapestry-replace-tapestry-element map 'buffer-name 'vm-buffer-to-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (tapestry-nullify-tapestry-elements map t nil t t t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (setq p (assq tag vm-window-configurations))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (if p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (setcar (cdr p) map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (setq vm-window-configurations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (cons (list tag map) vm-window-configurations)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (vm-store-window-configurations vm-window-configuration-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (message "%s configuration recorded" tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (defun vm-buffer-to-label (buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (cond ((eq major-mode 'vm-summary-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 'summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ((eq major-mode 'mail-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 'composition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ((eq major-mode 'vm-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 'message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ((eq major-mode 'vm-virtual-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 'message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ((eq vm-system-state 'editing)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 'edit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (t buf))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (defun vm-delete-window-configuration (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 "Delete the configuration saved for a particular action.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 This action will no longer have an associated window configuration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 The action will be read from the minibuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (let ((last-command last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (this-command this-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (if (null vm-window-configuration-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (error "Configurable windows not enabled. Set vm-window-configuration-file to enable."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (intern
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (completing-read "Delete window configuration: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (list (symbol-name (car x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 vm-window-configurations)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 'identity t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (if (null vm-window-configuration-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (error "Configurable windows not enabled. Set vm-window-configuration-file to enable."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (let (p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (setq p (assq tag vm-window-configurations))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (if p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (if (eq p (car vm-window-configurations))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (setq vm-window-configurations (cdr vm-window-configurations))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (setq vm-window-configurations (delq p vm-window-configurations)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (error "No window configuration set for %s" tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (vm-store-window-configurations vm-window-configuration-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (message "%s configuration deleted" tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (defun vm-apply-window-configuration (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 "Change the current window configuration to be one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 associated with a particular action. The action will be read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 from the minibuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (let ((last-command last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (this-command this-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (intern
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (completing-read "Apply window configuration: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (list (symbol-name (car x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 vm-window-configurations)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 'identity t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (vm-set-window-configuration tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (defun vm-window-help ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (message "WS = save configuration, WD = delete configuration, WW = apply configuration"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (defun vm-iconify-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 "Iconify the current frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 Run the hooks in vm-iconify-frame-hook before doing so."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (if (vm-multiple-frames-possible-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (run-hooks 'vm-iconify-frame-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (vm-iconify-frame-xxx))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (defun vm-window-loop (action obj-1 &optional obj-2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (let ((delete-me nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (done nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (all-frames (if vm-mutable-frames t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 start w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (setq start (next-window (selected-window) 'nomini all-frames)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 w start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (and obj-1 (setq obj-1 (get-buffer obj-1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (while (not done)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (if (and delete-me (not (eq delete-me (next-window delete-me 'nomini))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (delete-window delete-me)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (if (eq delete-me start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (setq start nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (setq delete-me nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (cond ((and (eq action 'delete) (eq obj-1 (window-buffer w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 ;; a deleted window has no next window, so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 ;; defer the deletion until after we've moved
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 ;; to the next window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (setq delete-me w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ((and (eq action 'replace) (eq obj-1 (window-buffer w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (set-window-buffer w obj-2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (setq done (eq start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (setq w
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (next-window w 'nomini all-frames)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (wrong-number-of-arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (next-window w 'nomini))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (if (null start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (setq start w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (if (and delete-me (not (eq delete-me (next-window delete-me 'nomini))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (delete-window delete-me))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (defun vm-frame-loop (action obj-1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (if (fboundp 'vm-next-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (let ((start (vm-next-frame (vm-selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (delete-me nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (done nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (setq f start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (and obj-1 (setq obj-1 (get-buffer obj-1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (while (not done)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (if delete-me
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (vm-delete-frame delete-me)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (if (eq delete-me start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (setq start nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (setq delete-me nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (cond ((and (eq action 'delete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 ;; one-window-p doesn't take a frame argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (eq (next-window (vm-frame-selected-window f) 'nomini)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (previous-window (vm-frame-selected-window f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 'nomini))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;; the next-window call is to avoid looking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;; at the minibuffer window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (eq obj-1 (window-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (next-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (vm-frame-selected-window f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 'nomini))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 ;; a deleted frame has no next frame, so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 ;; defer the deletion until after we've moved
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ;; to the next frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (setq delete-me f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 ((eq action 'bury)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (bury-buffer obj-1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (setq done (eq start (setq f (vm-next-frame f))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (if (null start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (setq start f)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (if delete-me
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (vm-error-free-call 'vm-delete-frame delete-me)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (setq delete-me nil))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (defun vm-delete-windows-or-frames-on (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (and (eq vm-mutable-windows t) (vm-window-loop 'delete buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (and vm-mutable-frames (vm-frame-loop 'delete buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (defun vm-replace-buffer-in-windows (old new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (vm-window-loop 'replace old new))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (defun vm-bury-buffer (&optional buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (or buffer (setq buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (if (vm-xemacs-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (if (vm-multiple-frames-possible-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (vm-frame-loop 'bury buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (bury-buffer buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (bury-buffer buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (defun vm-unbury-buffer (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (switch-to-buffer buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (defun vm-get-buffer-window (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (or (get-buffer-window buffer nil nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (and vm-search-other-frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (get-buffer-window buffer t t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (wrong-number-of-arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (or (get-buffer-window buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (and vm-search-other-frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (get-buffer-window buffer t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (wrong-number-of-arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (get-buffer-window buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (defun vm-get-visible-buffer-window (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (or (get-buffer-window buffer nil nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (and vm-search-other-frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (get-buffer-window buffer t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (wrong-number-of-arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (or (get-buffer-window buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (and vm-search-other-frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (get-buffer-window buffer 'visible)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (wrong-number-of-arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (get-buffer-window buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (defun vm-set-hooks-for-frame-deletion ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (make-local-variable 'vm-undisplay-buffer-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (make-local-variable 'kill-buffer-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (add-hook 'vm-undisplay-buffer-hook 'vm-delete-buffer-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (add-hook 'kill-buffer-hook 'vm-delete-buffer-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (defun vm-delete-buffer-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (let ((w (vm-get-visible-buffer-window (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (b (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (and w (eq (vm-selected-frame) (vm-window-frame w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (vm-error-free-call 'vm-delete-frame (vm-window-frame w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (and w (let ((vm-mutable-frames t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (vm-delete-windows-or-frames-on b)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 ;; do it only once
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (remove-hook 'vm-undisplay-buffer-hook 'vm-delete-buffer-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (remove-hook 'kill-buffer-hook 'vm-delete-buffer-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (defun vm-goto-new-frame (&rest types)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (let ((params nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (while (and types (null params))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (setq params (car (cdr (assq (car types) vm-frame-parameter-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 types (cdr types)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 ;; these functions might be defined in an Emacs that isn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ;; running under a window system, but VM always checks for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 ;; multi-frame support before calling this function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (cond ((fboundp 'make-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (select-frame (make-frame params)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 ((fboundp 'make-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (select-screen (make-screen params)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 ((fboundp 'new-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (select-screen (new-screen params))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (and vm-warp-mouse-to-new-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (vm-warp-mouse-to-frame-maybe (vm-selected-frame)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (defun vm-warp-mouse-to-frame-maybe (&optional frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (or frame (setq frame (vm-selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (if (vm-mouse-support-possible-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (cond ((vm-mouse-xemacs-mouse-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (cond ((fboundp 'mouse-position);; XEmacs 19.12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (let ((mp (mouse-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (if (and (car mp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (eq (window-frame (car mp)) (selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (set-mouse-position (frame-highest-window frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (/ (frame-width frame) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (/ (frame-height frame) 2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (t ;; XEmacs 19.11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 ;; use (apply 'screen-...) instead of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 ;; (screen-...) to avoid stimulating a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ;; byte-compiler bug in Emacs 19.29 that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 ;; happens when it encounters 'obsolete'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ;; functions. puke, puke, puke.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (let ((mp (read-mouse-position frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (if (and (>= (car mp) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (<= (car mp) (apply 'screen-width frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (>= (cdr mp) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (<= (cdr mp) (apply 'screen-height frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (set-mouse-position frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (/ (apply 'screen-width frame) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (/ (apply 'screen-height frame) 2)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 ((vm-fsfemacs-19-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (let ((mp (mouse-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (if (and (eq (car mp) frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 ;; nil coordinates mean that the mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 ;; pointer isn't really within the frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (car (cdr mp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (set-mouse-position frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (/ (frame-width frame) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (/ (frame-height frame) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 ;; doc for set-mouse-position says to do this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (unfocus-frame)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (fset 'vm-selected-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (symbol-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (cond ((fboundp 'selected-frame) 'selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 ((fboundp 'selected-screen) 'selected-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (t 'ignore))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (fset 'vm-delete-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (symbol-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (cond ((fboundp 'delete-frame) 'delete-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 ((fboundp 'delete-screen) 'delete-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (t 'ignore))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 ;; xxx because vm-iconify-frame is a command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (defun vm-iconify-frame-xxx (&optional frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (cond ((fboundp 'iconify-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (iconify-frame frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 ((fboundp 'iconify-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (iconify-screen (or frame (selected-screen))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (fset 'vm-raise-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (symbol-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (cond ((fboundp 'raise-frame) 'raise-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 ((fboundp 'raise-screen) 'raise-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (t 'ignore))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (fset 'vm-frame-visible-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (symbol-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (cond ((fboundp 'frame-visible-p) 'frame-visible-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 ((fboundp 'screen-visible-p) 'screen-visible-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (t 'ignore))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (fset 'vm-window-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (symbol-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (cond ((fboundp 'window-frame) 'window-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 ((fboundp 'window-screen) 'window-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (t 'ignore))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (cond ((fboundp 'next-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (fset 'vm-next-frame (symbol-function 'next-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (fset 'vm-select-frame (symbol-function 'select-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (fset 'vm-frame-selected-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (symbol-function 'frame-selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 ((fboundp 'next-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (fset 'vm-next-frame (symbol-function 'next-screen))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (fset 'vm-select-frame (symbol-function 'select-screen))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (fset 'vm-frame-selected-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (if (fboundp 'epoch::selected-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (symbol-function 'epoch::selected-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (symbol-function 'screen-selected-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 ;; it is useful for this to be a no-op, but don't bind the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 ;; others.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (fset 'vm-select-frame 'ignore)))