aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-10-04 17:24:25 +0000
committerDave Love2000-10-04 17:24:25 +0000
commit5f180e53607c7f4c688a8af72e2f259cecbf252e (patch)
tree5bb6fda2130dc4b8e3f5c88499e2d08aa0e9783c
parentffc0e1caf1a6c8636d0c6a1f3c1650deee845916 (diff)
downloademacs-5f180e53607c7f4c688a8af72e2f259cecbf252e.tar.gz
emacs-5f180e53607c7f4c688a8af72e2f259cecbf252e.zip
Don't turn off compiler warnings in local vars.
Require ring when compiling. (gnus-x-splash): Bind width, height. (gnus-article-compface-xbm): New variable. (gnus-article-display-xface): Move graphic test. Use unibyte. Obey gnus-article-compface-xbm. Use pbm, not xbm.
-rw-r--r--lisp/gnus/gnus-ems.el51
1 files changed, 34 insertions, 17 deletions
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el
index 4dcb8e92c36..4c479f93b94 100644
--- a/lisp/gnus/gnus-ems.el
+++ b/lisp/gnus/gnus-ems.el
@@ -26,7 +26,9 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(eval-when-compile (require 'cl)) 29(eval-when-compile
30 (require 'cl)
31 (require 'ring))
30 32
31;;; Function aliases later to be redefined for XEmacs usage. 33;;; Function aliases later to be redefined for XEmacs usage.
32 34
@@ -162,7 +164,8 @@
162 pixmap file height beg i) 164 pixmap file height beg i)
163 (save-excursion 165 (save-excursion
164 (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer)) 166 (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
165 (let ((buffer-read-only nil)) 167 (let ((buffer-read-only nil)
168 width height)
166 (erase-buffer) 169 (erase-buffer)
167 (when (and dir 170 (when (and dir
168 (file-exists-p (setq file 171 (file-exists-p (setq file
@@ -197,12 +200,18 @@
197(defvar gnus-article-xface-ring-size 6 200(defvar gnus-article-xface-ring-size 6
198 "Length of the ring used for `gnus-article-xface-ring-internal'.") 201 "Length of the ring used for `gnus-article-xface-ring-internal'.")
199 202
203(defvar gnus-article-compface-xbm
204 (eq 0 (string-match "#define" (shell-command-to-string "uncompface -X")))
205 "Non-nil means the compface program supports the -X option.
206That produces XBM output.")
207
200(defun gnus-article-display-xface (beg end) 208(defun gnus-article-display-xface (beg end)
201 "Display an XFace header from between BEG and END in the current article. 209 "Display an XFace header from between BEG and END in the current article.
202Requires support for images in your Emacs and the external programs 210Requires support for images in your Emacs and the external programs
203`uncompface', and `icontopbm'. On a GNU/Linux system these 211`uncompface', and `icontopbm'. On a GNU/Linux system these
204might be in packages with names like `compface' or `faces-xface' and 212might be in packages with names like `compface' or `faces-xface' and
205`netpbm' or `libgr-progs', for instance. 213`netpbm' or `libgr-progs', for instance. See also
214`gnus-article-compface-xbm'.
206 215
207This function is for Emacs 21+. See `gnus-xmas-article-display-xface' 216This function is for Emacs 21+. See `gnus-xmas-article-display-xface'
208for XEmacs." 217for XEmacs."
@@ -222,23 +231,35 @@ for XEmacs."
222 (unless image 231 (unless image
223 (with-temp-buffer 232 (with-temp-buffer
224 (insert data) 233 (insert data)
225 (and (eq 0 (call-process-region (point-min) (point-max) 234 (and (eq 0 (apply #'call-process-region (point-min) (point-max)
226 "uncompface" 235 "uncompface"
227 'delete '(t nil))) 236 'delete '(t nil) nil
228 (goto-char (point-min)) 237 (if gnus-article-compface-xbm
229 (progn (insert "/* Width=48, Height=48 */\n") t) 238 '("-X"))))
230 (eq 0 (call-process-region (point-min) (point-max) 239 (if gnus-article-compface-xbm
231 "icontopbm" 240 t
232 'delete '(t nil))) 241 (goto-char (point-min))
242 (progn (insert "/* Width=48, Height=48 */\n") t)
243 (eq 0 (call-process-region (point-min) (point-max)
244 "icontopbm"
245 'delete '(t nil))))
233 ;; Miles Bader says that faces don't look right as 246 ;; Miles Bader says that faces don't look right as
234 ;; light on dark. 247 ;; light on dark.
235 (if (eq 'dark (cdr-safe (assq 'background-mode 248 (if (eq 'dark (cdr-safe (assq 'background-mode
236 (frame-parameters)))) 249 (frame-parameters))))
237 (setq image (create-image (buffer-string) 'pbm t 250 (setq image (create-image (buffer-string)
251 (if gnus-article-compface-xbm
252 'xbm
253 'pbm)
254 t
238 :ascent 'center 255 :ascent 'center
239 :foreground "black" 256 :foreground "black"
240 :background "white")) 257 :background "white"))
241 (setq image (create-image (buffer-string) 'pbm t 258 (setq image (create-image (buffer-string)
259 (if gnus-article-compface-xbm
260 'xbm
261 'pbm)
262 t
242 :ascent 'center))))) 263 :ascent 'center)))))
243 (ring-insert gnus-article-xface-ring-internal (cons data image))) 264 (ring-insert gnus-article-xface-ring-internal (cons data image)))
244 (when image 265 (when image
@@ -248,8 +269,4 @@ for XEmacs."
248 269
249(provide 'gnus-ems) 270(provide 'gnus-ems)
250 271
251;; Local Variables:
252;; byte-compile-warnings: '(redefine callargs)
253;; End:
254
255;;; gnus-ems.el ends here 272;;; gnus-ems.el ends here