Mercurial > emacs
annotate lisp/gnus/gnus-win.el @ 112438:11f1b4757236
* image.c (x_create_bitmap_from_xpm_data): Add cast to fix type clash
when calling XpmCreatePixmapFromData.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sat, 22 Jan 2011 20:33:12 -0800 |
parents | 417b1e4d63cd |
children |
rev | line source |
---|---|
17493 | 1 ;;; gnus-win.el --- window configuration functions for Gnus |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93617
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17493 | 12 ;; it under the terms of the GNU General Public License as published by |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93617
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93617
diff
changeset
|
14 ;; (at your option) any later version. |
17493 | 15 |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93617
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17493 | 19 ;; GNU General Public License for more details. |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93617
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17493 | 23 |
24 ;;; Commentary: | |
25 | |
26 ;;; Code: | |
27 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
28 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 |
17493 | 30 (require 'gnus) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
31 (require 'gnus-util) |
17493 | 32 |
33 (defgroup gnus-windows nil | |
34 "Window configuration." | |
35 :group 'gnus) | |
36 | |
37 (defcustom gnus-use-full-window t | |
38 "*If non-nil, use the entire Emacs screen." | |
39 :group 'gnus-windows | |
40 :type 'boolean) | |
41 | |
42 (defvar gnus-window-configuration nil | |
43 "Obsolete variable. See `gnus-buffer-configuration'.") | |
44 | |
45 (defcustom gnus-window-min-width 2 | |
46 "*Minimum width of Gnus buffers." | |
47 :group 'gnus-windows | |
48 :type 'integer) | |
49 | |
50 (defcustom gnus-window-min-height 1 | |
51 "*Minimum height of Gnus buffers." | |
52 :group 'gnus-windows | |
53 :type 'integer) | |
54 | |
55 (defcustom gnus-always-force-window-configuration nil | |
56 "*If non-nil, always force the Gnus window configurations." | |
57 :group 'gnus-windows | |
58 :type 'boolean) | |
59 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
60 (defcustom gnus-use-frames-on-any-display nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
61 "*If non-nil, frames on all displays will be considered useable by Gnus. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
62 When nil, only frames on the same display as the selected frame will be |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
63 used to display Gnus windows." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57856
diff
changeset
|
64 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
65 :group 'gnus-windows |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
66 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
67 |
17493 | 68 (defvar gnus-buffer-configuration |
69 '((group | |
70 (vertical 1.0 | |
110763
0fe64d68a522
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110689
diff
changeset
|
71 (group 1.0 point))) |
17493 | 72 (summary |
73 (vertical 1.0 | |
110763
0fe64d68a522
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110689
diff
changeset
|
74 (summary 1.0 point))) |
17493 | 75 (article |
76 (cond | |
77 (gnus-use-trees | |
78 '(vertical 1.0 | |
79 (summary 0.25 point) | |
80 (tree 0.25) | |
81 (article 1.0))) | |
82 (t | |
83 '(vertical 1.0 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
84 (summary 0.25 point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
85 (article 1.0))))) |
17493 | 86 (server |
87 (vertical 1.0 | |
110763
0fe64d68a522
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110689
diff
changeset
|
88 (server 1.0 point))) |
17493 | 89 (browse |
90 (vertical 1.0 | |
110763
0fe64d68a522
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110689
diff
changeset
|
91 (browse 1.0 point))) |
17493 | 92 (message |
93 (vertical 1.0 | |
94 (message 1.0 point))) | |
95 (pick | |
96 (vertical 1.0 | |
97 (article 1.0 point))) | |
98 (info | |
99 (vertical 1.0 | |
100 (info 1.0 point))) | |
101 (summary-faq | |
102 (vertical 1.0 | |
103 (summary 0.25) | |
104 (faq 1.0 point))) | |
110689
42815c76b976
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
105 (only-article |
42815c76b976
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
106 (vertical 1.0 |
42815c76b976
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
107 (article 1.0 point))) |
17493 | 108 (edit-article |
109 (vertical 1.0 | |
110 (article 1.0 point))) | |
111 (edit-form | |
112 (vertical 1.0 | |
113 (group 0.5) | |
114 (edit-form 1.0 point))) | |
115 (edit-score | |
116 (vertical 1.0 | |
117 (summary 0.25) | |
118 (edit-score 1.0 point))) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
119 (edit-server |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
120 (vertical 1.0 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
121 (server 0.5) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
122 (edit-form 1.0 point))) |
17493 | 123 (post |
124 (vertical 1.0 | |
125 (post 1.0 point))) | |
126 (reply | |
127 (vertical 1.0 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
128 (article 0.5) |
17493 | 129 (message 1.0 point))) |
130 (forward | |
131 (vertical 1.0 | |
132 (message 1.0 point))) | |
133 (reply-yank | |
134 (vertical 1.0 | |
135 (message 1.0 point))) | |
136 (mail-bounce | |
137 (vertical 1.0 | |
138 (article 0.5) | |
139 (message 1.0 point))) | |
140 (pipe | |
141 (vertical 1.0 | |
142 (summary 0.25 point) | |
143 ("*Shell Command Output*" 1.0))) | |
144 (bug | |
145 (vertical 1.0 | |
39354
6bc5624fb330
(gnus-buffer-configuration): Respect `gnus-bug-create-help-buffer'.
Sam Steingold <sds@gnu.org>
parents:
35453
diff
changeset
|
146 (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5)) |
17493 | 147 ("*Gnus Bug*" 1.0 point))) |
148 (score-trace | |
149 (vertical 1.0 | |
150 (summary 0.5 point) | |
151 ("*Score Trace*" 1.0))) | |
152 (score-words | |
153 (vertical 1.0 | |
154 (summary 0.5 point) | |
155 ("*Score Words*" 1.0))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
156 (split-trace |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
157 (vertical 1.0 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
158 (summary 0.5 point) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
159 ("*Split Trace*" 1.0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
160 (category |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
161 (vertical 1.0 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
162 (category 1.0))) |
17493 | 163 (compose-bounce |
164 (vertical 1.0 | |
165 (article 0.5) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
166 (message 1.0 point))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
167 (display-term |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
168 (vertical 1.0 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
169 ("*display*" 1.0))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
170 (mml-preview |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
171 (vertical 1.0 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
172 (message 0.5) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
173 (mml-preview 1.0 point)))) |
17493 | 174 "Window configuration for all possible Gnus buffers. |
175 See the Gnus manual for an explanation of the syntax used.") | |
176 | |
177 (defvar gnus-window-to-buffer | |
178 '((group . gnus-group-buffer) | |
179 (summary . gnus-summary-buffer) | |
180 (article . gnus-article-buffer) | |
181 (server . gnus-server-buffer) | |
182 (browse . "*Gnus Browse Server*") | |
183 (edit-group . gnus-group-edit-buffer) | |
184 (edit-form . gnus-edit-form-buffer) | |
185 (edit-server . gnus-server-edit-buffer) | |
186 (edit-score . gnus-score-edit-buffer) | |
187 (message . gnus-message-buffer) | |
188 (mail . gnus-message-buffer) | |
189 (post-news . gnus-message-buffer) | |
190 (faq . gnus-faq-buffer) | |
191 (tree . gnus-tree-buffer) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
192 (score-trace . "*Score Trace*") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
193 (split-trace . "*Split Trace*") |
17493 | 194 (info . gnus-info-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
195 (category . gnus-category-buffer) |
17493 | 196 (article-copy . gnus-article-copy) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
197 (draft . gnus-draft-buffer) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79143
diff
changeset
|
198 (mml-preview . mml-preview-buffer)) |
17493 | 199 "Mapping from short symbols to buffer names or buffer variables.") |
200 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
201 (defcustom gnus-configure-windows-hook nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
202 "*A hook called when configuring windows." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57856
diff
changeset
|
203 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
204 :group 'gnus-windows |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
205 :type 'hook) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
206 |
17493 | 207 ;;; Internal variables. |
208 | |
209 (defvar gnus-current-window-configuration nil | |
210 "The most recently set window configuration.") | |
211 | |
212 (defvar gnus-created-frames nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
213 (defvar gnus-window-frame-focus nil) |
17493 | 214 |
215 (defun gnus-kill-gnus-frames () | |
216 "Kill all frames Gnus has created." | |
217 (while gnus-created-frames | |
218 (when (frame-live-p (car gnus-created-frames)) | |
219 ;; We slap a condition-case around this `delete-frame' to ensure | |
220 ;; against errors if we try do delete the single frame that's left. | |
221 (ignore-errors | |
222 (delete-frame (car gnus-created-frames)))) | |
223 (pop gnus-created-frames))) | |
224 | |
225 (defun gnus-window-configuration-element (list) | |
226 (while (and list | |
227 (not (assq (car list) gnus-window-configuration))) | |
228 (pop list)) | |
229 (cadr (assq (car list) gnus-window-configuration))) | |
230 | |
231 ;;;###autoload | |
232 (defun gnus-add-configuration (conf) | |
233 "Add the window configuration CONF to `gnus-buffer-configuration'." | |
234 (setq gnus-buffer-configuration | |
235 (cons conf (delq (assq (car conf) gnus-buffer-configuration) | |
236 gnus-buffer-configuration)))) | |
237 | |
238 (defvar gnus-frame-list nil) | |
239 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
240 (defun gnus-window-to-buffer-helper (obj) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
241 (cond ((not (symbolp obj)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
242 obj) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
243 ((boundp obj) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
244 (symbol-value obj)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
245 ((fboundp obj) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
246 (funcall obj)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
247 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
248 nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
249 |
17493 | 250 (defun gnus-configure-frame (split &optional window) |
251 "Split WINDOW according to SPLIT." | |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
252 (let* ((current-window (or (get-buffer-window (current-buffer)) (selected-window))) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
253 (window (or window current-window))) |
34193
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
254 (select-window window) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
255 ;; The SPLIT might be something that is to be evaled to |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
256 ;; return a new SPLIT. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
257 (while (and (not (assq (car split) gnus-window-to-buffer)) |
93617
af178a811324
(gnus-configure-frame, gnus-all-windows-visible-p):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93105
diff
changeset
|
258 (symbolp (car split)) (fboundp (car split))) |
34193
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
259 (setq split (eval split))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
260 (let* ((type (car split)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
261 (subs (cddr split)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
262 (len (if (eq type 'horizontal) (window-width) (window-height))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
263 (total 0) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
264 (window-min-width (or gnus-window-min-width window-min-width)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
265 (window-min-height (or gnus-window-min-height window-min-height)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
266 s result new-win rest comp-subs size sub) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
267 (cond |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
268 ;; Nothing to do here. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
269 ((null split)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
270 ;; Don't switch buffers. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
271 ((null type) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
272 (and (memq 'point split) window)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
273 ;; This is a buffer to be selected. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
274 ((not (memq type '(frame horizontal vertical))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
275 (let ((buffer (cond ((stringp type) type) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
276 (t (cdr (assq type gnus-window-to-buffer)))))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
277 (unless buffer |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
278 (error "Invalid buffer type: %s" type)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
279 (let ((buf (gnus-get-buffer-create |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
280 (gnus-window-to-buffer-helper buffer)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
281 (if (eq buf (window-buffer (selected-window))) (set-buffer buf) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
282 (switch-to-buffer buf))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
283 (when (memq 'frame-focus split) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
284 (setq gnus-window-frame-focus window)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
285 ;; We return the window if it has the `point' spec. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
286 (and (memq 'point split) window))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
287 ;; This is a frame split. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
288 ((eq type 'frame) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
289 (unless gnus-frame-list |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
290 (setq gnus-frame-list (list (window-frame current-window)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
291 (let ((i 0) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
292 params frame fresult) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
293 (while (< i (length subs)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
294 ;; Frame parameter is gotten from the sub-split. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
295 (setq params (cadr (elt subs i))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
296 ;; It should be a list. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
297 (unless (listp params) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
298 (setq params nil)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
299 ;; Create a new frame? |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
300 (unless (setq frame (elt gnus-frame-list i)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
301 (nconc gnus-frame-list (list (setq frame (make-frame params)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
302 (push frame gnus-created-frames)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
303 ;; Is the old frame still alive? |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
304 (unless (frame-live-p frame) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
305 (setcar (nthcdr i gnus-frame-list) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
306 (setq frame (make-frame params)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
307 ;; Select the frame in question and do more splits there. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
308 (select-frame frame) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
309 (setq fresult (or (gnus-configure-frame (elt subs i)) fresult)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
310 (incf i)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
311 ;; Select the frame that has the selected buffer. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
312 (when fresult |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
313 (select-frame (window-frame fresult))))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
314 ;; This is a normal split. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
315 (t |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
316 (when (> (length subs) 0) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
317 ;; First we have to compute the sizes of all new windows. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
318 (while subs |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
319 (setq sub (append (pop subs) nil)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
320 (while (and (not (assq (car sub) gnus-window-to-buffer)) |
93617
af178a811324
(gnus-configure-frame, gnus-all-windows-visible-p):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93105
diff
changeset
|
321 (symbolp (car sub)) (fboundp (car sub))) |
34193
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
322 (setq sub (eval sub))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
323 (when sub |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
324 (push sub comp-subs) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
325 (setq size (cadar comp-subs)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
326 (cond ((equal size 1.0) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
327 (setq rest (car comp-subs)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
328 (setq s 0)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
329 ((floatp size) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
330 (setq s (floor (* size len)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
331 ((integerp size) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
332 (setq s size)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
333 (t |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
334 (error "Invalid size: %s" size))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
335 ;; Try to make sure that we are inside the safe limits. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
336 (cond ((zerop s)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
337 ((eq type 'horizontal) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
338 (setq s (max s window-min-width))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
339 ((eq type 'vertical) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
340 (setq s (max s window-min-height)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
341 (setcar (cdar comp-subs) s) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
342 (incf total s))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
343 ;; Take care of the "1.0" spec. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
344 (if rest |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
345 (setcar (cdr rest) (- len total)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
346 (error "No 1.0 specs in %s" split)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
347 ;; The we do the actual splitting in a nice recursive |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
348 ;; fashion. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
349 (setq comp-subs (nreverse comp-subs)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
350 (while comp-subs |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
351 (if (null (cdr comp-subs)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
352 (setq new-win window) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
353 (setq new-win |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
354 (split-window window (cadar comp-subs) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
355 (eq type 'horizontal)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
356 (setq result (or (gnus-configure-frame |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
357 (car comp-subs) window) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
358 result)) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
359 (select-window new-win) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
360 (setq window new-win) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
361 (setq comp-subs (cdr comp-subs)))) |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
362 ;; Return the proper window, if any. |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
363 (when result |
31766be242f6
(gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34192
diff
changeset
|
364 (select-window result))))))) |
17493 | 365 |
366 (defvar gnus-frame-split-p nil) | |
367 | |
368 (defun gnus-configure-windows (setting &optional force) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
369 (if (window-configuration-p setting) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
370 (set-window-configuration setting) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
371 (setq gnus-current-window-configuration setting) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
372 (setq force (or force gnus-always-force-window-configuration)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
373 (let ((split (if (symbolp setting) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
374 (cadr (assq setting gnus-buffer-configuration)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
375 setting)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
376 all-visible) |
17493 | 377 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
378 (setq gnus-frame-split-p nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
379 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
380 (unless split |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
381 (error "No such setting in `gnus-buffer-configuration': %s" setting)) |
17493 | 382 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
383 (if (and (setq all-visible (gnus-all-windows-visible-p split)) |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
384 (not force)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
385 ;; All the windows mentioned are already visible, so we just |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
386 ;; put point in the assigned buffer, and do not touch the |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
387 ;; winconf. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
388 (select-window all-visible) |
39354
6bc5624fb330
(gnus-buffer-configuration): Respect `gnus-bug-create-help-buffer'.
Sam Steingold <sds@gnu.org>
parents:
35453
diff
changeset
|
389 |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
390 ;; Make sure "the other" buffer, nntp-server-buffer, is live. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
391 (unless (gnus-buffer-live-p nntp-server-buffer) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
392 (nnheader-init-server-buffer)) |
17493 | 393 |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
394 ;; Either remove all windows or just remove all Gnus windows. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
395 (let ((frame (selected-frame))) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
396 (unwind-protect |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
397 (if gnus-use-full-window |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
398 ;; We want to remove all other windows. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
399 (if (not gnus-frame-split-p) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
400 ;; This is not a `frame' split, so we ignore the |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
401 ;; other frames. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
402 (delete-other-windows) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
403 ;; This is a `frame' split, so we delete all windows |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
404 ;; on all frames. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
405 (gnus-delete-windows-in-gnusey-frames)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
406 ;; Just remove some windows. |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
407 (gnus-remove-some-windows) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
408 (if (featurep 'xemacs) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
409 (switch-to-buffer nntp-server-buffer) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
410 (set-buffer nntp-server-buffer))) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
411 (select-frame frame))) |
17493 | 412 |
111789
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
413 (let (gnus-window-frame-focus) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
414 (if (featurep 'xemacs) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
415 (switch-to-buffer nntp-server-buffer) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
416 (set-buffer nntp-server-buffer)) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
417 (gnus-configure-frame split) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
418 (run-hooks 'gnus-configure-windows-hook) |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
419 (when gnus-window-frame-focus |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
420 (gnus-select-frame-set-input-focus |
f97704487fb3
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110763
diff
changeset
|
421 (window-frame gnus-window-frame-focus)))))))) |
17493 | 422 |
423 (defun gnus-delete-windows-in-gnusey-frames () | |
424 "Do a `delete-other-windows' in all frames that have Gnus windows." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
425 (let ((buffers (gnus-buffers))) |
17493 | 426 (mapcar |
427 (lambda (frame) | |
428 (unless (eq (cdr (assq 'minibuffer | |
429 (frame-parameters frame))) | |
430 'only) | |
431 (select-frame frame) | |
432 (let (do-delete) | |
433 (walk-windows | |
434 (lambda (window) | |
435 (when (memq (window-buffer window) buffers) | |
436 (setq do-delete t)))) | |
437 (when do-delete | |
438 (delete-other-windows))))) | |
439 (frame-list)))) | |
440 | |
441 (defun gnus-all-windows-visible-p (split) | |
442 "Say whether all buffers in SPLIT are currently visible. | |
443 In particular, the value returned will be the window that | |
444 should have point." | |
445 (let ((stack (list split)) | |
446 (all-visible t) | |
447 type buffer win buf) | |
448 (while (and (setq split (pop stack)) | |
449 all-visible) | |
450 ;; Be backwards compatible. | |
451 (when (vectorp split) | |
452 (setq split (append split nil))) | |
453 (when (or (consp (car split)) | |
454 (vectorp (car split))) | |
455 (push 1.0 split) | |
456 (push 'vertical split)) | |
457 ;; The SPLIT might be something that is to be evaled to | |
458 ;; return a new SPLIT. | |
459 (while (and (not (assq (car split) gnus-window-to-buffer)) | |
93617
af178a811324
(gnus-configure-frame, gnus-all-windows-visible-p):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93105
diff
changeset
|
460 (symbolp (car split)) (fboundp (car split))) |
17493 | 461 (setq split (eval split))) |
462 | |
463 (setq type (elt split 0)) | |
464 (cond | |
465 ;; Nothing here. | |
466 ((null split) t) | |
467 ;; A buffer. | |
468 ((not (memq type '(horizontal vertical frame))) | |
469 (setq buffer (cond ((stringp type) type) | |
470 (t (cdr (assq type gnus-window-to-buffer))))) | |
471 (unless buffer | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
472 (error "Invalid buffer type: %s" type)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
473 (if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
474 (setq win (gnus-get-buffer-window buf t))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
475 (if (memq 'point split) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
476 (setq all-visible win)) |
17493 | 477 (setq all-visible nil))) |
478 (t | |
479 (when (eq type 'frame) | |
480 (setq gnus-frame-split-p t)) | |
481 (setq stack (append (cddr split) stack))))) | |
482 (unless (eq all-visible t) | |
483 all-visible))) | |
484 | |
485 (defun gnus-window-top-edge (&optional window) | |
486 (nth 1 (window-edges window))) | |
487 | |
488 (defun gnus-remove-some-windows () | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
489 (let ((buffers (gnus-buffers)) |
17493 | 490 buf bufs lowest-buf lowest) |
491 (save-excursion | |
492 ;; Remove windows on all known Gnus buffers. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
493 (while (setq buf (pop buffers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
494 (when (get-buffer-window buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
495 (push buf bufs) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
496 (pop-to-buffer buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
497 (when (or (not lowest) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
498 (< (gnus-window-top-edge) lowest)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
499 (setq lowest (gnus-window-top-edge) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
500 lowest-buf buf)))) |
17493 | 501 (when lowest-buf |
502 (pop-to-buffer lowest-buf) | |
35453
26726eff41ca
2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34193
diff
changeset
|
503 (if (featurep 'xemacs) |
26726eff41ca
2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34193
diff
changeset
|
504 (switch-to-buffer nntp-server-buffer) |
26726eff41ca
2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34193
diff
changeset
|
505 (set-buffer nntp-server-buffer))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
506 (mapcar (lambda (b) (delete-windows-on b t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
507 (delq lowest-buf bufs))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
508 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
509 (eval-and-compile |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
510 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
511 ((fboundp 'frames-on-display-list) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
512 (defalias 'gnus-frames-on-display-list 'frames-on-display-list)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
513 ((and (featurep 'xemacs) (fboundp 'frame-device)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
514 (defun gnus-frames-on-display-list () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
515 (apply 'filtered-frame-list 'identity (list (frame-device nil))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
516 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
517 (defalias 'gnus-frames-on-display-list 'frame-list)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
518 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
519 (defun gnus-get-buffer-window (buffer &optional frame) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
520 (cond ((and (null gnus-use-frames-on-any-display) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
521 (memq frame '(t 0 visible))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
522 (car |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
523 (let ((frames (gnus-frames-on-display-list))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
524 (gnus-remove-if (lambda (win) (not (memq (window-frame win) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
525 frames))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
526 (get-buffer-window-list buffer nil frame))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
527 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
55668
diff
changeset
|
528 (get-buffer-window buffer frame)))) |
17493 | 529 |
530 (provide 'gnus-win) | |
531 | |
532 ;;; gnus-win.el ends here |