+2006-03-02 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gmm-utils.el (gmm-tool-bar-style): Test tool-bar-mode and
+ display-visual-class instead of display-color-cells.
+
2006-03-02 Katsumi Yamaoka <yamaoka@jpl.org>
* dgnushack.el: Autoload customize-group for XEmacs.
:tag "Other"
(symbol :tag "Icon item")))))
-(defcustom gmm-tool-bar-style (if (> (display-color-cells) 256)
- 'gnome
- 'retro)
+;; (defun gmm-color-cells (&optional display)
+;; "Return the number of color cells supported by DISPLAY.
+;; Compatibility function."
+;; ;; `display-color-cells' doesn't return more than 256 even if color depth is
+;; ;; > 8 in Emacs 21.
+;; ;;
+;; ;; Feel free to add proper XEmacs support.
+;; (let* ((cells (and (fboundp 'display-color-cells)
+;; (display-color-cells display)))
+;; (plane (and (fboundp 'x-display-planes)
+;; (ash 1 (x-display-planes))))
+;; (none -1))
+;; (max (if (integerp cells) cells none)
+;; (if (integerp plane) plane none))))
+
+(defcustom gmm-tool-bar-style
+ (if (and (boundp 'tool-bar-mode)
+ tool-bar-mode
+ (and (fboundp 'display-visual-class)
+ (not (memq (display-visual-class)
+ (list 'static-gray 'gray-scale
+ 'static-color 'pseudo-color)))))
+ 'gnome
+ 'retro)
"Prefered tool bar style."
:type '(choice (const :tag "GNOME style" 'gnome)
(const :tag "Retro look" 'retro))
(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."