+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.
+ (gnus-group-tool-bar-update): Remove redraw check.
+ (gnus-group-make-tool-bar): Add redraw check.
+
2006-03-01 Michael Piotrowski <mxp@dynalabs.de> (tiny change)
* gnus-art.el (gnus-button): Add missing parentheses.
: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
;; 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'.")
`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
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)))))
(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
;; 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.
;; (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
(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).
;; 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))
(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
"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).
(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.
(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")
;; 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
(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).