annotate lisp/vm/tapestry.el @ 138:6608ceec7cf8 r20-2b3

Import from CVS: tag r20-2b3
author cvs
date Mon, 13 Aug 2007 09:31:46 +0200
parents 0d2f883870bc
children
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 ;;; Tools to configure your GNU Emacs windows
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2 ;;; Copyright (C) 1991, 1993, 1994, 1995, 1997 Kyle E. Jones
0
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 ;;; A copy of the GNU General Public License can be obtained from this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; program's author (send electronic mail to kyle@uunet.uu.net) or from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; Send bug reports to kyle@uunet.uu.net.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 (provide 'tapestry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
23 (defvar tapestry-version "1.08")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
24
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
25 ;; Pass state information between the tapestry-set-window-map
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
26 ;; and tapestry-set-buffer-map stages. UGH. The reason for this
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
27 ;; is explained in tapestry-set-buffer-map.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
28 (defvar tapestry-windows-changed nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (defun tapestry (&optional frame-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 "Returns a list containing complete information about the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 configuration of Emacs frames, windows, buffers and cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 positions. Call the function set-tapestry with the list that this function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 returns to restore the configuration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 Optional first arg FRAME-LIST should be a list of frames; only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 configuration information about these frames will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 The configuration information is returned in a form that can be saved and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 restored across multiple Emacs sessions."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (let ((frames (or frame-list (tapestry-frame-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (frame-map (tapestry-frame-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (sf (tapestry-selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (other-maps nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (while frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (tapestry-select-frame (car frames))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (setq other-maps (cons (list (tapestry-window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (tapestry-buffer-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (tapestry-position-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 other-maps)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 frames (cdr frames)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (tapestry-select-frame sf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (list frame-map other-maps)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (defun set-tapestry (map &optional n root-window-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "Restore the frame/window/buffer configuration described by MAP,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 which should be a list previously returned by a call to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 tapestry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 Optional second arg N causes frame reconfiguration to be skipped
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 and the windows of the current frame will configured according to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 the window map of the Nth frame in MAP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 Optional third arg ROOT-WINDOW-EDGES non-nil should be a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 containing the edges of a window in the current frame. This list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 should be in the same form as returned by the `window-edges'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 function. The window configuration from MAP will be restored in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 this window. If no window with these exact edges exists, a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 window that lies entirely within the edge coordinates will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 expanded until the edge coordinates match or the window bounded by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ROOT-WINDOW-EDGES is entirely contained within the expanded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 window. If no window entirely within the ROOT-WINDOW-EDGES edge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 coordinates can be found, the window with the greatest overlap of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ROOT-WINDOW-EDGES will be used."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (let ((sf (tapestry-selected-frame))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
77 (tapestry-windows-changed nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 frame-list frame-map other-maps other-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (setq frame-map (nth 0 map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 other-maps (nth 1 map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (if (and root-window-edges (null n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (setq n 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (if n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (let (first-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (setq other-map (nth (1- n) other-maps))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (if (null other-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (error "No such map, %d" n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (setq first-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (tapestry-set-window-map (nth 0 other-map) root-window-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (tapestry-set-buffer-map (nth 1 other-map) first-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (tapestry-set-position-map (nth 2 other-map) first-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (tapestry-set-frame-map frame-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;; frame list is reversed relative to the map order because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ;; created frames are added to the head of the list instead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ;; of the tail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (setq frame-list (nreverse (tapestry-frame-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (while other-maps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (tapestry-select-frame (car frame-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (tapestry-set-window-map (nth 0 (car other-maps)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (tapestry-set-buffer-map (nth 1 (car other-maps)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (tapestry-set-position-map (nth 2 (car other-maps)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (setq other-maps (cdr other-maps)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 frame-list (cdr frame-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (and (tapestry-frame-live-p sf) (tapestry-select-frame sf))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defun tapestry-frame-map ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (let ((map (mapcar 'tapestry-frame-parameters (tapestry-frame-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 list cell frame-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (setq list map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 frame-list (tapestry-frame-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (while list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (setq cell (assq 'minibuffer (car list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (if (and cell (windowp (cdr cell)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (if (eq (tapestry-window-frame (cdr cell)) (car frame-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (setcdr cell t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (setcdr cell 'none)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (setq list (cdr list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 frame-list (cdr frame-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 map ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (defun tapestry-set-frame-map (map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; some parameters can only be set only at frame creation time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; so all existing frames must die.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (let ((doomed-frames (tapestry-frame-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (while map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (tapestry-make-frame (car map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (setq map (cdr map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (while doomed-frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (tapestry-delete-frame (car doomed-frames))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (setq doomed-frames (cdr doomed-frames)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defun tapestry-window-map ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (let (maps map0 map1 map0-edges map1-edges x-unchanged y-unchanged)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (setq maps (mapcar 'tapestry-window-edges (tapestry-window-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (while (cdr maps)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (setq map0 maps)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (while (cdr map0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (setq map1 (cdr map0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 map0-edges (tapestry-find-window-map-edges (car map0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 map1-edges (tapestry-find-window-map-edges (car map1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 x-unchanged (and (= (car map0-edges) (car map1-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (= (nth 2 map0-edges) (nth 2 map1-edges)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 y-unchanged (and (= (nth 1 map0-edges) (nth 1 map1-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (= (nth 3 map0-edges) (nth 3 map1-edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (cond ((and (not x-unchanged) (not y-unchanged))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (setq map0 (cdr map0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ((or (and x-unchanged (eq (car (car map0)) '-))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (and y-unchanged (eq (car (car map0)) '|)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (nconc (car map0) (list (car map1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (setcdr map0 (cdr map1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (setcar map0 (list (if x-unchanged '- '|)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (car map0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (car map1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (setcdr map0 (cdr map1))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (car maps)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (defun tapestry-set-window-map (map &optional root-window-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (let ((map-width (tapestry-compute-map-width map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (map-height (tapestry-compute-map-height map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (root-window nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (if root-window-edges
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (let (w-list w-edges w-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 exact-w inside-w overlap-w max-overlap overlap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (while (null root-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (setq exact-w nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 inside-w nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 overlap-w nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 max-overlap -1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 w-list (tapestry-window-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (while w-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (setq w-edges (tapestry-window-edges (car w-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 w-area (tapestry-window-area w-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (if (equal w-edges root-window-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (setq exact-w (car w-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 w-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (setq overlap (tapestry-window-overlap w-edges
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 root-window-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 overlap (if overlap (tapestry-window-area overlap) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 w-area (tapestry-window-area w-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (if (< max-overlap overlap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (setq max-overlap overlap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 overlap-w (car w-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ;; set inside-w each time we find a window inside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ;; the root window edges. FSF Emacs gives space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ;; to the window above or to the left if there is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; such a window. therefore we want to find the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;; inside window that is bottom-most or right-most so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ;; when we delete it, its space will be given to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ;; what will be the root window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (if (= w-area overlap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (setq inside-w (car w-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (setq w-list (cdr w-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (cond (exact-w (setq root-window exact-w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (inside-w
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;; how could a window be inside the root window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ;; edges and there only be one window? a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 ;; multi-line minibuffer, that's how!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (if (not (one-window-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (delete-window inside-w)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (t (setq root-window overlap-w))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (tapestry-apply-window-map map map-width map-height root-window)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
204 (setq tapestry-windows-changed t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 root-window )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (if (tapestry-windows-match-map map map-width map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (tapestry-first-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (delete-other-windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (setq root-window (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (tapestry-apply-window-map map map-width map-height root-window)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
211 (setq tapestry-windows-changed t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 root-window ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (defun tapestry-buffer-map ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (let ((w-list (tapestry-window-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 b list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (while w-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (setq b (window-buffer (car w-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 list (cons (list (buffer-file-name b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (buffer-name b))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 w-list (cdr w-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (nreverse list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
225 ;; This version of tapestry-set-buffer-map unconditionally set
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
226 ;; the window buffer. This confused XEmacs 19.14's scroll-up
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
227 ;; function when scrolling VM presentation buffers.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
228 ;; end-of-buffer was never signaled after a scroll. You can
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
229 ;; duplicate this by creating a buffer that can be displayed
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
230 ;; fully in the current window and then run
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
231 ;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
232 ;; (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
233 ;; (set-window-buffer (selected-window) (current-buffer))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
234 ;; (scroll-up nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
235 ;;;;;;;;;;;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
236 ;;(defun tapestry-set-buffer-map (buffer-map &optional first-window)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
237 ;; (let ((w-list (tapestry-window-list first-window)) wb)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
238 ;; (while (and w-list buffer-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
239 ;; (setq wb (car buffer-map))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
240 ;; (set-window-buffer
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
241 ;; (car w-list)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
242 ;; (if (car wb)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
243 ;; (or (get-file-buffer (car wb))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
244 ;; (find-file-noselect (car wb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
245 ;; (get-buffer-create (nth 1 wb))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
246 ;; (setq w-list (cdr w-list)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
247 ;; buffer-map (cdr buffer-map)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
248
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (defun tapestry-set-buffer-map (buffer-map &optional first-window)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
250 (let ((w-list (tapestry-window-list first-window))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
251 current-wb proposed-wb cell)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (while (and w-list buffer-map)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
253 (setq cell (car buffer-map)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
254 proposed-wb (if (car cell)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
255 (or (get-file-buffer (car cell))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
256 (find-file-noselect (car cell)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
257 (get-buffer-create (nth 1 cell)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
258 current-wb (window-buffer (car w-list)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
259 ;; Setting the window buffer to the same value it already
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
260 ;; has seems to confuse XEmacs' scroll-up function. But
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
261 ;; _not_ setting after windows torn down seem to cause
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
262 ;; window point to sometimes drift away from point at
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
263 ;; redisplay time. The solution (hopefully!) is to track
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
264 ;; when windows have been rearranged and unconditionally do
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
265 ;; the set-window-buffer, otherwise do it only if the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
266 ;; window buffer and the prosed window buffer differ.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
267 (if (or tapestry-windows-changed (not (eq proposed-wb current-wb)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
268 (set-window-buffer (car w-list) proposed-wb))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (setq w-list (cdr w-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 buffer-map (cdr buffer-map)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (defun tapestry-position-map ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (let ((sw (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (w-list (tapestry-window-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (while w-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (setq list (cons (list (window-start (car w-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (window-point (car w-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (window-hscroll (car w-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (eq (car w-list) sw))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 w-list (cdr w-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (nreverse list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (defun tapestry-set-position-map (position-map &optional first-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (let ((w-list (tapestry-window-list first-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (osw (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 sw p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (while (and w-list position-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (setq p (car position-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (and (car p) (set-window-start (car w-list) (car p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (and (nth 1 p) (set-window-point (car w-list) (nth 1 p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (and (nth 2 p) (set-window-hscroll (car w-list) (nth 2 p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (and (nth 3 p) (setq sw (car w-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ;; move this buffer up in the buffer-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (select-window (car w-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (setq w-list (cdr w-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 position-map (cdr position-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (select-window (or sw osw))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (defun tapestry-apply-window-map (map map-width map-height current-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 root-window-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 root-window-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (let ((window-min-height 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (window-min-width 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 horizontal)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (if (null root-window-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (setq root-window-height (window-height current-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 root-window-width (window-width current-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (while map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ((numberp (car map)) (setq map nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 ((eq (car map) '-) (setq horizontal nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 ((eq (car map) '|) (setq horizontal t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (if (cdr map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (split-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 current-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (if horizontal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (/ (* (tapestry-compute-map-width (car map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 root-window-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 map-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (/ (* (tapestry-compute-map-height (car map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 root-window-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 map-height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 horizontal))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (if (not (numberp (car (car map))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (setq current-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (tapestry-apply-window-map (car map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 map-width map-height
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 current-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 root-window-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 root-window-height)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (and (cdr map) (setq current-window (next-window current-window 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (setq map (cdr map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 current-window ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (defun tapestry-windows-match-map (map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 map-width map-height
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 window-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 window-map-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 window-map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (or map-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (setq map-width (tapestry-compute-map-width map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 map-height (tapestry-compute-map-height map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (or window-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (setq window-map (tapestry-window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 window-map-height (tapestry-compute-map-height window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 window-map-width (tapestry-compute-map-width window-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (let ((result t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (cond ((numberp (car map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (and (numberp (car window-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (= (/ (* (nth 0 map) window-map-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 map-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (nth 0 window-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (= (/ (* (nth 1 map) window-map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (nth 1 window-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (= (/ (* (nth 2 map) window-map-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 map-width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (nth 2 window-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (= (/ (* (nth 3 map) window-map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (nth 3 window-map))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 ((eq (car map) '-)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (if (not (eq (car window-map) '-))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (setq map (cdr map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 window-map (cdr window-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (while (and result map window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (setq result (tapestry-windows-match-map (car map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 map-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 map-height
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (car window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 window-map-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 window-map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 map (cdr map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 window-map (cdr window-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (and result (null map) (null window-map))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 ((eq (car map) '|)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (if (not (eq (car window-map) '|))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (setq map (cdr map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 window-map (cdr window-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (while (and result map window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (setq result (tapestry-windows-match-map (car map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 map-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 map-height
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (car window-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 window-map-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 window-map-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 map (cdr map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 window-map (cdr window-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (and result (null map) (null window-map)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (defun tapestry-find-window-map-edges (map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (let (nw-edges se-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (setq nw-edges map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (while (and (consp nw-edges) (not (numberp (car nw-edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (setq nw-edges (car (cdr nw-edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (setq se-edges map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (while (and (consp se-edges) (not (numberp (car se-edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (while (cdr se-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (setq se-edges (cdr se-edges)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (setq se-edges (car se-edges)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (if (eq nw-edges se-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 nw-edges
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (setq nw-edges (copy-sequence nw-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (setcdr (nthcdr 1 nw-edges) (nthcdr 2 se-edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 nw-edges )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (defun tapestry-compute-map-width (map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (let ((edges (tapestry-find-window-map-edges map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (- (nth 2 edges) (car edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (defun tapestry-compute-map-height (map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (let ((edges (tapestry-find-window-map-edges map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (- (nth 3 edges) (nth 1 edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 ;; delq is to memq as delassq is to assq
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (defun tapestry-delassq (elt list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (let ((prev nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (curr list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (while curr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (if (eq elt (car (car curr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (if (null prev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (setq list (cdr list) curr list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (setcdr prev (cdr curr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (setq curr (cdr curr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (setq prev curr curr (cdr curr))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 list ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (defun tapestry-remove-frame-parameters (map params)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (let (frame-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (while params
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (setq frame-map (nth 0 map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (while frame-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (setcar frame-map (tapestry-delassq (car params) (car frame-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (setq frame-map (cdr frame-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (setq params (cdr params)))))
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 tapestry-nullify-tapestry-elements (map &optional buf-file-name buf-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 window-start window-point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 window-hscroll selected-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (let (p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (setq map (nth 1 map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (while map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (setq p (nth 1 (car map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (while p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (and buf-file-name (setcar (car p) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (and buf-name (setcar (cdr (car p)) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (setq p (cdr p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (setq p (nth 2 (car map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (while p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (and window-start (setcar (car p) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (and window-point (setcar (cdr (car p)) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (and window-hscroll (setcar (nthcdr 2 (car p)) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (and selected-window (setcar (nthcdr 3 (car p)) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (setq p (cdr p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (setq map (cdr map)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (defun tapestry-replace-tapestry-element (map what function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (let (mapi mapj p old new)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (cond ((eq what 'buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (setq mapi 1 mapj 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ((eq what 'buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (setq mapi 1 mapj 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 ((eq what 'window-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (setq mapi 2 mapj 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 ((eq what 'window-point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (setq mapi 2 mapj 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 ((eq what 'window-hscroll)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (setq mapi 2 mapj 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 ((eq what 'selected-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (setq mapi 2 mapj 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (setq map (nth 1 map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (while map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (setq p (nth mapi (car map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (while p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (setq old (nth mapj (car p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 new (funcall function old))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (if (not (equal old new))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (setcar (nthcdr mapj (car p)) new))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (setq p (cdr p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (setq map (cdr map)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (defun tapestry-window-list (&optional first-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (let* ((first-window (or first-window (tapestry-first-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (windows (cons first-window nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (current-cons windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (w (next-window first-window 'nomini)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (while (not (eq w first-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (setq current-cons (setcdr current-cons (cons w nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (setq w (next-window w 'nomini)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 windows ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (defun tapestry-first-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (if (eq (tapestry-selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (tapestry-window-frame (minibuffer-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (next-window (minibuffer-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (let ((w (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (top (or (cdr (assq 'menu-bar-lines (tapestry-frame-parameters))) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (while (or (not (= 0 (car (setq edges (tapestry-window-edges w)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 ;; >= instead of = because in FSF Emacs 19.2x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 ;; (whenever the Lucid menubar code was added) the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 ;; menu-bar-lines frame parameter == 1 when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 ;; Lucid menubar is enabled even though the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 ;; menubar doesn't steal the first line from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 ;; window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (not (>= top (nth 1 edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (setq w (next-window w 'nomini)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 w )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (defun tapestry-window-area (edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (* (- (nth 3 edges) (nth 1 edges))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (- (nth 2 edges) (nth 0 edges))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (defun tapestry-window-overlap (e0 e1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (let (top left bottom right)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (cond ((and (<= (nth 0 e0) (nth 0 e1)) (< (nth 0 e1) (nth 2 e0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (setq left (nth 0 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ((and (<= (nth 0 e1) (nth 0 e0)) (< (nth 0 e0) (nth 2 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (setq left (nth 0 e0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (cond ((and (< (nth 0 e0) (nth 2 e1)) (<= (nth 2 e1) (nth 2 e0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (setq right (nth 2 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 ((and (< (nth 0 e1) (nth 2 e0)) (<= (nth 2 e0) (nth 2 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (setq right (nth 2 e0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (cond ((and (<= (nth 1 e0) (nth 1 e1)) (< (nth 1 e1) (nth 3 e0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (setq top (nth 1 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 ((and (<= (nth 1 e1) (nth 1 e0)) (< (nth 1 e0) (nth 3 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (setq top (nth 1 e0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (cond ((and (< (nth 1 e0) (nth 3 e1)) (<= (nth 3 e1) (nth 3 e0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (setq bottom (nth 3 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 ((and (< (nth 1 e1) (nth 3 e0)) (<= (nth 3 e0) (nth 3 e1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (setq bottom (nth 3 e0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (and left top right bottom (list left top right bottom))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (defun tapestry-window-edges (&optional window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (if (fboundp 'window-pixel-edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (let ((edges (window-pixel-edges window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 tmp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (setq tmp edges)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (setcar tmp (/ (car tmp) (face-width 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (setq tmp (cdr tmp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (setcar tmp (/ (car tmp) (face-height 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (setq tmp (cdr tmp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (setcar tmp (/ (car tmp) (face-width 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (setq tmp (cdr tmp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (setcar tmp (/ (car tmp) (face-height 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 edges )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (window-edges window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 ;; We call these functions instead of calling the Emacs 19 frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 ;; functions directly to let this package work with v18 Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (defun tapestry-frame-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (if (fboundp 'frame-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (frame-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (list nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (defun tapestry-frame-parameters (&optional f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (if (fboundp 'frame-parameters)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (frame-parameters f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (defun tapestry-window-frame (w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (if (fboundp 'window-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (window-frame w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (defun tapestry-modify-frame-parameters (f alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (if (fboundp 'modify-frame-parameters)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (modify-frame-parameters f alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (defun tapestry-select-frame (f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (if (fboundp 'select-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (select-frame f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (defun tapestry-selected-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (if (fboundp 'selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (defun tapestry-next-frame (&optional f all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (if (fboundp 'next-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (next-frame f all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (defun tapestry-make-frame (&optional alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (if (fboundp 'make-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (make-frame alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (defun tapestry-delete-frame (&optional f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (if (fboundp 'delete-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (delete-frame f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 nil ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (defun tapestry-frame-live-p (f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (if (fboundp 'frame-live-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (frame-live-p f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 t ))