(gnus-insert-random-x-face-header): New function.
+2003-01-13 Simon Josefsson <jas@extundo.com>
+
+ * gnus-fun.el (gnus-random-x-face): Doc fix.
+ (gnus-insert-random-x-face-header): New function.
+
2003-01-13 Jesper Harder <harder@ifa.au.dk>
* gnus-sum.el (gnus-summary-make-menu-bar): Deactivate items if
2003-01-13 Jesper Harder <harder@ifa.au.dk>
* gnus-sum.el (gnus-summary-make-menu-bar): Deactivate items if
;;;###autoload
(defun gnus-random-x-face ()
;;;###autoload
(defun gnus-random-x-face ()
- "Insert a random X-Face header from `gnus-x-face-directory'."
+ "Return X-Face header data chosen randomly from `gnus-x-face-directory'."
(interactive)
(when (file-exists-p gnus-x-face-directory)
(let* ((files (directory-files gnus-x-face-directory t "\\.pbm$"))
(interactive)
(when (file-exists-p gnus-x-face-directory)
(let* ((files (directory-files gnus-x-face-directory t "\\.pbm$"))
(format gnus-convert-pbm-to-x-face-command
(shell-quote-argument file)))))))
(format gnus-convert-pbm-to-x-face-command
(shell-quote-argument file)))))))
+;;;###autoload
+(defun gnus-insert-random-x-face-header ()
+ "Insert a random X-Face header from `gnus-x-face-directory'."
+ (interactive)
+ (let ((data (gnus-random-x-face)))
+ (save-excursion
+ (message-goto-eoh)
+ (if data
+ (insert "X-Face: " data)
+ (message
+ "No face returned by `gnus-random-x-face'. Does %s/*.pbm exist?"
+ gnus-x-face-directory)))))
+
;;;###autoload
(defun gnus-x-face-from-file (file)
"Insert an X-Face header based on an image file."
;;;###autoload
(defun gnus-x-face-from-file (file)
"Insert an X-Face header based on an image file."