* message.el: Require gmm-utils, remove autoloads.
authorReiner Steib <Reiner.Steib@gmx.de>
Wed, 1 Mar 2006 16:51:17 +0000 (16:51 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Wed, 1 Mar 2006 16:51:17 +0000 (16:51 +0000)
(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.

lisp/ChangeLog
lisp/gmm-utils.el
lisp/gnus-group.el
lisp/gnus-sum.el
lisp/message.el

index e213bf8..761e843 100644 (file)
@@ -1,5 +1,24 @@
 2006-03-01  Reiner Steib  <Reiner.Steib@gmx.de>
 
+       * 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.
index 7a29fb3..89e1b99 100644 (file)
@@ -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)
 
 ;; arch-tag: e0b60920-2ce6-40c1-bfc0-cadbbe26b602
index 545df6d..8c8a0e7 100644 (file)
@@ -1029,8 +1029,9 @@ Setter function for custom variables."
     (with-current-buffer gnus-group-buffer
       (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
@@ -1074,6 +1075,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).
 
index d8a1b54..995bf42 100644 (file)
@@ -2650,8 +2650,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
@@ -2704,7 +2705,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).
 
index af8b019..0d9950c 100644 (file)
@@ -39,6 +39,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.
@@ -1663,8 +1664,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")
@@ -6716,8 +6715,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
@@ -6750,6 +6750,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).