6a9ce292c171bef3d4b8fe205cae0d2fe472154c
[gnus] / lisp / gnus-win.el
1 ;;; gnus-win.el --- window configuration functions for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000
3 ;;        Free Software Foundation, Inc.
4
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: news
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (eval-when-compile (require 'cl))
30
31 (require 'gnus)
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
60 (defvar gnus-buffer-configuration
61   '((group
62      (vertical 1.0
63                (group 1.0 point)
64                (if gnus-carpal '(group-carpal 4))))
65     (summary
66      (vertical 1.0
67                (summary 1.0 point)
68                (if gnus-carpal '(summary-carpal 4))))
69     (article
70      (cond
71       ((and gnus-use-picons
72             (eq gnus-picons-display-where 'picons))
73        '(frame 1.0
74                (vertical 1.0
75                          (summary 0.25 point)
76                          (if gnus-carpal '(summary-carpal 4))
77                          (article 1.0))
78                (vertical ((height . 5) (width . 15)
79                           (user-position . t)
80                           (left . -1) (top . 1))
81                          (picons 1.0))))
82       (gnus-use-trees
83        '(vertical 1.0
84                   (summary 0.25 point)
85                   (tree 0.25)
86                   (article 1.0)))
87       (t
88        '(vertical 1.0
89                   (summary 0.25 point)
90                   (if gnus-carpal '(summary-carpal 4))
91                   (article 1.0)))))
92     (server
93      (vertical 1.0
94                (server 1.0 point)
95                (if gnus-carpal '(server-carpal 2))))
96     (browse
97      (vertical 1.0
98                (browse 1.0 point)
99                (if gnus-carpal '(browse-carpal 2))))
100     (message
101      (vertical 1.0
102                (message 1.0 point)))
103     (pick
104      (vertical 1.0
105                (article 1.0 point)))
106     (info
107      (vertical 1.0
108                (info 1.0 point)))
109     (summary-faq
110      (vertical 1.0
111                (summary 0.25)
112                (faq 1.0 point)))
113     (edit-article
114      (vertical 1.0
115                (article 1.0 point)))
116     (edit-form
117      (vertical 1.0
118                (group 0.5)
119                (edit-form 1.0 point)))
120     (edit-score
121      (vertical 1.0
122                (summary 0.25)
123                (edit-score 1.0 point)))
124     (post
125      (vertical 1.0
126                (post 1.0 point)))
127     (reply
128      (vertical 1.0
129                (article-copy 0.5)
130                (message 1.0 point)))
131     (forward
132      (vertical 1.0
133                (message 1.0 point)))
134     (reply-yank
135      (vertical 1.0
136                (message 1.0 point)))
137     (mail-bounce
138      (vertical 1.0
139                (article 0.5)
140                (message 1.0 point)))
141     (pipe
142      (vertical 1.0
143                (summary 0.25 point)
144                (if gnus-carpal '(summary-carpal 4))
145                ("*Shell Command Output*" 1.0)))
146     (bug
147      (vertical 1.0
148                ("*Gnus Help Bug*" 0.5)
149                ("*Gnus Bug*" 1.0 point)))
150     (score-trace
151      (vertical 1.0
152                (summary 0.5 point)
153                ("*Score Trace*" 1.0)))
154     (score-words
155      (vertical 1.0
156                (summary 0.5 point)
157                ("*Score Words*" 1.0)))
158     (split-trace
159      (vertical 1.0
160                (summary 0.5 point)
161                ("*Split Trace*" 1.0)))
162     (category
163      (vertical 1.0
164                (category 1.0)))
165     (compose-bounce
166      (vertical 1.0
167                (article 0.5)
168                (message 1.0 point))))
169   "Window configuration for all possible Gnus buffers.
170 See the Gnus manual for an explanation of the syntax used.")
171
172 (defvar gnus-window-to-buffer
173   '((group . gnus-group-buffer)
174     (summary . gnus-summary-buffer)
175     (article . gnus-article-buffer)
176     (server . gnus-server-buffer)
177     (browse . "*Gnus Browse Server*")
178     (edit-group . gnus-group-edit-buffer)
179     (edit-form . gnus-edit-form-buffer)
180     (edit-server . gnus-server-edit-buffer)
181     (group-carpal . gnus-carpal-group-buffer)
182     (summary-carpal . gnus-carpal-summary-buffer)