/[emacs]/emacs/lisp/gnus/gnus-win.el
ViewVC logotype

Diff of /emacs/lisp/gnus/gnus-win.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10.8.3 by miles, Tue Jul 6 09:23:45 2004 UTC revision 1.10.8.4 by miles, Thu Sep 16 00:12:16 2004 UTC
# Line 1  Line 1 
1  ;;; gnus-win.el --- window configuration functions for Gnus  ;;; gnus-win.el --- window configuration functions for Gnus
2  ;; Copyright (C) 1996, 97, 98, 1999, 2000, 02, 2004  ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3  ;;        Free Software Foundation, Inc.  ;;        Free Software Foundation, Inc.
4    
5  ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>  ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
# Line 29  Line 29 
29  (eval-when-compile (require 'cl))  (eval-when-compile (require 'cl))
30    
31  (require 'gnus)  (require 'gnus)
32    (require 'gnus-util)
33    
34  (defgroup gnus-windows nil  (defgroup gnus-windows nil
35    "Window configuration."    "Window configuration."
# Line 57  Line 58 
58    :group 'gnus-windows    :group 'gnus-windows
59    :type 'boolean)    :type 'boolean)
60    
61    (defcustom gnus-use-frames-on-any-display nil
62      "*If non-nil, frames on all displays will be considered useable by Gnus.
63    When nil, only frames on the same display as the selected frame will be
64    used to display Gnus windows."
65      :group 'gnus-windows
66      :type 'boolean)
67    
68  (defvar gnus-buffer-configuration  (defvar gnus-buffer-configuration
69    '((group    '((group
70       (vertical 1.0       (vertical 1.0
# Line 68  Line 76 
76                 (if gnus-carpal '(summary-carpal 4))))                 (if gnus-carpal '(summary-carpal 4))))
77      (article      (article
78       (cond       (cond
       ((and gnus-use-picons  
             (eq gnus-picons-display-where 'picons))  
        '(frame 1.0  
                (vertical 1.0  
                          (summary 0.25 point)  
                          (if gnus-carpal '(summary-carpal 4))  
                          (article 1.0))  
                (vertical ((height . 5) (width . 15)  
                           (user-position . t)  
                           (left . -1) (top . 1))  
                          (picons 1.0))))  
79        (gnus-use-trees        (gnus-use-trees
80         '(vertical 1.0         '(vertical 1.0
81                    (summary 0.25 point)                    (summary 0.25 point)
# Line 126  Line 123 
123                 (post 1.0 point)))                 (post 1.0 point)))
124      (reply      (reply
125       (vertical 1.0       (vertical 1.0
126                 (article-copy 0.5)                 (article 0.5)
127                 (message 1.0 point)))                 (message 1.0 point)))
128      (forward      (forward
129       (vertical 1.0       (vertical 1.0
# Line 165  Line 162 
162      (compose-bounce      (compose-bounce
163       (vertical 1.0       (vertical 1.0
164                 (article 0.5)                 (article 0.5)
165                 (message 1.0 point))))                 (message 1.0 point)))
166        (display-term
167          (vertical 1.0
168                    ("*display*" 1.0))))
169    "Window configuration for all possible Gnus buffers.    "Window configuration for all possible Gnus buffers.
170  See the Gnus manual for an explanation of the syntax used.")  See the Gnus manual for an explanation of the syntax used.")
171    
# Line 187  See the Gnus manual for an explanation o Line 187  See the Gnus manual for an explanation o
187      (mail . gnus-message-buffer)      (mail . gnus-message-buffer)
188      (post-news . gnus-message-buffer)      (post-news . gnus-message-buffer)
189      (faq . gnus-faq-buffer)      (faq . gnus-faq-buffer)
     (picons . gnus-picons-buffer-name)  
190      (tree . gnus-tree-buffer)      (tree . gnus-tree-buffer)
191      (score-trace . "*Score Trace*")      (score-trace . "*Score Trace*")
192      (split-trace . "*Split Trace*")      (split-trace . "*Split Trace*")
# Line 197  See the Gnus manual for an explanation o Line 196  See the Gnus manual for an explanation o
196      (draft . gnus-draft-buffer))      (draft . gnus-draft-buffer))
197    "Mapping from short symbols to buffer names or buffer variables.")    "Mapping from short symbols to buffer names or buffer variables.")
198    
199    (defcustom gnus-configure-windows-hook nil
200      "*A hook called when configuring windows."
201      :group 'gnus-windows
202      :type 'hook)
203    
204  ;;; Internal variables.  ;;; Internal variables.
205    
206  (defvar gnus-current-window-configuration nil  (defvar gnus-current-window-configuration nil
# Line 301  See the Gnus manual for an explanation o Line 305  See the Gnus manual for an explanation o
305      ;; The SPLIT might be something that is to be evaled to      ;; The SPLIT might be something that is to be evaled to
306      ;; return a new SPLIT.      ;; return a new SPLIT.
307      (while (and (not (assq (car split) gnus-window-to-buffer))      (while (and (not (assq (car split) gnus-window-to-buffer))
308                  (gnus-functionp (car split)))                  (functionp (car split)))
309        (setq split (eval split)))        (setq split (eval split)))
310      (let* ((type (car split))      (let* ((type (car split))
311             (subs (cddr split))             (subs (cddr split))
# Line 364  See the Gnus manual for an explanation o Line 368  See the Gnus manual for an explanation o
368            (while subs            (while subs
369              (setq sub (append (pop subs) nil))              (setq sub (append (pop subs) nil))
370              (while (and (not (assq (car sub) gnus-window-to-buffer))              (while (and (not (assq (car sub) gnus-window-to-buffer))
371                          (gnus-functionp (car sub)))                          (functionp (car sub)))
372                (setq sub (eval sub)))                (setq sub (eval sub)))
373              (when sub              (when sub
374                (push sub comp-subs)                (push sub comp-subs)
# Line 447  See the Gnus manual for an explanation o Line 451  See the Gnus manual for an explanation o
451                        ;; This is not a `frame' split, so we ignore the                        ;; This is not a `frame' split, so we ignore the
452                        ;; other frames.                        ;; other frames.
453                        (delete-other-windows)                        (delete-other-windows)
454                      ;; This is a `frame' split, so we delete all windows                    ;; This is a `frame' split, so we delete all windows
455                      ;; on all frames.                      ;; on all frames.
456                      (gnus-delete-windows-in-gnusey-frames))                      (gnus-delete-windows-in-gnusey-frames))
457                  ;; Just remove some windows.                  ;; Just remove some windows.
# Line 462  See the Gnus manual for an explanation o Line 466  See the Gnus manual for an explanation o
466                (switch-to-buffer nntp-server-buffer)                (switch-to-buffer nntp-server-buffer)
467              (set-buffer nntp-server-buffer))              (set-buffer nntp-server-buffer))
468            (gnus-configure-frame split)            (gnus-configure-frame split)
469              (run-hooks 'gnus-configure-windows-hook)
470            (when gnus-window-frame-focus            (when gnus-window-frame-focus
471              (select-frame (window-frame gnus-window-frame-focus))))))))              (select-frame (window-frame gnus-window-frame-focus))))))))
472    
# Line 502  should have point." Line 507  should have point."
507        ;; The SPLIT might be something that is to be evaled to        ;; The SPLIT might be something that is to be evaled to
508        ;; return a new SPLIT.        ;; return a new SPLIT.
509        (while (and (not (assq (car split) gnus-window-to-buffer))        (while (and (not (assq (car split) gnus-window-to-buffer))
510                    (gnus-functionp (car split)))                    (functionp (car split)))
511          (setq split (eval split)))          (setq split (eval split)))
512    
513        (setq type (elt split 0))        (setq type (elt split 0))
# Line 516  should have point." Line 521  should have point."
521          (unless buffer          (unless buffer
522            (error "Invalid buffer type: %s" type))            (error "Invalid buffer type: %s" type))
523          (if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer)))          (if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer)))
524                   (setq win (get-buffer-window buf 0)))                   (setq win (gnus-get-buffer-window buf t)))
525              (if (memq 'point split)              (if (memq 'point split)
526                  (setq all-visible win))                  (setq all-visible win))
527            (setq all-visible nil)))            (setq all-visible nil)))
# Line 548  should have point." Line 553  should have point."
553          (if (featurep 'xemacs)          (if (featurep 'xemacs)
554              (switch-to-buffer nntp-server-buffer)              (switch-to-buffer nntp-server-buffer)
555            (set-buffer nntp-server-buffer)))            (set-buffer nntp-server-buffer)))
556        (mapcar (lambda (b) (delete-windows-on b t)) bufs))))        (mapcar (lambda (b) (delete-windows-on b t))
557                  (delq lowest-buf bufs)))))
558    
559    (eval-and-compile
560      (cond
561       ((fboundp 'frames-on-display-list)
562        (defalias 'gnus-frames-on-display-list 'frames-on-display-list))
563       ((and (featurep 'xemacs) (fboundp 'frame-device))
564        (defun gnus-frames-on-display-list ()
565          (apply 'filtered-frame-list 'identity (list (frame-device nil)))))
566       (t
567        (defalias 'gnus-frames-on-display-list 'frame-list))))
568    
569    (defun gnus-get-buffer-window (buffer &optional frame)
570      (cond ((and (null gnus-use-frames-on-any-display)
571                  (memq frame '(t 0 visible)))
572             (car
573              (let ((frames (gnus-frames-on-display-list)))
574                (gnus-remove-if (lambda (win) (not (memq (window-frame win)
575                                                         frames)))
576                                (get-buffer-window-list buffer nil frame)))))
577            (t
578             (get-buffer-window buffer frame))))
579    
580  (provide 'gnus-win)  (provide 'gnus-win)
581    

Legend:
Removed from v.1.10.8.3  
changed lines
  Added in v.1.10.8.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26