Gnus development mailing list
 help / color / mirror / Atom feed
* X-Face
@ 2003-01-13 17:58 Simon Josefsson
  2003-01-13 18:08 ` X-Face Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Josefsson @ 2003-01-13 17:58 UTC (permalink / raw)


Does the following hints in the manual really work?

,----
|    Gnus provides a few convenience functions and variables to allow
| easier insertion of X-Face headers in outgoing messages.
| 
|    `gnus-random-x-face' goes through all the `pbm' files in
| `gnus-x-face-directory' and picks one at random, and then converts it
| to the X-Face format by using the `gnus-convert-pbm-to-x-face-command'
| shell command.  The `pbm' files should be 48x48 pixels big.
| 
|    `gnus-x-face-from-file' takes a GIF file as the parameter, and then
| converts the file to X-Face format by using the
| `gnus-convert-image-to-x-face-command' shell command.
| 
|    Here's how you would typically use the former function.  Put
| something like the following in your `.gnus.el' file:
| 
|      (setq message-required-news-headers
|            (nconc message-required-news-headers
|                   (list '(X-Face . gnus-random-x-face))))
| 
|    Using the latter function would be something like this:
| 
|      (setq message-required-news-headers
|            (nconc message-required-news-headers
|                   (list '(X-Face . (lambda ()
|                                      (gnus-x-face-from-file
|                                       "~/My-face.gif"))))))
`----

I'm not able to use it; gnus-random-x-face returns a string with the
X-Face data, but m-r-n-h expects it to insert a header.

I have committed the following, which might be bogus if the above
works for anyone.

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  Simon Josefsson  <jas@extundo.com>

	* gnus.texi (X-Face): Fix.

--- gnus-fun.el.~6.30.~	Mon Jan 13 16:10:42 2003
+++ gnus-fun.el	Mon Jan 13 18:48:55 2003
@@ -60,7 +60,7 @@
 
 ;;;###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$"))
@@ -69,6 +69,19 @@
 	(gnus-shell-command-to-string
 	 (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)

--- gnus.texi.~6.385.~	Mon Jan 13 18:01:42 2003
+++ gnus.texi	Mon Jan 13 18:51:49 2003
@@ -20973,26 +20973,32 @@
 easier insertion of X-Face headers in outgoing messages.
 
 @findex gnus-random-x-face
-@code{gnus-random-x-face} goes through all the @samp{pbm} files
-in @code{gnus-x-face-directory} and picks one at random, and then
+@code{gnus-random-x-face} goes through all the @samp{pbm} files in
+@code{gnus-x-face-directory} and picks one at random, and then
 converts it to the X-Face format by using the
 @code{gnus-convert-pbm-to-x-face-command} shell command.  The
-@samp{pbm} files should be 48x48 pixels big.
+@samp{pbm} files should be 48x48 pixels big.  It returns the X-Face
+header data as a string.
 
+@findex gnus-insert-random-x-face-header
+Calls @code{gnus-random-x-face} and inserts a @samp{X-Face} header
+with the randomly generated data.
+
+@findex gnus-x-face-from-file
 @code{gnus-x-face-from-file} takes a GIF file as the parameter, and then
 converts the file to X-Face format by using the
 @code{gnus-convert-image-to-x-face-command} shell command.
 
-Here's how you would typically use the former function.  Put something
+Here's how you would typically use the second function.  Put something
 like the following in your @file{.gnus.el} file:
 
 @lisp
 (setq message-required-news-headers
       (nconc message-required-news-headers
-             (list '(X-Face . gnus-random-x-face))))
+             (list '(X-Face . gnus-insert-random-x-face-header))))
 @end lisp
 
-Using the latter function would be something like this:
+Using the last function would be something like this:
 
 @lisp
 (setq message-required-news-headers




^ permalink raw reply	[flat|nested] 10+ messages in thread
* X-Face
@ 1998-12-24  9:38 Stefan Waldherr
  1998-12-24 15:21 ` X-Face Lars Magne Ingebrigtsen
  1998-12-24 15:52 ` X-Face Karl Kleinpaste
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Waldherr @ 1998-12-24  9:38 UTC (permalink / raw)



Hi,

now that I switched to pgnus, nnheader-temp-write seems to be obsolete. So,
how do people insert their X-Faces these days?

Thanks,
Stefan.
-- 
Stefan Waldherr                   fax +49 431 8058 136
                               e-Mail stefan@waldherr.org
                                  www http://www.waldherr.org/


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-01-15  7:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13 17:58 X-Face Simon Josefsson
2003-01-13 18:08 ` X-Face Lars Magne Ingebrigtsen
2003-01-13 22:11   ` X-Face Xavier MAILLARD
2003-01-14 14:01     ` X-Face Niels Olof Bouvin
2003-01-14 16:28       ` X-Face Lars Magne Ingebrigtsen
2003-01-14 17:18       ` X-Face Vasily Korytov
2003-01-15  7:58   ` X-Face Simon Josefsson
  -- strict thread matches above, loose matches on Subject: below --
1998-12-24  9:38 X-Face Stefan Waldherr
1998-12-24 15:21 ` X-Face Lars Magne Ingebrigtsen
1998-12-24 15:52 ` X-Face Karl Kleinpaste

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).