+(defvar smiley-data-directory)
+
+(defcustom smiley-style
+ (if (or (and (fboundp 'face-attribute)
+ (>= (face-attribute 'default :height) 160))
+ (and (fboundp 'face-height)
+ (>= (face-height 'default) 14)))
+ 'medium
+ 'low-color)
+ "Smiley style."
+ :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14
+ (const :tag "medium, ~10 colors" medium) ;; 16x16
+ (const :tag "dull, grayscale" grayscale));; 14x14
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (setq smiley-data-directory (smiley-directory))
+ (smiley-update-cache))
+ :initialize 'custom-initialize-default
+ :version "23.1" ;; No Gnus
+ :group 'smiley)
+
+;; For compatibility, honor the variable `smiley-data-directory' if the user
+;; has set it.
+
+(defun smiley-directory (&optional style)
+ "Return a the location of the smiley faces files.
+STYLE specifies which style to use, see `smiley-style'. If STYLE
+is nil, use `smiley-style'."
+ (unless style (setq style smiley-style))
+ (nnheader-find-etc-directory
+ (concat "images/smilies"
+ (cond ((eq smiley-style 'low-color) "")
+ ((eq smiley-style 'medium) "/medium")
+ ((eq smiley-style 'grayscale) "/grayscale")))))
+
+(defcustom smiley-data-directory (smiley-directory)