annotate lisp/gnus/gnus-win.el @ 110718:38ee498456a4

* lisp/gnus/smime.el (smime-cert-by-ldap-1): Drop Emacs 21 code.
author Glenn Morris <rgm@gnu.org>
date Sat, 02 Oct 2010 19:09:53 -0700
parents 42815c76b976
children 0fe64d68a522
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7 ;; Keywords: news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
20
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
23
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24 ;;; Commentary:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26 ;;; Code:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
32
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
33 (defgroup gnus-windows nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
34 "Window configuration."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
35 :group 'gnus)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
36
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
37 (defcustom gnus-use-full-window t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
38 "*If non-nil, use the entire Emacs screen."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
39 :group 'gnus-windows
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
40 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
41
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
42 (defvar gnus-window-configuration nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
43 "Obsolete variable. See `gnus-buffer-configuration'.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
44
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
45 (defcustom gnus-window-min-width 2
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
46 "*Minimum width of Gnus buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
47 :group 'gnus-windows
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
48 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
49
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
50 (defcustom gnus-window-min-height 1
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
51 "*Minimum height of Gnus buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
52 :group 'gnus-windows
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
53 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
54
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
55 (defcustom gnus-always-force-window-configuration nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
56 "*If non-nil, always force the Gnus window configurations."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
57 :group 'gnus-windows
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
58 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
68 (defvar gnus-buffer-configuration
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
69 '((group
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
70 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
71 (group 1.0 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
72 (if gnus-carpal '(group-carpal 4))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 (summary
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
75 (summary 1.0 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
76 (if gnus-carpal '(summary-carpal 4))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77 (article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
79 (gnus-use-trees
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
80 '(vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
81 (summary 0.25 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
82 (tree 0.25)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
83 (article 1.0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85 '(vertical 1.0
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
86 (summary 0.25 point)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
87 (if gnus-carpal '(summary-carpal 4))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
88 (article 1.0)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
89 (server
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
90 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
91 (server 1.0 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
92 (if gnus-carpal '(server-carpal 2))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
93 (browse
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
94 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
95 (browse 1.0 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
96 (if gnus-carpal '(browse-carpal 2))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
97 (message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
98 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
99 (message 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
100 (pick
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
101 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
102 (article 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
103 (info
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
104 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
105 (info 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
106 (summary-faq
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
107 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
108 (summary 0.25)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
109 (faq 1.0 point)))
110689
42815c76b976 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
110 (only-article
42815c76b976 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
111 (vertical 1.0
42815c76b976 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
112 (article 1.0 point)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113 (edit-article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115 (article 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 (edit-form
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
118 (group 0.5)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
119 (edit-form 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
120 (edit-score
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
121 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
122 (summary 0.25)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
123 (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
124 (edit-server
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 79143
diff changeset
125 (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
126 (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
127 (edit-form 1.0 point)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
128 (post
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
129 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
130 (post 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
131 (reply
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
132 (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
133 (article 0.5)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
134 (message 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
135 (forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
136 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
137 (message 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
138 (reply-yank
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
139 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
140 (message 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
141 (mail-bounce
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
142 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
143 (article 0.5)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
144 (message 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
145 (pipe
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
146 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
147 (summary 0.25 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
148 (if gnus-carpal '(summary-carpal 4))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
149 ("*Shell Command Output*" 1.0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
150 (bug
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
151 (vertical 1.0
39354
6bc5624fb330 (gnus-buffer-configuration): Respect `gnus-bug-create-help-buffer'.
Sam Steingold <sds@gnu.org>
parents: 35453
diff changeset
152 (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
153 ("*Gnus Bug*" 1.0 point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
154 (score-trace
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
155 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
156 (summary 0.5 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
157 ("*Score Trace*" 1.0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
158 (score-words
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
159 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
160 (summary 0.5 point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
161 ("*Score Words*" 1.0)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
162 (split-trace
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
163 (vertical 1.0
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
164 (summary 0.5 point)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
165 ("*Split Trace*" 1.0)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
166 (category
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
167 (vertical 1.0
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
168 (category 1.0)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169 (compose-bounce
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
170 (vertical 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
171 (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
172 (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
173 (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
174 (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
175 ("*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
176 (mml-preview
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 79143
diff changeset
177 (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
178 (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
179 (mml-preview 1.0 point))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
180 "Window configuration for all possible Gnus buffers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
181 See the Gnus manual for an explanation of the syntax used.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
182
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
183 (defvar gnus-window-to-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
184 '((group . gnus-group-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
185 (summary . gnus-summary-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
186 (article . gnus-article-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
187 (server . gnus-server-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
188 (browse . "*Gnus Browse Server*")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
189 (edit-group . gnus-group-edit-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
190 (edit-form . gnus-edit-form-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
191 (edit-server . gnus-server-edit-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
192 (group-carpal . gnus-carpal-group-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
193 (summary-carpal . gnus-carpal-summary-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
194 (server-carpal . gnus-carpal-server-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
195 (browse-carpal . gnus-carpal-browse-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
196 (edit-score . gnus-score-edit-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
197 (message . gnus-message-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
198 (mail . gnus-message-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
199 (post-news . gnus-message-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
200 (faq . gnus-faq-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
201 (tree . gnus-tree-buffer)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19521
diff changeset
202 (score-trace . "*Score Trace*")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
203 (split-trace . "*Split Trace*")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
204 (info . gnus-info-buffer)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
205 (category . gnus-category-buffer)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
206 (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
207 (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
208 (mml-preview . mml-preview-buffer))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
209 "Mapping from short symbols to buffer names or buffer variables.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
210
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
211 (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
212 "*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
213 :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
214 :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
215 :type 'hook)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
216
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
217 ;;; Internal variables.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
218
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
219 (defvar gnus-current-window-configuration nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
220 "The most recently set window configuration.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
221
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
222 (defvar gnus-created-frames nil)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
223 (defvar gnus-window-frame-focus nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
224
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
225 (defun gnus-kill-gnus-frames ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
226 "Kill all frames Gnus has created."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
227 (while gnus-created-frames
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
228 (when (frame-live-p (car gnus-created-frames))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
229 ;; We slap a condition-case around this `delete-frame' to ensure
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
230 ;; against errors if we try do delete the single frame that's left.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
231 (ignore-errors
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
232 (delete-frame (car gnus-created-frames))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
233 (pop gnus-created-frames)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
234
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
235 (defun gnus-window-configuration-element (list)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 (while (and list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
237 (not (assq (car list) gnus-window-configuration)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
238 (pop list))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239 (cadr (assq (car list) gnus-window-configuration)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
241 (defun gnus-windows-old-to-new (setting)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
242 ;; First we take care of the really, really old Gnus 3 actions.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
243 (when (symbolp setting)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
244 (setq setting
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
245 ;; Take care of ooold GNUS 3.x values.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
246 (cond ((eq setting 'SelectArticle) 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
247 ((memq setting '(SelectNewsgroup SelectSubject ExpandSubject))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
248 'summary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
249 ((memq setting '(ExitNewsgroup)) 'group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
250 (t setting))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
251 (if (or (listp setting)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
252 (not (and gnus-window-configuration
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
253 (memq setting '(group summary article)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
254 setting
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
255 (let* ((elem
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
256 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
257 ((eq setting 'group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
258 (gnus-window-configuration-element
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
259 '(group newsgroups ExitNewsgroup)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
260 ((eq setting 'summary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
261 (gnus-window-configuration-element
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
262 '(summary SelectNewsgroup SelectSubject ExpandSubject)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
263 ((eq setting 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
264 (gnus-window-configuration-element
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
265 '(article SelectArticle)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
266 (total (apply '+ elem))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
267 (types '(group summary article))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
268 (pbuf (if (eq setting 'newsgroups) 'group 'summary))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
269 (i 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
270 perc out)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
271 (while (< i 3)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
272 (or (not (numberp (nth i elem)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
273 (zerop (nth i elem))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
274 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
275 (setq perc (if (= i 2)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
276 1.0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
277 (/ (float (nth i elem)) total)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
278 (push (if (eq pbuf (nth i types))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
279 (list (nth i types) perc 'point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
280 (list (nth i types) perc))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
281 out)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
282 (incf i))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
283 `(vertical 1.0 ,@(nreverse out)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
284
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
285 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
286 (defun gnus-add-configuration (conf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
287 "Add the window configuration CONF to `gnus-buffer-configuration'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
288 (setq gnus-buffer-configuration
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
289 (cons conf (delq (assq (car conf) gnus-buffer-configuration)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
290 gnus-buffer-configuration))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
291
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
292 (defvar gnus-frame-list nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
293
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
294 (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
295 (cond ((not (symbolp obj))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
296 obj)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
297 ((boundp obj)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
298 (symbol-value obj))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
299 ((fboundp obj)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
300 (funcall obj))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
301 (t
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
302 nil)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
303
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
304 (defun gnus-configure-frame (split &optional window)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
305 "Split WINDOW according to SPLIT."
34193
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
306 (let ((current-window
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
307 (or (get-buffer-window (current-buffer)) (selected-window))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
308 (unless window
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
309 (setq window current-window))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
310 (select-window window)
48588
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 39354
diff changeset
311 ;; This might be an old-style buffer config.
34193
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
312 (when (vectorp split)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
313 (setq split (append split nil)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
314 (when (or (consp (car split))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
315 (vectorp (car split)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
316 (push 1.0 split)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
317 (push 'vertical split))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
318 ;; 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
319 ;; return a new SPLIT.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
320 (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
321 (symbolp (car split)) (fboundp (car split)))
34193
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
322 (setq split (eval split)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
323 (let* ((type (car split))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
324 (subs (cddr split))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
325 (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
326 (total 0)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
327 (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
328 (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
329 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
330 (cond
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
331 ;; Nothing to do here.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
332 ((null split))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
333 ;; Don't switch buffers.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
334 ((null type)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
335 (and (memq 'point split) window))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
336 ;; This is a buffer to be selected.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
337 ((not (memq type '(frame horizontal vertical)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
338 (let ((buffer (cond ((stringp type) type)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
339 (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
340 (unless buffer
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
341 (error "Invalid buffer type: %s" type))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
342 (let ((buf (gnus-get-buffer-create
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
343 (gnus-window-to-buffer-helper buffer))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
344 (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
345 (switch-to-buffer buf)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
346 (when (memq 'frame-focus split)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
347 (setq gnus-window-frame-focus window))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
348 ;; 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
349 (and (memq 'point split) window)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
350 ;; This is a frame split.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
351 ((eq type 'frame)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
352 (unless gnus-frame-list
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
353 (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
354 (let ((i 0)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
355 params frame fresult)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
356 (while (< i (length subs))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
357 ;; 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
358 (setq params (cadr (elt subs i)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
359 ;; It should be a list.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
360 (unless (listp params)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
361 (setq params nil))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
362 ;; Create a new frame?
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
363 (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
364 (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
365 (push frame gnus-created-frames))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
366 ;; Is the old frame still alive?
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
367 (unless (frame-live-p frame)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
368 (setcar (nthcdr i gnus-frame-list)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
369 (setq frame (make-frame params))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
370 ;; 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
371 (select-frame frame)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
372 (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
373 (incf i))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
374 ;; 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
375 (when fresult
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
376 (select-frame (window-frame fresult)))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
377 ;; This is a normal split.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
378 (t
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
379 (when (> (length subs) 0)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
380 ;; 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
381 (while subs
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
382 (setq sub (append (pop subs) nil))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
383 (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
384 (symbolp (car sub)) (fboundp (car sub)))
34193
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
385 (setq sub (eval sub)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
386 (when sub
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
387 (push sub comp-subs)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
388 (setq size (cadar comp-subs))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
389 (cond ((equal size 1.0)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
390 (setq rest (car comp-subs))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
391 (setq s 0))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
392 ((floatp size)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
393 (setq s (floor (* size len))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
394 ((integerp size)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
395 (setq s size))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
396 (t
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
397 (error "Invalid size: %s" size)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
398 ;; 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
399 (cond ((zerop s))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
400 ((eq type 'horizontal)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
401 (setq s (max s window-min-width)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
402 ((eq type 'vertical)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
403 (setq s (max s window-min-height))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
404 (setcar (cdar comp-subs) s)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
405 (incf total s)))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
406 ;; Take care of the "1.0" spec.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
407 (if rest
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
408 (setcar (cdr rest) (- len total))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
409 (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
410 ;; 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
411 ;; fashion.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
412 (setq comp-subs (nreverse comp-subs))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
413 (while comp-subs
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
414 (if (null (cdr comp-subs))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
415 (setq new-win window)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
416 (setq new-win
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
417 (split-window window (cadar comp-subs)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
418 (eq type 'horizontal))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
419 (setq result (or (gnus-configure-frame
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
420 (car comp-subs) window)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
421 result))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
422 (select-window new-win)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
423 (setq window new-win)
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
424 (setq comp-subs (cdr comp-subs))))
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
425 ;; Return the proper window, if any.
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
426 (when result
31766be242f6 (gnus-configure-frame): Save selected window.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34192
diff changeset
427 (select-window result)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
428
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
429 (defvar gnus-frame-split-p nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
430
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
431 (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
432 (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
433 (set-window-configuration setting)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
434 (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
435 (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
436 (setq setting (gnus-windows-old-to-new setting))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
437 (let ((split (if (symbolp setting)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
438 (cadr (assq setting gnus-buffer-configuration))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
439 setting))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
440 all-visible)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
441
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
442 (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
443
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
444 (unless split
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
445 (error "No such setting in `gnus-buffer-configuration': %s" setting))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
446
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
447 (if (and (setq all-visible (gnus-all-windows-visible-p split))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
448 (not force))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
449 ;; All the windows mentioned are already visible, so we just
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
450 ;; put point in the assigned buffer, and do not touch the
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
451 ;; winconf.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
452 (select-window all-visible)
39354
6bc5624fb330 (gnus-buffer-configuration): Respect `gnus-bug-create-help-buffer'.
Sam Steingold <sds@gnu.org>
parents: 35453
diff changeset
453
34192
57a15e35e75b * gnus-msg.el (gnus-msg-mail): COMPOSEFUNC should return t if
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33711
diff changeset
454 ;; Make sure "the other" buffer, nntp-server-buffer, is live.
57a15e35e75b * gnus-msg.el (gnus-msg-mail): COMPOSEFUNC should return t if
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33711
diff changeset
455 (unless (gnus-buffer-live-p nntp-server-buffer)
57a15e35e75b * gnus-msg.el (gnus-msg-mail): COMPOSEFUNC should return t if
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33711
diff changeset
456 (nnheader-init-server-buffer))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
457
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
458 ;; Either remove all windows or just remove all Gnus windows.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
459 (let ((frame (selected-frame)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
460 (unwind-protect
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
461 (if gnus-use-full-window
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
462 ;; We want to remove all other windows.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
463 (if (not gnus-frame-split-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
464 ;; This is not a `frame' split, so we ignore the
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
465 ;; other frames.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
466 (delete-other-windows)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
467 ;; This is a `frame' split, so we delete all windows
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
468 ;; on all frames.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
469 (gnus-delete-windows-in-gnusey-frames))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
470 ;; Just remove some windows.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
471 (gnus-remove-some-windows)
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34193
diff changeset
472 (if (featurep 'xemacs)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34193
diff changeset
473 (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
474 (set-buffer nntp-server-buffer)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
475 (select-frame frame)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
476
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
477 (let (gnus-window-frame-focus)
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34193
diff changeset
478 (if (featurep 'xemacs)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34193
diff changeset
479 (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
480 (set-buffer nntp-server-buffer))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
481 (gnus-configure-frame split)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
482 (run-hooks 'gnus-configure-windows-hook)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
483 (when gnus-window-frame-focus
79143
f6c37512dd9e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
484 (gnus-select-frame-set-input-focus
f6c37512dd9e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
485 (window-frame gnus-window-frame-focus))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
486
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
487 (defun gnus-delete-windows-in-gnusey-frames ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
488 "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
489 (let ((buffers (gnus-buffers)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
490 (mapcar
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
491 (lambda (frame)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
492 (unless (eq (cdr (assq 'minibuffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
493 (frame-parameters frame)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
494 'only)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
495 (select-frame frame)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
496 (let (do-delete)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
497 (walk-windows
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
498 (lambda (window)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
499 (when (memq (window-buffer window) buffers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
500 (setq do-delete t))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
501 (when do-delete
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
502 (delete-other-windows)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
503 (frame-list))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
504
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
505 (defun gnus-all-windows-visible-p (split)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
506 "Say whether all buffers in SPLIT are currently visible.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
507 In particular, the value returned will be the window that
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
508 should have point."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
509 (let ((stack (list split))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
510 (all-visible t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
511 type buffer win buf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
512 (while (and (setq split (pop stack))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
513 all-visible)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
514 ;; Be backwards compatible.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
515 (when (vectorp split)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
516 (setq split (append split nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
517 (when (or (consp (car split))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
518 (vectorp (car split)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
519 (push 1.0 split)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
520 (push 'vertical split))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
521 ;; The SPLIT might be something that is to be evaled to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
522 ;; return a new SPLIT.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
523 (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
524 (symbolp (car split)) (fboundp (car split)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
525 (setq split (eval split)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
526
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
527 (setq type (elt split 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
528 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
529 ;; Nothing here.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
530 ((null split) t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
531 ;; A buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
532 ((not (memq type '(horizontal vertical frame)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
533 (setq buffer (cond ((stringp type) type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
534 (t (cdr (assq type gnus-window-to-buffer)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
535 (unless buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
536 (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
537 (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
538 (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
539 (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
540 (setq all-visible win))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
541 (setq all-visible nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
542 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
543 (when (eq type 'frame)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
544 (setq gnus-frame-split-p t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
545 (setq stack (append (cddr split) stack)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
546 (unless (eq all-visible t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
547 all-visible)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
548
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
549 (defun gnus-window-top-edge (&optional window)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
550 (nth 1 (window-edges window)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
552 (defun gnus-remove-some-windows ()
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
553 (let ((buffers (gnus-buffers))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
554 buf bufs lowest-buf lowest)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
555 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
556 ;; 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
557 (while (setq buf (pop buffers))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
558 (when (get-buffer-window buf)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
559 (push buf bufs)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
560 (pop-to-buffer buf)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
561 (when (or (not lowest)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
562 (< (gnus-window-top-edge) lowest))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
563 (setq lowest (gnus-window-top-edge)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19969
diff changeset
564 lowest-buf buf))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
565 (when lowest-buf
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
566 (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
567 (if (featurep 'xemacs)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34193
diff changeset
568 (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
569 (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
570 (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
571 (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
572
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
573 (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
574 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
575 ((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
576 (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
577 ((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
578 (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
579 (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
580 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
581 (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
582
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
583 (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
584 (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
585 (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
586 (car
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
587 (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
588 (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
589 frames)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
590 (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
591 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 55668
diff changeset
592 (get-buffer-window buffer frame))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
593
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
594 (provide 'gnus-win)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
595
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
596 ;;; gnus-win.el ends here