From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49154 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: X-Face Date: Mon, 13 Jan 2003 18:58:25 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1042480755 3715 80.91.224.249 (13 Jan 2003 17:59:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 13 Jan 2003 17:59:15 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Y8rP-0000wt-00 for ; Mon, 13 Jan 2003 18:58:56 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18Y8rJ-0006Jy-00; Mon, 13 Jan 2003 11:58:49 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 13 Jan 2003 11:59:45 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id LAA01976 for ; Mon, 13 Jan 2003 11:59:31 -0600 (CST) Original-Received: (qmail 59293 invoked by alias); 13 Jan 2003 17:58:29 -0000 Original-Received: (qmail 59288 invoked from network); 13 Jan 2003 17:58:28 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by 66.230.238.6 with SMTP; 13 Jan 2003 17:58:28 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.6/8.12.6) with ESMTP id h0DHwPRr003673 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 13 Jan 2003 18:58:25 +0100 Original-To: ding@gnus.org X-Payment: hashcash 1.1 0:030113:ding@gnus.org:2f11f4f7957173ed X-Hashcash: 0:030113:ding@gnus.org:2f11f4f7957173ed User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.3.50 (i686-pc-linux-gnu) X-Face: No face returned by `gnus-random-x-face'. Does /home/jas/News/x-faces/*.pbm exists? Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:49154 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:49154 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 * gnus-fun.el (gnus-random-x-face): Doc fix. (gnus-insert-random-x-face-header): New function. 2003-01-13 Simon Josefsson * 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