From a287c33b2c471beb5b1553ae3b437d3a7d63a8e9 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 10 Nov 2005 06:32:48 +0000 Subject: [PATCH] Synch to No Gnus 200511100632. --- lisp/ChangeLog | 10 +++++ lisp/gnus-xmas.el | 107 +++++++++++++++++++++++++++++++++++++++++++---------- texi/ChangeLog | 5 +++ texi/gnus.texi | 16 ++++++-- 4 files changed, 115 insertions(+), 23 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c8447e..1e627e0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2005-11-10 Katsumi Yamaoka + + * gnus-xmas.el (gnus-xmas-update-toolbars): New function. + (gnus-use-toolbar): Change the valid values into default, top, + bottom, left, and right. + (gnus-toolbar-thickness): New variable. + (gnus-xmas-setup-toolbar): New function. + (gnus-xmas-setup-group-toolbar): Use it. + (gnus-xmas-setup-summary-toolbar): Use it. + 2005-11-10 Lars Magne Ingebrigtsen * gnus-start.el (gnus-1): Add "native" to diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index 37037c2..0962b9a 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -602,17 +602,53 @@ the resulting string may be narrower than END-COLUMN. ;;; The toolbar. -(defcustom gnus-use-toolbar (if (featurep 'toolbar) - 'default-toolbar - nil) - "*If nil, do not use a toolbar. -If it is non-nil, it must be a toolbar. The five valid values are -`default-toolbar', `top-toolbar', `bottom-toolbar', -`right-toolbar', and `left-toolbar'." - :type '(choice (const default-toolbar) - (const top-toolbar) (const bottom-toolbar) - (const left-toolbar) (const right-toolbar) +(defun gnus-xmas-update-toolbars () + "Update the toolbars' appearance." + (when (and (not noninteractive) + (featurep 'gnus-xmas)) + (save-excursion + (dolist (buffer (buffer-list)) + (set-buffer buffer) + (cond ((eq major-mode 'gnus-group-mode) + (gnus-xmas-setup-group-toolbar)) + ((eq major-mode 'gnus-summary-mode) + (gnus-xmas-setup-summary-toolbar))))))) + +(defcustom gnus-use-toolbar (if (featurep 'toolbar) 'default) + "*Position to display the toolbar. Nil means do not use a toolbar. +If it is non-nil, it should be one of the symbols `default', `top', +`bottom', `right', and `left'. `default' means to use the default +toolbar, the rest mean to display the toolbar on the place which those +names show." + :type '(choice (const default) + (const top) (const bottom) (const left) (const right) (const :tag "no toolbar" nil)) + :set (lambda (symbol value) + (set-default + symbol + (if (or (not value) + (memq value (list 'default 'top 'bottom 'right 'left))) + value + 'default)) + (gnus-xmas-update-toolbars)) + :group 'gnus-xmas) + +(defcustom gnus-toolbar-thickness + (if (featurep 'toolbar) + (cons (specifier-instance default-toolbar-height) + (specifier-instance default-toolbar-width))) + "*Cons of the height and the width specifying the thickness of a toolbar. +The height is used for the toolbar displayed on the top or the bottom, +the width is used for the toolbar displayed on the right or the left." + :type '(cons :tag "height & width" + (integer :tag "height") (integer :tag "width")) + :set (lambda (symbol value) + (set-default + symbol + (if (and (consp value) (natnump (car value)) (natnump (cdr value))) + value + '(37 . 40))) + (gnus-xmas-update-toolbars)) :group 'gnus-xmas) (defvar gnus-group-toolbar @@ -694,19 +730,50 @@ If it is non-nil, it must be a toolbar. The five valid values are [gnus-summary-exit gnus-summary-exit t "Exit this summary"]) "The summary buffer mail toolbar.") +(defun gnus-xmas-setup-toolbar (toolbar) + (when (featurep 'toolbar) + (if (and gnus-use-toolbar + (message-xmas-setup-toolbar toolbar nil "gnus")) + (let* ((bar (or (intern-soft (format "%s-toolbar" gnus-use-toolbar)) + 'default-toolbar)) + (bars (delq bar (list 'top-toolbar 'bottom-toolbar + 'right-toolbar 'left-toolbar))) + hw) + (while bars + (remove-specifier (symbol-value (pop bars)) (current-buffer))) + (unless (eq bar 'default-toolbar) + (set-specifier default-toolbar nil (current-buffer))) + (set-specifier (symbol-value bar) toolbar (current-buffer)) + (when (setq hw (cdr (assq gnus-use-toolbar + '((default . default-toolbar-height) + (top . top-toolbar-height) + (bottom . bottom-toolbar-height))))) + (set-specifier (symbol-value hw) (car gnus-toolbar-thickness) + (current-buffer))) + (when (setq hw (cdr (assq gnus-use-toolbar + '((default . default-toolbar-width) + (right . right-toolbar-width) + (left . left-toolbar-width))))) + (set-specifier (symbol-value hw) (cdr gnus-toolbar-thickness) + (current-buffer)))) + (set-specifier default-toolbar nil (current-buffer)) + (remove-specifier top-toolbar (current-buffer)) + (remove-specifier bottom-toolbar (current-buffer)) + (remove-specifier right-toolbar (current-buffer)) + (remove-specifier left-toolbar (current-buffer))) + (set-specifier default-toolbar-visible-p t (current-buffer)) + (set-specifier top-toolbar-visible-p t (current-buffer)) + (set-specifier bottom-toolbar-visible-p t (current-buffer)) + (set-specifier right-toolbar-visible-p t (current-buffer)) + (set-specifier left-toolbar-visible-p t (current-buffer)))) + (defun gnus-xmas-setup-group-toolbar () - (and gnus-use-toolbar - (message-xmas-setup-toolbar gnus-group-toolbar nil "gnus") - (set-specifier (symbol-value gnus-use-toolbar) - (cons (current-buffer) gnus-group-toolbar)))) + (gnus-xmas-setup-toolbar gnus-group-toolbar)) (defun gnus-xmas-setup-summary-toolbar () - (let ((bar (if (gnus-news-group-p gnus-newsgroup-name) - gnus-summary-toolbar gnus-summary-mail-toolbar))) - (and gnus-use-toolbar - (message-xmas-setup-toolbar bar nil "gnus") - (set-specifier (symbol-value gnus-use-toolbar) - (cons (current-buffer) bar))))) + (gnus-xmas-setup-toolbar (if (gnus-news-group-p gnus-newsgroup-name) + gnus-summary-toolbar + gnus-summary-mail-toolbar))) (defun gnus-xmas-mail-strip-quoted-names (address) "Protect mail-strip-quoted-names from nil input. diff --git a/texi/ChangeLog b/texi/ChangeLog index 94e4a48..8ea95ad 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2005-11-10 Katsumi Yamaoka + + * gnus.texi (XVarious): Fix description of gnus-use-toolbar; add + new variable gnus-toolbar-thickness. + 2005-11-09 Katsumi Yamaoka * gnus.texi (Agent and flags): Add it to the detailmenu. diff --git a/texi/gnus.texi b/texi/gnus.texi index be739a3..5a79d5a 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -22775,9 +22775,19 @@ default. @item gnus-use-toolbar @vindex gnus-use-toolbar -If @code{nil}, don't display toolbars. If non-@code{nil}, it should be -one of @code{default-toolbar}, @code{top-toolbar}, @code{bottom-toolbar}, -@code{right-toolbar}, or @code{left-toolbar}. +This variable specifies the position to display the toolbar. If +@code{nil}, don't display toolbars. If it is non-nil, it should be one +of the symbols @code{default}, @code{top}, @code{bottom}, @code{right}, +and @code{left}. @code{default} means to use the default toolbar, the +rest mean to display the toolbar on the place which those names show. +The default is @code{default}. + +@item gnus-toolbar-thickness +@vindex gnus-toolbar-thickness +Cons of the height and the width specifying the thickness of a toolbar. +The height is used for the toolbar displayed on the top or the bottom, +the width is used for the toolbar displayed on the right or the left. +The default is that of the default toolbar. @item gnus-group-toolbar @vindex gnus-group-toolbar -- 1.7.10.4