From: yamaoka Date: Wed, 1 Mar 2006 22:13:30 +0000 (+0000) Subject: Synch to No Gnus 200603011651. X-Git-Tag: t-gnus-6_17_4-quimby-~65 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2424277057b3f6c486e130f3cd12a2563ae943b6;p=elisp%2Fgnus.git- Synch to No Gnus 200603011651. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52333a2..b71fc58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,30 @@ +2006-03-01 Reiner Steib + + * message.el: Require gmm-utils, remove autoloads. + (message-tool-bar): Set default based on + gmm-tool-bar-style. + (message-tool-bar-gnome): Add gmm-customize-mode. + + * gnus-sum.el (gnus-summary-tool-bar): Set default based on + gmm-tool-bar-style. + (gnus-summary-tool-bar-gnome): Add gmm-customize-mode. + + * gnus-group.el (gnus-group-tool-bar): Set default based on + gmm-tool-bar-style. + (gnus-group-tool-bar-gnome): Add gmm-customize-mode. + + * gmm-utils.el (gmm-image-directory): Rename variable from + gmm-image-load-path. + (gmm-image-load-path): Use gmm-image-directory. + (gmm-customize-mode): New function. + (gmm-tool-bar-style): New variable. + + * gnus-group.el (gnus-group-redraw-when-idle): Rename from + gnus-group-redraw-line-number. + (gnus-group-redraw-check): Simplify. + (gnus-group-tool-bar-update): Remove redraw check. + (gnus-group-make-tool-bar): Add redraw check. + 2006-03-01 Michael Piotrowski (tiny change) * gnus-art.el (gnus-button): Add missing parentheses. diff --git a/lisp/gmm-utils.el b/lisp/gmm-utils.el index 393d213..03e416e 100644 --- a/lisp/gmm-utils.el +++ b/lisp/gmm-utils.el @@ -176,6 +176,14 @@ This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility." :tag "Other" (symbol :tag "Icon item"))))) +(defcustom gmm-tool-bar-style (if (> (display-color-cells) 256) + 'gnome + 'retro) + "Prefered tool bar style." + :type '(choice (const :tag "GNOME style" 'gnome) + (const :tag "Retro look" 'retro)) + :group 'gmm) + (defvar tool-bar-map) ;;;###autoload @@ -269,7 +277,7 @@ This function returns nil on those systems." ;; From MH-E with modifications: -(defvar gmm-image-load-path nil +(defvar gmm-image-directory nil "Directory where images are found. See the function `gmm-image-load-path'.") @@ -285,14 +293,14 @@ path to IMAGE. If PATH is given, it is used instead of `load-path'." (unless library (error "No library specified.")) (unless image (error "No image specified.")) - (cond (gmm-image-load-path) ;; User setting exists. + (cond (gmm-image-directory) ;; User setting exists. ((let (gmm-library-name d1ei d2ei) ;; Try relative setting ;; First, find library in the load-path. (setq gmm-library-name (locate-library library)) (if (not gmm-library-name) (error "Cannot find library `%s' in load-path" library)) - ;; And then set gmm-image-load-path relative to that. + ;; And then set gmm-image-directory relative to that. (setq ;; Go down 2 levels... d2ei (expand-file-name @@ -302,7 +310,7 @@ path to IMAGE. If PATH is given, it is used instead of d1ei (expand-file-name (concat (file-name-directory gmm-library-name) "../etc/images"))) - (setq gmm-image-load-path + (setq gmm-image-directory ;; Set it to nil if image is not found... (cond ((file-exists-p (expand-file-name image d2ei)) d2ei) ((file-exists-p (expand-file-name image d1ei)) d1ei))))) @@ -320,26 +328,37 @@ path to IMAGE. If PATH is given, it is used instead of (while (setq parent (file-name-directory img)) (setq img (directory-file-name parent) dir (expand-file-name "../" dir))) - (setq gmm-image-load-path dir)))))) + (setq gmm-image-directory dir)))))) ;; - (unless (file-exists-p gmm-image-load-path) - (error "Directory `%s' in gmm-image-load-path does not exist" - gmm-image-load-path)) - (unless (file-exists-p (expand-file-name image gmm-image-load-path)) - (error "Directory `%s' in gmm-image-load-path does not contain image `%s'." - gmm-image-load-path image)) + (unless (file-exists-p gmm-image-directory) + (error "Directory `%s' in gmm-image-directory does not exist" + gmm-image-directory)) + (unless (file-exists-p (expand-file-name image gmm-image-directory)) + (error "Directory `%s' in gmm-image-directory does not contain image `%s'." + gmm-image-directory image)) ;; Return augmented `image-load-path' or `load-path'. (cond ((and path (symbolp path)) - (nconc (list gmm-image-load-path) - (delete gmm-image-load-path + (nconc (list gmm-image-directory) + (delete gmm-image-directory (if (boundp path) (copy-sequence (symbol-value path)) nil)))) (t - (nconc (list gmm-image-load-path) - (delete gmm-image-load-path + (nconc (list gmm-image-directory) + (delete gmm-image-directory (copy-sequence load-path)))))) + +(defun gmm-customize-mode (&optional mode) + "Customize customization group for MODE. +If mode is nil, use `major-mode' of the curent buffer." + (interactive) + (customize-group + (or mode + (intern (let ((mode (symbol-name major-mode))) + (string-match "^\\(.+\\)-mode$" mode) + (match-string 1 mode)))))) + (provide 'gmm-utils) ;;; gmm-utils.el ends here diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index deda7e0..aa42b83 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1011,28 +1011,22 @@ simple manner.") ;; Work around for Emacs not updating the tool bar, see ; http://www.google.com/groups?as_umsgid=v9u0an3hti.fsf@marauder.physik.uni-ulm.de -(defvar gnus-group-redraw-line-number nil +(defvar gnus-group-redraw-when-idle 2 "When non-nil, redraw the Group buffer frame when idle. Internal variable.") ;; Don't make this customizable yet. (defun gnus-group-redraw-check () "Check if we need to redraw the frame." - (when (and gnus-group-redraw-line-number + (when (and gnus-group-redraw-when-idle (not (featurep 'xemacs)) (boundp 'tool-bar-mode) tool-bar-mode) - (let ((no (if (fboundp 'line-number-at-pos) ;; Emacs 22 only - (line-number-at-pos) - ;; Not equivalent to `line-number-at-pos' but good enough - ;; here: - (1+ (count-lines (point-min) (point)))))) - (unless (eq gnus-group-redraw-line-number no) - (setq gnus-group-redraw-line-number no) - ;; (run-with-idle-timer 1 nil 'menu-bar-update-buffers t) - ;; (run-with-idle-timer 1 nil 'redraw-frame (selected-frame)) - (run-with-idle-timer 1 nil 'force-window-update) - t)))) + ;;(run-with-idle-timer gnus-group-redraw-when-idle + ;; nil 'redraw-frame (selected-frame)) + (run-with-idle-timer gnus-group-redraw-when-idle + nil 'force-window-update) + t)) (defun gnus-group-tool-bar-update (&optional symbol value) "Update group buffer toolbar. @@ -1043,13 +1037,11 @@ Setter function for custom variables." ;; (use-local-map gnus-group-mode-map) (when (gnus-alive-p) (with-current-buffer gnus-group-buffer - (when gnus-group-redraw-line-number - (add-to-list (make-local-variable 'post-command-hook) - 'gnus-group-redraw-check)) (gnus-group-make-tool-bar t)))) -;; The default will be changed when the new icons have been checked in: -(defcustom gnus-group-tool-bar 'gnus-group-tool-bar-retro +(defcustom gnus-group-tool-bar (if (eq gmm-tool-bar-style 'gnome) + 'gnus-group-tool-bar-gnome + 'gnus-group-tool-bar-retro) "Specifies the Gnus group tool bar. It can be either a list or a symbol refering to a list. See @@ -1093,6 +1085,7 @@ Pre-defined symbols include `gnus-group-tool-bar-gnome' and (gnus-group-prev-unread-group "left-arrow") (gnus-group-next-unread-group "right-arrow") (gnus-group-exit "exit") + (gmm-customize-mode "preferences" t :help "Edit mode preferences") (gnus-info-find-node "help")) "List of functions for the group tool bar (GNOME style). @@ -1153,6 +1146,9 @@ When FORCE, rebuild the tool bar." ;; The Gnus 5.10.6 code checked (default-value 'tool-bar-mode). ;; Why? --rsteib (or (not gnus-group-tool-bar-map) force)) + (when gnus-group-redraw-when-idle + (add-to-list (make-local-variable 'post-command-hook) + 'gnus-group-redraw-check)) (let* ((load-path (gmm-image-load-path "gnus" "gnus/toggle-subscription.xpm" 'load-path)) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 34794e2..7ab3259 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -2631,8 +2631,9 @@ Setter function for custom variables." (with-current-buffer gnus-summary-buffer (gnus-summary-make-tool-bar)))) -;; The default will be changed when the new icons have been checked in: -(defcustom gnus-summary-tool-bar 'gnus-summary-tool-bar-retro +(defcustom gnus-summary-tool-bar (if (eq gmm-tool-bar-style 'gnome) + 'gnus-summary-tool-bar-gnome + 'gnus-summary-tool-bar-retro) "Specifies the Gnus summary tool bar. It can be either a list or a symbol refering to a list. See @@ -2685,7 +2686,7 @@ Pre-defined symbols include `gnus-summary-tool-bar-gnome' and "mail/not-spam" nil :visible (spam-group-spam-contents-p gnus-newsgroup-name)) ;; (gnus-summary-exit "exit") - ;; (customize-group 'gnus-summary) "preferences" + (gmm-customize-mode "preferences" t :help "Edit mode preferences") (gnus-info-find-node "help")) "List of functions for the summary tool bar (GNOME style). diff --git a/lisp/message.el b/lisp/message.el index b3cafdf..be7d158 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -46,6 +46,7 @@ (require 'canlock) (require 'mailheader) (require 'nnheader) +(require 'gmm-utils) ;; This is apparently necessary even though things are autoloaded. ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better ;; require mailabbrev here. @@ -1872,8 +1873,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." (autoload 'gnus-request-post "gnus-int") (autoload 'gnus-server-string "gnus") (autoload 'idna-to-ascii "idna") - (autoload 'gmm-tool-bar-from-list "gmm-utils") - (autoload 'gmm-image-load-path "gmm-utils") (autoload 'message-setup-toolbar "messagexmas") (autoload 'mh-new-draft-name "mh-comp") (autoload 'mh-send-letter "mh-comp") @@ -7436,8 +7435,9 @@ Setter function for custom variables." ;; When used as ":set" function: (set-default symbol value))) -;; The default will be changed when the new icons have been checked in: -(defcustom message-tool-bar 'message-tool-bar-retro +(defcustom message-tool-bar (if (eq gmm-tool-bar-style 'gnome) + 'message-tool-bar-gnome + 'message-tool-bar-retro) "Specifies the message mode tool bar. It can be either a list or a symbol refering to a list. See @@ -7470,6 +7470,7 @@ Pre-defined symbols include `message-tool-bar-gnome' and (message-insert-importance-high "important" nil :visible nil) (message-insert-importance-low "unimportant" nil :visible nil) (message-insert-disposition-notification-to "receipt" nil :visible nil) + (gmm-customize-mode "preferences" t :help "Edit mode preferences") (message-info "help" t :help "Message manual")) "List of items for the message tool bar (GNOME style).