Mercurial > hg > xemacs-beta
comparison lisp/vm/vm-window.el @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 05472e90ae02 |
children | c0c698873ce1 |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
1 ;;; Window management code for VM | 1 ;;; Window management code for VM |
2 ;;; Copyright (C) 1989-1997 Kyle E. Jones | 2 ;;; Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995 Kyle E. Jones |
3 ;;; | 3 ;;; |
4 ;;; This program is free software; you can redistribute it and/or modify | 4 ;;; This program is free software; you can redistribute it and/or modify |
5 ;;; it under the terms of the GNU General Public License as published by | 5 ;;; it under the terms of the GNU General Public License as published by |
6 ;;; the Free Software Foundation; either version 1, or (at your option) | 6 ;;; the Free Software Foundation; either version 1, or (at your option) |
7 ;;; any later version. | 7 ;;; any later version. |
15 ;;; along with this program; if not, write to the Free Software | 15 ;;; along with this program; if not, write to the Free Software |
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
18 (provide 'vm-window) | 18 (provide 'vm-window) |
19 | 19 |
20 (defun vm-display (buffer display commands configs | 20 (defun vm-display (buffer display commands configs) |
21 &optional do-not-raise) | |
22 ;; the clearinghouse VM display function. | 21 ;; the clearinghouse VM display function. |
23 ;; | 22 ;; |
24 ;; First arg BUFFER non-nil is a buffer to display or undisplay. | 23 ;; First arg BUFFER non-nil is a buffer to display or undisplay. |
25 ;; nil means there is no request to display or undisplay a | 24 ;; nil means there is no request to display or undisplay a |
26 ;; buffer. | 25 ;; buffer. |
61 ;; | 60 ;; |
62 ;; If display/undisplay is not requested, only window | 61 ;; If display/undisplay is not requested, only window |
63 ;; configuration is done, and only then if the value of | 62 ;; configuration is done, and only then if the value of |
64 ;; this-command is found in the COMMANDS list. | 63 ;; this-command is found in the COMMANDS list. |
65 (vm-save-buffer-excursion | 64 (vm-save-buffer-excursion |
66 (let* ((w (and buffer (vm-get-buffer-window buffer))) | 65 (let ((w (and buffer (vm-get-buffer-window buffer)))) |
67 (wf (and w (vm-window-frame w)))) | |
68 (and buffer (set-buffer buffer)) | 66 (and buffer (set-buffer buffer)) |
69 (if (and w display (not do-not-raise)) | 67 ; (and w display (vm-raise-frame (vm-window-frame w))) |
70 (vm-raise-frame wf)) | 68 (and w display (vm-window-frame w)) |
71 (if (and w display (not (eq (vm-selected-frame) wf))) | 69 (and w display (not (eq (vm-selected-frame) (vm-window-frame w))) |
72 (vm-select-frame wf)) | 70 (vm-select-frame (vm-window-frame w))) |
73 (cond ((and buffer display) | 71 (cond ((and buffer display) |
74 (if (and vm-display-buffer-hook | 72 (if (and vm-display-buffer-hook |
75 (null (vm-get-visible-buffer-window buffer))) | 73 (null (vm-get-visible-buffer-window buffer))) |
76 (progn (run-hooks 'vm-display-buffer-hook) | 74 (progn (run-hooks 'vm-display-buffer-hook) |
77 (switch-to-buffer buffer)) | 75 (switch-to-buffer buffer) |
76 (vm-record-current-window-configuration nil)) | |
78 (if (not (and (memq this-command commands) | 77 (if (not (and (memq this-command commands) |
79 (apply 'vm-set-window-configuration configs) | 78 (apply 'vm-set-window-configuration configs) |
80 (vm-get-visible-buffer-window buffer))) | 79 (vm-get-visible-buffer-window buffer))) |
81 (vm-display-buffer buffer)))) | 80 (vm-display-buffer buffer)))) |
82 ((and buffer (not display)) | 81 ((and buffer (not display)) |
83 (if (and vm-undisplay-buffer-hook | 82 (if (and vm-undisplay-buffer-hook |
84 (vm-get-visible-buffer-window buffer)) | 83 (vm-get-visible-buffer-window buffer)) |
85 (progn (set-buffer buffer) | 84 (progn (run-hooks 'vm-undisplay-buffer-hook) |
86 (run-hooks 'vm-undisplay-buffer-hook)) | 85 (vm-record-current-window-configuration nil)) |
87 (if (not (and (memq this-command commands) | 86 (if (not (and (memq this-command commands) |
88 (apply 'vm-set-window-configuration configs))) | 87 (apply 'vm-set-window-configuration configs))) |
89 (vm-undisplay-buffer buffer)))) | 88 (vm-undisplay-buffer buffer)))) |
90 ((memq this-command commands) | 89 ((memq this-command commands) |
91 (apply 'vm-set-window-configuration configs)))))) | 90 (apply 'vm-set-window-configuration configs)))))) |
92 | 91 |
93 (defun vm-display-buffer (buffer) | 92 (defun vm-display-buffer (buffer) |
94 (let ((pop-up-windows (eq vm-mutable-windows t)) | 93 (let ((pop-up-windows (eq vm-mutable-windows t)) |
95 (pop-up-frames (and pop-up-frames vm-mutable-frames))) | 94 (pop-up-frames vm-mutable-frames)) |
95 (vm-record-current-window-configuration nil) | |
96 (if (or pop-up-frames | 96 (if (or pop-up-frames |
97 (and (eq vm-mutable-windows t) | 97 (and (eq vm-mutable-windows t) |
98 (symbolp | 98 (symbolp |
99 (vm-buffer-to-label | 99 (vm-buffer-to-label |
100 (window-buffer | 100 (window-buffer |
102 (select-window (display-buffer buffer)) | 102 (select-window (display-buffer buffer)) |
103 (switch-to-buffer buffer)))) | 103 (switch-to-buffer buffer)))) |
104 | 104 |
105 (defun vm-undisplay-buffer (buffer) | 105 (defun vm-undisplay-buffer (buffer) |
106 (vm-save-buffer-excursion | 106 (vm-save-buffer-excursion |
107 (let ((vm-mutable-frames (and vm-mutable-frames pop-up-frames))) | 107 (vm-delete-windows-or-frames-on buffer) |
108 (vm-maybe-delete-windows-or-frames-on buffer)) | 108 (let ((w (vm-get-buffer-window buffer))) |
109 (let (w) | 109 (and w (set-window-buffer w (other-buffer)))))) |
110 (while (setq w (vm-get-buffer-window buffer)) | |
111 (set-window-buffer w (other-buffer buffer)))))) | |
112 | 110 |
113 (defun vm-load-window-configurations (file) | 111 (defun vm-load-window-configurations (file) |
114 (save-excursion | 112 (save-excursion |
115 (let ((work-buffer nil)) | 113 (let ((work-buffer nil)) |
116 (unwind-protect | 114 (unwind-protect |
129 (save-excursion | 127 (save-excursion |
130 (let ((work-buffer nil)) | 128 (let ((work-buffer nil)) |
131 (unwind-protect | 129 (unwind-protect |
132 (progn | 130 (progn |
133 (set-buffer (setq work-buffer (get-buffer-create "*vm-wconfig*"))) | 131 (set-buffer (setq work-buffer (get-buffer-create "*vm-wconfig*"))) |
134 ;; for XEmacs/MULE | |
135 (and vm-xemacs-mule-p | |
136 (set-buffer-file-coding-system 'no-conversion)) | |
137 (erase-buffer) | 132 (erase-buffer) |
138 (print vm-window-configurations (current-buffer)) | 133 (print vm-window-configurations (current-buffer)) |
139 (write-region (point-min) (point-max) file nil 0)) | 134 (write-region (point-min) (point-max) file nil 0)) |
140 (and work-buffer (kill-buffer work-buffer)))))) | 135 (and work-buffer (kill-buffer work-buffer)))))) |
141 | 136 |
159 (throw 'done nil) | 154 (throw 'done nil) |
160 (setq summary (current-buffer)) | 155 (setq summary (current-buffer)) |
161 (setq message vm-mail-buffer))) | 156 (setq message vm-mail-buffer))) |
162 ((eq major-mode 'vm-mode) | 157 ((eq major-mode 'vm-mode) |
163 (setq message (current-buffer))) | 158 (setq message (current-buffer))) |
164 ((eq major-mode 'vm-presentation-mode) | |
165 (setq message vm-mail-buffer)) | |
166 ((eq major-mode 'vm-virtual-mode) | 159 ((eq major-mode 'vm-virtual-mode) |
167 (setq message (current-buffer))) | 160 (setq message (current-buffer))) |
168 ((eq major-mode 'mail-mode) | 161 ((eq major-mode 'mail-mode) |
169 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer))) | 162 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer))) |
170 (throw 'done nil) | 163 (throw 'done nil) |
171 (setq message vm-mail-buffer | 164 (setq message vm-mail-buffer))) |
172 ;; assume that the proximity implies affinity | |
173 composition (current-buffer)))) | |
174 ((eq vm-system-state 'editing) | 165 ((eq vm-system-state 'editing) |
175 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer))) | 166 (if (or (null vm-mail-buffer) (null (buffer-name vm-mail-buffer))) |
176 (throw 'done nil) | 167 (throw 'done nil) |
177 (setq edit (current-buffer)) | 168 (setq edit (current-buffer)) |
178 (setq message vm-mail-buffer))) | 169 (setq message vm-mail-buffer))) |
179 ;; not in a VM related buffer, bail... | 170 ;; not in a VM related buffer, bail... |
180 (t (throw 'done nil))) | 171 (t (throw 'done nil))) |
181 (set-buffer message) | 172 (set-buffer message) |
182 (vm-check-for-killed-presentation) | 173 ;; if this configuration is already the current one, don't |
183 (if vm-presentation-buffer | 174 ;; set it up again. |
184 (setq message vm-presentation-buffer)) | 175 (if (or (and vm-mutable-frames (eq (car config) vm-window-configuration)) |
176 (and (not vm-mutable-frames) | |
177 (listp vm-window-configuration) | |
178 (eq (car config) | |
179 (cdr (assq selected-frame vm-window-configuration))))) | |
180 (throw 'done nil)) | |
185 (vm-check-for-killed-summary) | 181 (vm-check-for-killed-summary) |
186 (or summary (setq summary (or vm-summary-buffer nonexistent-summary))) | 182 (or summary (setq summary (or vm-summary-buffer nonexistent-summary))) |
187 (or composition (setq composition nonexistent)) | 183 (or composition (setq composition nonexistent)) |
188 (or edit (setq edit nonexistent)) | 184 (or edit (setq edit nonexistent)) |
189 (tapestry-replace-tapestry-element (nth 1 config) 'buffer-name | 185 (tapestry-replace-tapestry-element (nth 1 config) 'buffer-name |
192 (if (symbolp x) | 188 (if (symbolp x) |
193 (symbol-value x) | 189 (symbol-value x) |
194 x )))) | 190 x )))) |
195 (set-tapestry (nth 1 config) 1) | 191 (set-tapestry (nth 1 config) 1) |
196 (and (get-buffer nonexistent) | 192 (and (get-buffer nonexistent) |
197 (vm-maybe-delete-windows-or-frames-on nonexistent)) | 193 (vm-delete-windows-or-frames-on nonexistent)) |
198 (if (and (vm-get-buffer-window nonexistent-summary) | 194 (if (and (vm-get-buffer-window nonexistent-summary) |
199 (not (vm-get-buffer-window message))) | 195 (not (vm-get-buffer-window message))) |
200 ;; user asked for summary to be displayed but doesn't | 196 ;; user asked for summary to be displayed but doesn't |
201 ;; have one, nor is the folder buffer displayed. Help | 197 ;; have one, nor is the folder buffer displayed. Help |
202 ;; the user not to lose here. | 198 ;; the user not to lose here. |
203 (vm-replace-buffer-in-windows nonexistent-summary message) | 199 (vm-replace-buffer-in-windows nonexistent-summary message) |
204 (and (get-buffer nonexistent-summary) | 200 (and (get-buffer nonexistent-summary) |
205 (vm-maybe-delete-windows-or-frames-on nonexistent-summary))) | 201 (vm-delete-windows-or-frames-on nonexistent-summary))) |
202 (vm-record-current-window-configuration config) | |
206 config ))) | 203 config ))) |
204 | |
205 (defun vm-record-current-window-configuration (config) | |
206 ;; this function continues to be a no-op. | |
207 ;; | |
208 ;; the idea behind this function is that VM can remember what | |
209 ;; the current window configuration is and not rebuild the | |
210 ;; configuration for the next command if it matches what we | |
211 ;; have recorded. | |
212 ;; | |
213 ;; the problem with this idea is that the user can do things | |
214 ;; like C-x 0 and VM has no way of knowing. So VM thinks the | |
215 ;; right configuration is displayed when in fact it is not, | |
216 ;; which can cause incorrect displays. | |
217 '(let (cell) | |
218 (if (and (listp vm-window-configuration) | |
219 (setq cell (assq (vm-selected-frame) vm-window-configuration))) | |
220 (setcdr cell (car config)) | |
221 (setq vm-window-configuration | |
222 (cons | |
223 (cons (vm-selected-frame) (car config)) | |
224 vm-window-configuration))))) | |
207 | 225 |
208 (defun vm-save-window-configuration (tag) | 226 (defun vm-save-window-configuration (tag) |
209 "Name and save the current window configuration. | 227 "Name and save the current window configuration. |
210 With this command you associate the current window setup with an | 228 With this command you associate the current window setup with an |
211 action. Each time you perform this action VM will duplicate this | 229 action. Each time you perform this action VM will duplicate this |
220 specific configurations are searched for first, then the category | 238 specific configurations are searched for first, then the category |
221 configurations and then the default configuration. The first | 239 configurations and then the default configuration. The first |
222 configuration found is the one that is applied. | 240 configuration found is the one that is applied. |
223 | 241 |
224 The value of vm-mutable-windows must be non-nil for VM to use | 242 The value of vm-mutable-windows must be non-nil for VM to use |
225 window configurations." | 243 window configurations. |
244 | |
245 If vm-mutable-frames is non-nil and Emacs is running under X | |
246 windows, then VM will use all existing frames. Otherwise VM will | |
247 restrict its changes to the frame in which it was started." | |
226 (interactive | 248 (interactive |
227 (let ((last-command last-command) | 249 (let ((last-command last-command) |
228 (this-command this-command)) | 250 (this-command this-command)) |
229 (if (null vm-window-configuration-file) | 251 (if (null vm-window-configuration-file) |
230 (error "Configurable windows not enabled. Set vm-window-configuration-file to enable.")) | 252 (error "Configurable windows not enabled. Set vm-window-configuration-file to enable.")) |
329 (vm-iconify-frame-xxx)))) | 351 (vm-iconify-frame-xxx)))) |
330 | 352 |
331 (defun vm-window-loop (action obj-1 &optional obj-2) | 353 (defun vm-window-loop (action obj-1 &optional obj-2) |
332 (let ((delete-me nil) | 354 (let ((delete-me nil) |
333 (done nil) | 355 (done nil) |
334 (all-frames (if vm-search-other-frames t nil)) | 356 (all-frames (if vm-mutable-frames t nil)) |
335 start w) | 357 start w) |
336 (setq start (next-window (selected-window) 'nomini all-frames) | 358 (setq start (next-window (selected-window) 'nomini all-frames) |
337 w start) | 359 w start) |
338 (and obj-1 (setq obj-1 (get-buffer obj-1))) | 360 (and obj-1 (setq obj-1 (get-buffer obj-1))) |
339 (while (not done) | 361 (while (not done) |
372 (while (not done) | 394 (while (not done) |
373 (if delete-me | 395 (if delete-me |
374 (progn | 396 (progn |
375 (condition-case nil | 397 (condition-case nil |
376 (progn | 398 (progn |
377 (if (vm-created-this-frame-p delete-me) | 399 (vm-delete-frame delete-me) |
378 (vm-delete-frame delete-me)) | |
379 (if (eq delete-me start) | 400 (if (eq delete-me start) |
380 (setq start nil))) | 401 (setq start nil))) |
381 (error nil)) | 402 (error nil)) |
382 (setq delete-me nil))) | 403 (setq delete-me nil))) |
383 (cond ((and (eq action 'delete) | 404 (cond ((and (eq action 'delete) |
403 (if delete-me | 424 (if delete-me |
404 (progn | 425 (progn |
405 (vm-error-free-call 'vm-delete-frame delete-me) | 426 (vm-error-free-call 'vm-delete-frame delete-me) |
406 (setq delete-me nil)))))) | 427 (setq delete-me nil)))))) |
407 | 428 |
408 (defun vm-maybe-delete-windows-or-frames-on (buffer) | 429 (defun vm-delete-windows-or-frames-on (buffer) |
409 (and (eq vm-mutable-windows t) (vm-window-loop 'delete buffer)) | 430 (and (eq vm-mutable-windows t) (vm-window-loop 'delete buffer)) |
410 (and vm-mutable-frames (vm-frame-loop 'delete buffer))) | 431 (and vm-mutable-frames (vm-frame-loop 'delete buffer))) |
411 | 432 |
412 (defun vm-replace-buffer-in-windows (old new) | 433 (defun vm-replace-buffer-in-windows (old new) |
413 (vm-window-loop 'replace old new)) | 434 (vm-window-loop 'replace old new)) |
414 | 435 |
415 (defun vm-bury-buffer (&optional buffer) | 436 (defun vm-bury-buffer (&optional buffer) |
416 (or buffer (setq buffer (current-buffer))) | 437 (or buffer (setq buffer (current-buffer))) |
417 (if vm-xemacs-p | 438 (if (vm-xemacs-p) |
418 (if (vm-multiple-frames-possible-p) | 439 (if (vm-multiple-frames-possible-p) |
419 (vm-frame-loop 'bury buffer) | 440 (vm-frame-loop 'bury buffer) |
420 (bury-buffer buffer)) | 441 (bury-buffer buffer)) |
421 (bury-buffer buffer))) | 442 (bury-buffer buffer))) |
422 | 443 |
451 (wrong-number-of-arguments | 472 (wrong-number-of-arguments |
452 (get-buffer-window buffer)))))) | 473 (get-buffer-window buffer)))))) |
453 | 474 |
454 (defun vm-set-hooks-for-frame-deletion () | 475 (defun vm-set-hooks-for-frame-deletion () |
455 (make-local-variable 'vm-undisplay-buffer-hook) | 476 (make-local-variable 'vm-undisplay-buffer-hook) |
477 (make-local-variable 'kill-buffer-hook) | |
456 (add-hook 'vm-undisplay-buffer-hook 'vm-delete-buffer-frame) | 478 (add-hook 'vm-undisplay-buffer-hook 'vm-delete-buffer-frame) |
457 (add-hook 'kill-buffer-hook 'vm-delete-buffer-frame)) | 479 (add-hook 'kill-buffer-hook 'vm-delete-buffer-frame)) |
458 | 480 |
459 (defun vm-created-this-frame-p (&optional frame) | |
460 (memq (or frame (vm-selected-frame)) vm-frame-list)) | |
461 | |
462 (defun vm-delete-buffer-frame () | 481 (defun vm-delete-buffer-frame () |
463 ;; kludge. we only want to this to run on VM related buffers | 482 (save-excursion |
464 ;; but this function is generally on a global hook. Check for | 483 (let ((w (vm-get-visible-buffer-window (current-buffer))) |
465 ;; vm-undisplay-buffer-hook set; this is a good sign that this | 484 (b (current-buffer))) |
466 ;; is a VM buffer. | 485 (and w (eq (vm-selected-frame) (vm-window-frame w)) |
467 (if vm-undisplay-buffer-hook | 486 (vm-error-free-call 'vm-delete-frame (vm-window-frame w))) |
468 (save-excursion | 487 (and w (let ((vm-mutable-frames t)) |
469 ;; run once only per buffer. | 488 (vm-delete-windows-or-frames-on b))))) |
470 (remove-hook 'vm-undisplay-buffer-hook 'vm-delete-buffer-frame) | 489 ;; do it only once |
471 (let* ((w (vm-get-visible-buffer-window (current-buffer))) | 490 (remove-hook 'vm-undisplay-buffer-hook 'vm-delete-buffer-frame) |
472 (b (current-buffer)) | 491 (remove-hook 'kill-buffer-hook 'vm-delete-buffer-frame)) |
473 (wf (and w (vm-window-frame w)))) | |
474 (and w (eq (vm-selected-frame) wf) (vm-created-this-frame-p wf) | |
475 (vm-error-free-call 'vm-delete-frame wf)) | |
476 (and w (let ((vm-mutable-frames t)) | |
477 (vm-maybe-delete-windows-or-frames-on b))))))) | |
478 | |
479 (defun vm-register-frame (frame) | |
480 (setq vm-frame-list (cons frame vm-frame-list))) | |
481 | 492 |
482 (defun vm-goto-new-frame (&rest types) | 493 (defun vm-goto-new-frame (&rest types) |
483 (let ((params nil)) | 494 (let ((params nil)) |
484 (while (and types (null params)) | 495 (while (and types (null params)) |
485 (setq params (car (cdr (assq (car types) vm-frame-parameter-alist))) | 496 (setq params (car (cdr (assq (car types) vm-frame-parameter-alist))) |
491 (select-frame (make-frame params))) | 502 (select-frame (make-frame params))) |
492 ((fboundp 'make-screen) | 503 ((fboundp 'make-screen) |
493 (select-screen (make-screen params))) | 504 (select-screen (make-screen params))) |
494 ((fboundp 'new-screen) | 505 ((fboundp 'new-screen) |
495 (select-screen (new-screen params)))) | 506 (select-screen (new-screen params)))) |
496 (vm-register-frame (vm-selected-frame)) | |
497 (and vm-warp-mouse-to-new-frame | 507 (and vm-warp-mouse-to-new-frame |
498 (vm-warp-mouse-to-frame-maybe (vm-selected-frame))))) | 508 (vm-warp-mouse-to-frame-maybe (vm-selected-frame))))) |
499 | 509 |
500 (defun vm-goto-new-summary-frame-maybe () | |
501 (if (and vm-mutable-frames vm-frame-per-summary | |
502 (vm-multiple-frames-possible-p)) | |
503 (let ((w (vm-get-buffer-window vm-summary-buffer))) | |
504 (if (null w) | |
505 (progn | |
506 (vm-goto-new-frame 'summary) | |
507 (vm-set-hooks-for-frame-deletion)) | |
508 (save-excursion | |
509 (select-window w) | |
510 (and vm-warp-mouse-to-new-frame | |
511 (vm-warp-mouse-to-frame-maybe (vm-window-frame w)))))))) | |
512 | |
513 (defun vm-goto-new-folder-frame-maybe (&rest types) | |
514 (if (and vm-mutable-frames vm-frame-per-folder | |
515 (vm-multiple-frames-possible-p)) | |
516 (let ((w (or (vm-get-buffer-window (current-buffer)) | |
517 ;; summary == folder for the purpose | |
518 ;; of frame reuse. | |
519 (and vm-summary-buffer | |
520 (vm-get-buffer-window vm-summary-buffer)) | |
521 ;; presentation == folder for the purpose | |
522 ;; of frame reuse. | |
523 (and vm-presentation-buffer | |
524 (vm-get-buffer-window vm-presentation-buffer))))) | |
525 (if (null w) | |
526 (progn | |
527 (apply 'vm-goto-new-frame types) | |
528 (vm-set-hooks-for-frame-deletion)) | |
529 (save-excursion | |
530 (select-window w) | |
531 (and vm-warp-mouse-to-new-frame | |
532 (vm-warp-mouse-to-frame-maybe (vm-window-frame w)))))))) | |
533 | |
534 (defun vm-warp-mouse-to-frame-maybe (&optional frame) | 510 (defun vm-warp-mouse-to-frame-maybe (&optional frame) |
535 (or frame (setq frame (vm-selected-frame))) | 511 (or frame (setq frame (vm-selected-frame))) |
536 (if (vm-mouse-support-possible-here-p) | 512 (if (vm-mouse-support-possible-p) |
537 (cond ((vm-mouse-xemacs-mouse-p) | 513 (cond ((vm-mouse-xemacs-mouse-p) |
538 (cond ((fboundp 'mouse-position);; XEmacs 19.12 | 514 (cond ((fboundp 'mouse-position);; XEmacs 19.12 |
539 (let ((mp (mouse-position))) | 515 (let ((mp (mouse-position))) |
540 (if (and (car mp) | 516 (if (and (car mp) |
541 (eq (window-frame (car mp)) (selected-frame))) | 517 (eq (window-frame (car mp)) (selected-frame))) |
600 (symbol-function | 576 (symbol-function |
601 (cond ((fboundp 'frame-visible-p) 'frame-visible-p) | 577 (cond ((fboundp 'frame-visible-p) 'frame-visible-p) |
602 ((fboundp 'screen-visible-p) 'screen-visible-p) | 578 ((fboundp 'screen-visible-p) 'screen-visible-p) |
603 (t 'ignore)))) | 579 (t 'ignore)))) |
604 | 580 |
605 (if (fboundp 'frame-iconified-p) | |
606 (fset 'vm-frame-iconified-p 'frame-iconified-p) | |
607 (defun vm-frame-iconified-p (&optional frame) | |
608 (eq (vm-frame-visible-p frame) 'icon))) | |
609 | |
610 ;; frame-totally-visible-p is broken under XEmacs 19.14 and is | |
611 ;; absent under Emacs 19.34. So vm-frame-per-summary won't work | |
612 ;; quite right under these Emacs versions. XEmacs 19.15 should | |
613 ;; have a working version of this function. | |
614 ;; 2 April 1997, frame-totally-visible-p apparently still broken | |
615 ;; under 19.15. I give up for now. | |
616 ;;(if (and (fboundp 'frame-totally-visible-p) | |
617 ;; vm-xemacs-p | |
618 ;; (or (>= emacs-major-version 20) | |
619 ;; (>= emacs-minor-version 15))) | |
620 ;; (fset 'vm-frame-totally-visible-p 'frame-totally-visible-p) | |
621 ;; (fset 'vm-frame-totally-visible-p 'vm-frame-visible-p)) | |
622 (fset 'vm-frame-totally-visible-p 'vm-frame-visible-p) | |
623 | |
624 (fset 'vm-window-frame | 581 (fset 'vm-window-frame |
625 (symbol-function | 582 (symbol-function |
626 (cond ((fboundp 'window-frame) 'window-frame) | 583 (cond ((fboundp 'window-frame) 'window-frame) |
627 ((fboundp 'window-screen) 'window-screen) | 584 ((fboundp 'window-screen) 'window-screen) |
628 (t 'ignore)))) | 585 (t 'ignore)))) |