(gnus-random-x-face): Renamed.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 2 Jan 2002 05:30:13 +0000 (05:30 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 2 Jan 2002 05:30:13 +0000 (05:30 +0000)
(gnus-x-face-from-file): Renamed.

lisp/ChangeLog
lisp/gnus-fun.el

index dc27c57..b0eaed1 100644 (file)
 2002-01-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-fun.el: New file.
 2002-01-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-fun.el: New file.
+       (gnus-convert-image-to-x-face-command): New variable.
+       (gnus-insert-x-face): New function.
+       (gnus-random-x-face): Renamed.
+       (gnus-x-face-from-file): Renamed.
 
        * gnus-art.el (gnus-body-boundary-delimiter): Changed default to
        "_". 
 
        * gnus-art.el (gnus-body-boundary-delimiter): Changed default to
        "_". 
index c74904b..e382b2d 100644 (file)
   :group 'gnus-fun
   :type 'string)
 
   :group 'gnus-fun
   :type 'string)
 
+(defcustom gnus-convert-image-to-x-face-command "giftopnm '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | compface"
+  "Command for converting a PBM to an X-Face."
+  :group 'gnus-fun
+  :type 'string)
+
 ;;;###autoload
 ;;;###autoload
-(defun gnus-insert-random-x-face ()
+(defun gnus-random-x-face ()
   "Insert a random X-Face header from `gnus-x-face-directory'."
   (interactive)
   (when (file-exists-p gnus-x-face-directory)
     (let* ((files (directory-files gnus-x-face-directory t "\\.pbm$"))
           (file (nth (random (length files)) files)))
       (when file
   "Insert a random X-Face header from `gnus-x-face-directory'."
   (interactive)
   (when (file-exists-p gnus-x-face-directory)
     (let* ((files (directory-files gnus-x-face-directory t "\\.pbm$"))
           (file (nth (random (length files)) files)))
       (when file
-       (insert "X-Face:"
-               (shell-command-to-string
-                (format gnus-convert-pbm-to-x-face-command file)))))))
+       (shell-command-to-string
+        (format gnus-convert-pbm-to-x-face-command file))))))
+
+;;;###autoload
+(defun gnus-x-face-from-file (file)
+  "Insert an X-Face header based on an image file."
+  (interactive "fImage file name:" )
+  (when (file-exists-p file)
+    (shell-command-to-string
+     (format gnus-convert-image-to-x-face-command file))))
+    
 
 (provide 'gnus-fun)
 
 
 (provide 'gnus-fun)