From 3901819f95ca883776c1ba47da987ec18b183115 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 2 Jan 2002 05:30:13 +0000 Subject: [PATCH] (gnus-random-x-face): Renamed. (gnus-x-face-from-file): Renamed. --- lisp/ChangeLog | 4 ++++ lisp/gnus-fun.el | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc27c5757..b0eaed102 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -11,6 +11,10 @@ 2002-01-02 Lars Magne Ingebrigtsen * 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 "_". diff --git a/lisp/gnus-fun.el b/lisp/gnus-fun.el index c74904b9a..e382b2d49 100644 --- a/lisp/gnus-fun.el +++ b/lisp/gnus-fun.el @@ -35,17 +35,30 @@ :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 -(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 "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) -- 2.25.1