From: yamaoka Date: Wed, 9 Jan 2002 06:16:35 +0000 (+0000) Subject: * gnus.el: Don't autoload "gnus-bitmap". X-Git-Tag: t-gnus-6_15_5-01-quimby~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04ba7c897b94a89ecad46bc76064404804cc239f;p=elisp%2Fgnus.git- * gnus.el: Don't autoload "gnus-bitmap". * gnus-ems.el: Autoload "smiley-mule" if running Emacs version is less than 21. * gnus-art.el (gnus-article-smiley-display): Remove. (gnus-treat-smiley): Reload "smiley-ems" or "smiley-mule" if needed. (gnus-treat-display-smileys): Use `gnus-image-type-available-p'. (gnus-article-smiley-mule-loaded-p): New internal variable. (gnus-article-should-use-smiley-mule): New user option. --- diff --git a/ChangeLog b/ChangeLog index a13ee16..d5ede31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2002-01-09 Katsumi Yamaoka + + * lisp/gnus.el: Don't autoload "gnus-bitmap". + + * lisp/gnus-ems.el: Autoload "smiley-mule" if running Emacs + version is less than 21. + + * lisp/gnus-art.el (gnus-article-smiley-display): Remove. + (gnus-treat-smiley): Reload "smiley-ems" or "smiley-mule" if + needed. + (gnus-treat-display-smileys): Use `gnus-image-type-available-p'. + (gnus-article-smiley-mule-loaded-p): New internal variable. + (gnus-article-should-use-smiley-mule): New user option. + 2002-01-09 TSUCHIYA Masatoshi * lisp/nneething.el (nneething-mime-extensions): New variable. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index d4d0441..899cc01 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1115,11 +1115,36 @@ See Info node `(gnus)Customizing Articles' and Info node :type gnus-article-treat-head-custom) (put 'gnus-treat-display-xface 'highlight t) +(defcustom gnus-article-should-use-smiley-mule + (not (or (featurep 'xemacs) + (gnus-image-type-available-p 'xpm) + (gnus-image-type-available-p 'pbm))) + "If non-nil, gnus uses `smiley-mule' for displaying smileys rather than +`smiley-ems'. It defaults to t when Emacs 20 or earlier is running. +`smiley-mule' is boundled in BITMAP-MULE package. You can set it to t +even if you are using Emacs 21+. It has no effect on XEmacs." + :group 'gnus-article-various + :type 'boolean + :get (lambda (symbol) + (and (default-value symbol) + (not (featurep 'xemacs)) + (module-installed-p 'smiley-mule) + t)) + :set (lambda (symbol value) + (set-default symbol (and value + (not (featurep 'xemacs)) + (module-installed-p 'smiley-mule) + t)))) + +(defvar gnus-article-smiley-mule-loaded-p nil + "Internal variable used to say whether `smiley-mule' is loaded (whether +smiley functions are not overridden by `smiley-ems').") + (defcustom gnus-treat-display-smileys (if (or (and (featurep 'xemacs) (featurep 'xpm)) - (and (fboundp 'image-type-available-p) - (image-type-available-p 'pbm)) + (gnus-image-type-available-p 'xpm) + (gnus-image-type-available-p 'pbm) (and (not (featurep 'xemacs)) window-system (module-installed-p 'smiley-mule))) @@ -1843,6 +1868,16 @@ unfolded." (defun gnus-treat-smiley () "Display textual emoticons (\"smileys\") as small graphical icons." (interactive) + (unless (featurep 'xemacs) + (when (and (>= emacs-major-version 21) + (not gnus-article-should-use-smiley-mule) + gnus-article-smiley-mule-loaded-p) + (load "smiley-ems" nil t) + (setq gnus-article-smiley-mule-loaded-p nil)) + (when (and gnus-article-should-use-smiley-mule + (not gnus-article-smiley-mule-loaded-p)) + (load "smiley-mule" nil t) + (setq gnus-article-smiley-mule-loaded-p t))) (gnus-with-article-buffer (if (memq 'smiley gnus-article-wash-types) (gnus-delete-images 'smiley) @@ -6082,13 +6117,6 @@ specified by `gnus-button-alist'." "Activate ADDRESS with `browse-url'." (browse-url (gnus-strip-whitespace address))) -(eval-when-compile - ;; Silence the byte-compiler. - (autoload 'smiley-toggle-buffer "gnus-bitmap")) -(defun gnus-article-smiley-display () - "Display \"smileys\" as small graphical icons." - (smiley-toggle-buffer 1 (current-buffer) (point-min) (point-max))) - ;;; Next/prev buttons in the article buffer. (defvar gnus-next-page-line-format "%{%(Next page...%)%}\n") diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el index 22e9dfb..6d0d24e 100644 --- a/lisp/gnus-ems.el +++ b/lisp/gnus-ems.el @@ -48,9 +48,13 @@ (autoload 'gnus-xmas-redefine "gnus-xmas") (autoload 'appt-select-lowest-window "appt")) -(if (featurep 'xemacs) - (autoload 'smiley-region "smiley") - (autoload 'smiley-region "smiley-ems")) ; override XEmacs version +(cond ((featurep 'xemacs) + (autoload 'smiley-region "smiley")) + ;; override XEmacs version + ((>= emacs-major-version 21) + (autoload 'smiley-region "smiley-ems")) + (t + (autoload 'smiley-region "smiley-mule"))) (defun gnus-kill-all-overlays () "Delete all overlays in the current buffer." diff --git a/lisp/gnus.el b/lisp/gnus.el index 6a3d249..2ca27d4 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -2211,8 +2211,6 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") (unless (featurep 'xemacs) (if (>= emacs-major-version 21) (autoload 'x-face-decode-message-header "x-face-e21") - (autoload 'gnus-smiley-display "gnus-bitmap" nil t) - (autoload 'smiley-toggle-buffer "gnus-bitmap") (autoload 'x-face-mule-gnus-article-display-x-face "x-face-mule")))) (unless (and (fboundp 'base64-encode-string)