From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53208 Path: main.gmane.org!not-for-mail From: Didier Verna Newsgroups: gmane.emacs.gnus.general Subject: [COMMIT] Face Fix Date: Wed, 18 Jun 2003 12:50:26 +0200 Sender: ding-owner@lists.math.uh.edu Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1055950192 23256 80.91.224.249 (18 Jun 2003 15:29:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Jun 2003 15:29:52 +0000 (UTC) Original-X-From: ding-owner+M1752@lists.math.uh.edu Wed Jun 18 17:29:45 2003 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 19Seol-0005Vu-00 for ; Wed, 18 Jun 2003 17:25:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19Senx-0005wN-00; Wed, 18 Jun 2003 10:24:57 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19SaWF-0004gO-00 for ding@lists.math.uh.edu; Wed, 18 Jun 2003 05:50:23 -0500 Original-Received: (qmail 3345 invoked by alias); 18 Jun 2003 10:50:23 -0000 Original-Received: (qmail 3340 invoked from network); 18 Jun 2003 10:50:22 -0000 Original-Received: from hermes.epita.fr (HELO epita.fr) (163.5.255.10) by sclp3.sclp.com with SMTP; 18 Jun 2003 10:50:22 -0000 Original-Received: from kualalumpur.lrde.epita.fr (kualalumpur.lrde.epita.fr [10.223.13.1]) by epita.fr id h5IAoJq25476 for EPITA Paris France Wed, 18 Jun 2003 12:50:19 +0200 (CEST) Original-Received: from debian.lrde.epita.fr ([10.223.13.53] helo=uzeb.lrde.epita.fr ident=mail) by kualalumpur.lrde.epita.fr with esmtp (Exim 3.35 #1 (Debian)) id 19SaWJ-0000EZ-00 for ; Wed, 18 Jun 2003 12:50:27 +0200 Original-Received: from didier by uzeb.lrde.epita.fr with local (Exim 3.36 #1 (Debian)) id 19SaWI-0002s2-00 for ; Wed, 18 Jun 2003 12:50:26 +0200 Original-To: Gnus Beta Testers X-Attribution: drv X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEV2V0L19/bq7evqw68l Ewinh3Lh4NzYookwrcIVAAACdElEQVR4nFWUzY+bMBDFp1q8nKFqerajuNekbuIrUp3t1Wni5VpA S65Irut/v88G9mMORPFPM+8xnoHGtxiiGuXYz39oOey2lhDuNIK9gl5298IgGmpH8QHIm5mj8b3s X4Hs/pg16FmIN41tkcowS/h9EFIuQOQEcghbGNZLAZ0MkkLjWudidEXznQsE9aMUX5DAcBpjcPZ8 ql9BqsRinElZrRlC5EoziM5VnGcgxAZeWLuAYA+8qmewXSsplWpd6goEgL8AuHyulI7hoUIIQrk9 JFDJL4B1K/gLUL4Bd8iAy2yqVRrHQyLuUlW8BqgBqPUa16ROysfwXFc1J57dNnMhBQKR6h24wlNw uEIdpwYaNcSlTUCriDYSxSOZbgbjsYC4z05tGycyv6u6SkAfC7jCa9PDvlSTM5cMqo3WlgC0C9fJ nybbdOgWdWKjFQBcxTYwr/b0M/UEriR07dXPb63UkR5nwDd35W3KAIFpvQDB60F51+beptcc2GXJ EHevyWWg8Bzc86LBv5ZDBqdBZ8BW8NL8sy69yKDx/GzPM6j4D3OmDJK4VrcZoFdFBslvq4K15mlx BYC5hS10MRAz5tMCvqG5Fuo+kAsuUNPNbec7DIkl5uMEC/FGWeIdaMOEMXRUPM3jI0UCWD8Wg9fB siINXAIyzTohxQWMSiBzeAcaLBMWp4Ux23CeR1TKXVozFIdADEQrGMcdzslZ5GBOsTg1SokEtkVT Wlxek2QAcOH1As7+xkL6MjBU/NWtQN7OW6KSUdKi4vGadlAC9Ht2RxmyaSKNiY8L6MeXMqYy7fI5 uaQVzHu+K3G3VF5h1ZRFc+gT+A/m9QrJRMmakwAAAABJRU5ErkJggg== X-Face: oY$<"yQvdR^("%}AJC%93R8@!\77m3!BM;)$'q:avxOD(q5,>O*HR1wDiA[VT)Ny;3p\&O' ag7O3t8{lh]^%d(_{lN)m?9/{spmb*-({fm'X-^mI#^ThEObN_#Z?r$'u;=v= Mail-Copies-To: never X-Generated-By: Patcher version 3.4.1 User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:53208 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:53208 NOTE: This patch has been committed. The version below is informational only (whitespace differences have been removed). Dear folks, The following patch makes `W D d' work properly, along with some missing documentation for the Face header. lisp/ChangeLog addition: 2003-06-18 Didier Verna * gnus-art.el (article-display-face): Correctly toggle between display and hiding. Handle multiple Face headers. texi/ChangeLog addition: 2003-06-18 Didier Verna * gnus.texi (Face): New node. * gnus.texi (Article Display): Reference it. * gnus.texi (Customizing Articles): Ditto. * gnus.texi (Image Enhancements): Put the Face node into the menu. Gnus source patch: Diff command: runsocks cvs -q diff -u -t -b -B -w Files affected: texi/gnus.texi lisp/gnus-art.el Index: lisp/gnus-art.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 6.349 diff -u -u -t -b -B -w -r6.349 gnus-art.el --- lisp/gnus-art.el 31 May 2003 02:41:11 -0000 6.349 +++ lisp/gnus-art.el 18 Jun 2003 10:38:28 -0000 @@ -1977,8 +1977,16 @@ "Display any Face headers in the header." (interactive) (gnus-with-article-headers - (let ((face (message-fetch-field "face"))) - (when face + (if (memq 'face gnus-article-wash-types) + (gnus-delete-images 'face) + (let (face faces) + (save-excursion + (set-buffer gnus-original-article-buffer) + (save-restriction + (mail-narrow-to-head) + (while (gnus-article-goto-header "Face") + (push (mail-header-field-value) faces)))) + (while (setq face (pop faces)) (let ((png (gnus-convert-face-to-png face)) image) (when png @@ -1989,7 +1997,8 @@ (forward-char -17)) (gnus-add-wash-type 'face) (gnus-add-image 'face image) - (gnus-put-image image))))))) + (gnus-put-image image)))))) + )) =20 (defun article-display-x-face (&optional force) "Look for an X-Face header and display it if present." Index: texi/gnus.texi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v retrieving revision 6.527 diff -u -u -t -b -B -w -r6.527 gnus.texi --- texi/gnus.texi 17 Jun 2003 15:43:59 -0000 6.527 +++ texi/gnus.texi 18 Jun 2003 10:38:29 -0000 @@ -8974,12 +8974,15 @@ @code{X-Face} headers are small black-and-white images supplied by the message headers (@pxref{X-Face}). =20 -Picons, on the other hand, reside on your own system, and Gnus will -try to match the headers to what you have (@pxref{Picons}). +@code{Face} headers are small colored images supplied by the message +headers (@pxref{Face}). =20 Smileys are those little @samp{:-)} symbols that people like to litter their messages with (@pxref{Smileys}). =20 +Picons, on the other hand, reside on your own system, and Gnus will +try to match the headers to what you have (@pxref{Picons}). + All these functions are toggles---if the elements already exist, they'll be removed. =20 @@ -11051,6 +11054,10 @@ =20 @xref{X-Face}. =20 +@item gnus-treat-display-face (head) + +@xref{Face}. + @item gnus-treat-emphasize (t, head, integer) @item gnus-treat-fill-article (t, integer) @item gnus-treat-fill-long-lines (t, integer) @@ -21571,139 +21578,14 @@ taken advantage of that. =20 @menu -* Picons:: How to display pictures of what you're rea= ding. -* Smileys:: Show all those happy faces the way they we= re meant to be shown. * X-Face:: Display a funky, teensy black-and-white im= age. +* Face:: Display a funkier, teensier colored image. +* Smileys:: Show all those happy faces the way they we= re meant to be shown. +* Picons:: How to display pictures of what you're rea= ding. * XVarious:: Other XEmacsy Gnusey variables. @end menu =20 =20 -@node Picons -@subsection Picons - -@iftex -@iflatex -\include{picons} -@end iflatex -@end iftex - -So@dots{} You want to slow down your news reader even more! This is a -good way to do so. It's also a great way to impress people staring -over your shoulder as you read news. - -What are Picons? To quote directly from the Picons Web site: - -@iftex -@iflatex -\margindex{} -@end iflatex -@end iftex - -@quotation -@dfn{Picons} is short for ``personal icons''. They're small, -constrained images used to represent users and domains on the net, -organized into databases so that the appropriate image for a given -e-mail address can be found. Besides users and domains, there are picon -databases for Usenet newsgroups and weather forecasts. The picons are -in either monochrome @code{XBM} format or color @code{XPM} and -@code{GIF} formats. -@end quotation - -@vindex gnus-picon-databases -For instructions on obtaining and installing the picons databases, -point your Web browser at -@uref{http://www.cs.indiana.edu/picons/ftp/index.html}. - -If you are using Debian GNU/Linux, saying @samp{apt-get install -picons.*} will install the picons where Gnus can find them. - -To enable displaying picons, simply make sure that -@code{gnus-picon-databases} points to the directory containing the -Picons databases. - -The following variables offer control over where things are located. - -@table @code - -@item gnus-picon-databases -@vindex gnus-picon-databases -The location of the picons database. This is a list of directories -containing the @file{news}, @file{domains}, @file{users} (and so on) -subdirectories. Defaults to @code{("/usr/lib/picon" -"/usr/local/faces")}. - -@item gnus-picon-news-directories -@vindex gnus-picon-news-directories -List of subdirectories to search in @code{gnus-picon-databases} for -newsgroups faces. @code{("news")} is the default. - -@item gnus-picon-user-directories -@vindex gnus-picon-user-directories -List of subdirectories to search in @code{gnus-picon-databases} for user -faces. @code{("users" "usenix" "local" "misc")} is the default. - -@item gnus-picon-domain-directories -@vindex gnus-picon-domain-directories -List of subdirectories to search in @code{gnus-picon-databases} for -domain name faces. Defaults to @code{("domains")}. Some people may -want to add @samp{"unknown"} to this list. - -@item gnus-picon-file-types -@vindex gnus-picon-file-types -Ordered list of suffixes on picon file names to try. Defaults to -@code{("xpm" "gif" "xbm")} minus those not built-in your Emacs. - -@end table - -@node Smileys -@subsection Smileys -@cindex smileys - -@iftex -@iflatex -\gnusfig{-3cm}{0.5cm}{\epsfig{figure=3Dps/BigFace,height=3D20cm}} -\input{smiley} -@end iflatex -@end iftex - -@dfn{Smiley} is a package separate from Gnus, but since Gnus is -currently the only package that uses Smiley, it is documented here. - -In short---to use Smiley in Gnus, put the following in your -@file{~/.gnus.el} file: - -@lisp -(setq gnus-treat-display-smileys t) -@end lisp - -Smiley maps text smiley faces---@samp{:-)}, @samp{8-)}, @samp{:-(} and -the like---to pictures and displays those instead of the text smiley -faces. The conversion is controlled by a list of regexps that matches -text and maps that to file names. - -@vindex smiley-regexp-alist -The alist used is specified by the @code{smiley-regexp-alist} -variable. The first item in each element is the regexp to be matched; -the second element is the regexp match group that is to be replaced by -the picture; and the third element is the name of the file to be -displayed. - -The following variables customize where Smiley will look for these -files: - -@table @code - -@item smiley-data-directory -@vindex smiley-data-directory -Where Smiley will look for smiley faces files. - -@item gnus-smiley-file-types -@vindex gnus-smiley-file-types -List of suffixes on smiley file names to try. - -@end table - - @node X-Face @subsection X-Face @cindex x-face @@ -21715,7 +21597,6 @@ =20 @cindex x-face @findex gnus-article-display-x-face -@findex gnus-article-x-face-command @vindex gnus-article-x-face-command @vindex gnus-article-x-face-too-ugly @iftex @@ -21799,6 +21680,173 @@ @end lisp =20 =20 +@node Face +@subsection Face +@cindex face + +@c #### FIXME: faces and x-faces'implementations should really be harmoniz= ed. + +@code{Face} headers are essentially a funkier version of @code{X-Face} +ones. They describe a 48x48 pixel colored image that's supposed to +represent the author of the message. + +@cindex face +@findex gnus-article-display-face +The contents of a @code{Face} header must be a base64 encoded PNG image. +See @url{http://quimby.gnus.org/circus/face/} for the precise +specifications. + +Gnus provides a few convenience functions and variables to allow +easier insertion of Face headers in outgoing messages. + +@findex gnus-convert-png-to-face +@code{gnus-convert-png-to-face} takes a 48x48 PNG image, no longer than +726 bytes long, and converts it to a face. + +@findex gnus-face-from-file +@vindex gnus-convert-image-to-face-command +@code{gnus-face-from-file} takes a JPEG file as the parameter, and then +converts the file to Face format by using the +@code{gnus-convert-image-to-face-command} shell command. + +Here's how you would typically use this function. Put something like the +following in your @file{~/.gnus.el} file: + +@lisp +(setq message-required-news-headers + (nconc message-required-news-headers + (list '(Face . (lambda () + (gnus-face-from-file "~/face.jpg")))))) +@end lisp + + +@node Smileys +@subsection Smileys +@cindex smileys + +@iftex +@iflatex +\gnusfig{-3cm}{0.5cm}{\epsfig{figure=3Dps/BigFace,height=3D20cm}} +\input{smiley} +@end iflatex +@end iftex + +@dfn{Smiley} is a package separate from Gnus, but since Gnus is +currently the only package that uses Smiley, it is documented here. + +In short---to use Smiley in Gnus, put the following in your +@file{~/.gnus.el} file: + +@lisp +(setq gnus-treat-display-smileys t) +@end lisp + +Smiley maps text smiley faces---@samp{:-)}, @samp{8-)}, @samp{:-(} and +the like---to pictures and displays those instead of the text smiley +faces. The conversion is controlled by a list of regexps that matches +text and maps that to file names. + +@vindex smiley-regexp-alist +The alist used is specified by the @code{smiley-regexp-alist} +variable. The first item in each element is the regexp to be matched; +the second element is the regexp match group that is to be replaced by +the picture; and the third element is the name of the file to be +displayed. + +The following variables customize where Smiley will look for these +files: + +@table @code + +@item smiley-data-directory +@vindex smiley-data-directory +Where Smiley will look for smiley faces files. + +@item gnus-smiley-file-types +@vindex gnus-smiley-file-types +List of suffixes on smiley file names to try. + +@end table + + +@node Picons +@subsection Picons + +@iftex +@iflatex +\include{picons} +@end iflatex +@end iftex + +So@dots{} You want to slow down your news reader even more! This is a +good way to do so. It's also a great way to impress people staring +over your shoulder as you read news. + +What are Picons? To quote directly from the Picons Web site: + +@iftex +@iflatex +\margindex{} +@end iflatex +@end iftex + +@quotation +@dfn{Picons} is short for ``personal icons''. They're small, +constrained images used to represent users and domains on the net, +organized into databases so that the appropriate image for a given +e-mail address can be found. Besides users and domains, there are picon +databases for Usenet newsgroups and weather forecasts. The picons are +in either monochrome @code{XBM} format or color @code{XPM} and +@code{GIF} formats. +@end quotation + +@vindex gnus-picon-databases +For instructions on obtaining and installing the picons databases, +point your Web browser at +@uref{http://www.cs.indiana.edu/picons/ftp/index.html}. + +If you are using Debian GNU/Linux, saying @samp{apt-get install +picons.*} will install the picons where Gnus can find them. + +To enable displaying picons, simply make sure that +@code{gnus-picon-databases} points to the directory containing the +Picons databases. + +The following variables offer control over where things are located. + +@table @code + +@item gnus-picon-databases +@vindex gnus-picon-databases +The location of the picons database. This is a list of directories +containing the @file{news}, @file{domains}, @file{users} (and so on) +subdirectories. Defaults to @code{("/usr/lib/picon" +"/usr/local/faces")}. + +@item gnus-picon-news-directories +@vindex gnus-picon-news-directories +List of subdirectories to search in @code{gnus-picon-databases} for +newsgroups faces. @code{("news")} is the default. + +@item gnus-picon-user-directories +@vindex gnus-picon-user-directories +List of subdirectories to search in @code{gnus-picon-databases} for user +faces. @code{("users" "usenix" "local" "misc")} is the default. + +@item gnus-picon-domain-directories +@vindex gnus-picon-domain-directories +List of subdirectories to search in @code{gnus-picon-databases} for +domain name faces. Defaults to @code{("domains")}. Some people may +want to add @samp{"unknown"} to this list. + +@item gnus-picon-file-types +@vindex gnus-picon-file-types +Ordered list of suffixes on picon file names to try. Defaults to +@code{("xpm" "gif" "xbm")} minus those not built-in your Emacs. + +@end table + + @node XVarious @subsection Various XEmacs Variables =20 @@ -25126,6 +25174,9 @@ Easy inclusion of X-Faces headers. =20 @item +Face headers handling. + +@item In the summary buffer, the new command @kbd{/ N} inserts new messages and @kbd{/ o} inserts old messages. =20 --=20 Didier Verna, didier@lrde.epita.fr, http://www.lrde.epita.fr/~didier EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 44 08 01 85 94276 Le Kremlin-Bic=EAtre, France Fax.+33 (1) 53 14 59 22 didier@xemac= s.org