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

* Re: X-Face
  2003-01-13 17:58 X-Face Simon Josefsson
@ 2003-01-13 18:08 ` Lars Magne Ingebrigtsen
  2003-01-13 22:11   ` X-Face Xavier MAILLARD
  2003-01-15  7:58   ` X-Face Simon Josefsson
  0 siblings, 2 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-13 18:08 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> |      (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.

No, `message-required-news-headers' expects the functions in there to
return a string.  At least, that's what I've thought all these
years.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: X-Face
  2003-01-13 18:08 ` X-Face Lars Magne Ingebrigtsen
@ 2003-01-13 22:11   ` Xavier MAILLARD
  2003-01-14 14:01     ` X-Face Niels Olof Bouvin
  2003-01-15  7:58   ` X-Face Simon Josefsson
  1 sibling, 1 reply; 10+ messages in thread
From: Xavier MAILLARD @ 2003-01-13 22:11 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 85 bytes --]


[SNIP]

Nothing to add except : I love your X-Face :)

Kind regards,

zeDek

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: X-Face
  2003-01-13 22:11   ` X-Face Xavier MAILLARD
@ 2003-01-14 14:01     ` Niels Olof Bouvin
  2003-01-14 16:28       ` X-Face Lars Magne Ingebrigtsen
  2003-01-14 17:18       ` X-Face Vasily Korytov
  0 siblings, 2 replies; 10+ messages in thread
From: Niels Olof Bouvin @ 2003-01-14 14:01 UTC (permalink / raw)


One question:

Which version of compface are you using?  I use v1.4.5 [1] under Solaris, and
it gives me 'compface: (warning) <stdin>: excess data ignored' whenever I try
to run the command sequence of gnus-convert-pbm-to-x-face-command.

Cheers
        Niels Olof

[1] http://contest.cmc.msu.ru/download/cygwin/release/compface/

-- 
Niels Olof Bouvin, Ph.D.  http://www.bouvin.net/ Voice: +45 89 42 56 59 \ /
In omnibus requiem quaesivi, et nusquam inveni nisi in angulo cum libro (")
Assistant Professor @ Department of Computer Science, Aarhus Univ., Denmark



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

* Re: X-Face
  2003-01-14 14:01     ` X-Face Niels Olof Bouvin
@ 2003-01-14 16:28       ` Lars Magne Ingebrigtsen
  2003-01-14 17:18       ` X-Face Vasily Korytov
  1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-14 16:28 UTC (permalink / raw)


Niels Olof Bouvin <n.o.bouvin@daimi.au.dk> writes:

> Which version of compface are you using?  I use v1.4.5 [1] under Solaris, and
> it gives me 'compface: (warning) <stdin>: excess data ignored' whenever I try
> to run the command sequence of gnus-convert-pbm-to-x-face-command.

I'm using the one that comes with Debian.  The version is
"1998.11.11-23", which is pretty odd.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: X-Face
  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       ` Vasily Korytov
  1 sibling, 0 replies; 10+ messages in thread
From: Vasily Korytov @ 2003-01-14 17:18 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

>>>>> "NOB" == Niels Olof Bouvin writes:

 NOB> One question: Which version of compface are you using? I use
 NOB> v1.4.5 [1] under Solaris, and it gives me 'compface: (warning)
 NOB> <stdin>: excess data ignored' whenever I try to run the command
 NOB> sequence of gnus-convert-pbm-to-x-face-command.

I think, the version, I use, comes from xemacs ftp site. I'm not sure,
what version it is, but file modification dates are in 1990-1991 years,
but two files -- Makefile and xbm2xface.pl are from 1995. Any references
to version are absent, top 3 lines from the README are:

--8<------------------------schnipp------------------------->8---
Compface - 48x48x1 image compression and decompression
Copyright (c) James Ashton 1990.
Written 89/11/11
--8<------------------------schnapp------------------------->8---

---Vas

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: X-Face
  2003-01-13 18:08 ` X-Face Lars Magne Ingebrigtsen
  2003-01-13 22:11   ` X-Face Xavier MAILLARD
@ 2003-01-15  7:58   ` Simon Josefsson
  1 sibling, 0 replies; 10+ messages in thread
From: Simon Josefsson @ 2003-01-15  7:58 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Simon Josefsson <jas@extundo.com> writes:
>
>> |      (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.
>
> No, `message-required-news-headers' expects the functions in there to
> return a string.  At least, that's what I've thought all these
> years.  :-)

Oh.  And now doing what the old manual said works.  Oops.  I've
reverted the manual patch (the new gnus-insert-random-x-face-header
function might be useful anyway, or perhaps not, but I guess it
doesn't hurt, so I'm leaving it).




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

* Re: X-Face
  1998-12-24  9:38 X-Face Stefan Waldherr
  1998-12-24 15:21 ` X-Face Lars Magne Ingebrigtsen
@ 1998-12-24 15:52 ` Karl Kleinpaste
  1 sibling, 0 replies; 10+ messages in thread
From: Karl Kleinpaste @ 1998-12-24 15:52 UTC (permalink / raw)


Stefan Waldherr <stefan@waldherr.org> writes:
> how do people insert their X-Faces these days?

(setq message-default-headers "X-Face: \"5(T0tZd{6}pd~YzBG8O/*EW,.]6]@`m^e;fv65W^Y&=d\"M\\1H}>T~4_.kcDD.O~y3k)a6h\n R;Nmi>9|>Nm${2IpM0^RcUEa\\jcq?KOP)C&~x51l~zCHTulL^_T|u0I^kB'z@]{`2YjQu\n")


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

* Re: X-Face
  1998-12-24  9:38 X-Face Stefan Waldherr
@ 1998-12-24 15:21 ` Lars Magne Ingebrigtsen
  1998-12-24 15:52 ` X-Face Karl Kleinpaste
  1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-12-24 15:21 UTC (permalink / raw)


Stefan Waldherr <stefan@waldherr.org> writes:

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

with-temp-buffer, for instance.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ 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).