Gnus development mailing list
 help / color / mirror / Atom feed
* [COMMIT] Face Fix
@ 2003-06-18 10:50 Didier Verna
  2003-06-20  9:56 ` Jesper Harder
  0 siblings, 1 reply; 8+ messages in thread
From: Didier Verna @ 2003-06-18 10:50 UTC (permalink / raw)


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  <didier@xemacs.org>

	* gnus-art.el (article-display-face): Correctly toggle between
	display and hiding. Handle multiple Face headers.


texi/ChangeLog addition:

2003-06-18  Didier Verna  <didier@xemacs.org>

	* 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
===================================================================
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))))))
+    ))
 
 (defun article-display-x-face (&optional force)
   "Look for an X-Face header and display it if present."
Index: texi/gnus.texi
===================================================================
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}).
 
-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}).
 
 Smileys are those little @samp{:-)} symbols that people like to litter
 their messages with (@pxref{Smileys}).
 
+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.
 
@@ -11051,6 +11054,10 @@
 
 @xref{X-Face}.
 
+@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.
 
 @menu
-* Picons::                      How to display pictures of what you're reading.
-* Smileys::                     Show all those happy faces the way they were meant to be shown.
 * X-Face::                      Display a funky, teensy black-and-white image.
+* Face::                        Display a funkier, teensier colored image.
+* Smileys::                     Show all those happy faces the way they were meant to be shown.
+* Picons::                      How to display pictures of what you're reading.
 * XVarious::                    Other XEmacsy Gnusey variables.
 @end menu
 
 
-@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=ps/BigFace,height=20cm}}
-\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 @@
 
 @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
 
 
+@node Face
+@subsection Face
+@cindex face
+
+@c #### FIXME: faces and x-faces'implementations should really be harmonized.
+
+@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=ps/BigFace,height=20cm}}
+\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
 
@@ -25126,6 +25174,9 @@
 Easy inclusion of X-Faces headers.
 
 @item
+Face headers handling.
+
+@item
 In the summary buffer, the new command @kbd{/ N} inserts new messages
 and @kbd{/ o} inserts old messages.
 

-- 
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être, France   Fax.+33 (1) 53 14 59 22   didier@xemacs.org



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

* Re: [COMMIT] Face Fix
  2003-06-18 10:50 [COMMIT] Face Fix Didier Verna
@ 2003-06-20  9:56 ` Jesper Harder
  2003-06-20 10:47   ` Katsumi Yamaoka
  2003-06-23 12:13   ` Didier Verna
  0 siblings, 2 replies; 8+ messages in thread
From: Jesper Harder @ 2003-06-20  9:56 UTC (permalink / raw)


Didier Verna <didier@lrde.epita.fr> writes:

> 	The following patch makes `W D d' work properly, along with some
> missing documentation for the Face header.

Hi,

This line:

> +          (set-buffer gnus-original-article-buffer)

fails when previewing a message (`C-c RET P'), because
`gnus-original-article-buffer' is nil in that case.



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

* Re: [COMMIT] Face Fix
  2003-06-20  9:56 ` Jesper Harder
@ 2003-06-20 10:47   ` Katsumi Yamaoka
  2003-06-20 19:34     ` [COMMIT] Face Fix -- still buggy Hanak David
  2003-06-23 12:14     ` [COMMIT] Face Fix Didier Verna
  2003-06-23 12:13   ` Didier Verna
  1 sibling, 2 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2003-06-20 10:47 UTC (permalink / raw)


>>>>> In <m3isr1jcn7.fsf@defun.localdomain>
>>>>>	Jesper Harder <harder@myrealbox.com> wrote:

> Didier Verna <didier@lrde.epita.fr> writes:

>> 	The following patch makes `W D d' work properly, along with some
>> missing documentation for the Face header.

> Hi,

> This line:

>> +          (set-buffer gnus-original-article-buffer)

> fails when previewing a message (`C-c RET P'), because
> `gnus-original-article-buffer' is nil in that case.

Hi,

And Faces in forwarded message/rfc822 parts aren't displayed.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

* Re: [COMMIT] Face Fix -- still buggy
  2003-06-20 10:47   ` Katsumi Yamaoka
@ 2003-06-20 19:34     ` Hanak David
  2003-06-23 17:55       ` Didier Verna
  2003-06-23 12:14     ` [COMMIT] Face Fix Didier Verna
  1 sibling, 1 reply; 8+ messages in thread
From: Hanak David @ 2003-06-20 19:34 UTC (permalink / raw)


Hi,

On Fri, 20 Jun 2003, Katsumi Yamaoka wrote:

> Hi,
>
> And Faces in forwarded message/rfc822 parts aren't displayed.

Actually, the situatuion is much worse.  I've posted two articles about
this to gnu.emacs.gnus (Xref 36143 and 36151), no answer yet, so I repeat
their main point here, who knows...

1. When both X-Face and Face headers are given, both of them are displayed.
   There is no way to favor one.  (Probably the color image.)  Take
   Yamaoka's mail for example.  It could be solved by writing an
   appropriate gnus-part-display-hook, but...

2. When a message *with* Face header contains and rfc822 forwarded message
   *without* Face header, the face of the containing message is displayed at
   the From header of the contained message.  :-/ Very unfortunate.

Any remarks, ideas on how to fix them?

David

P.S. BTW, how can I crosspost those g.e.g articles to g.d?  `B B' reports:

gnus-summary-move-article: The current group does not support article editing

Or I'm off track, and crosspost means something entirely different?



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

* Re: [COMMIT] Face Fix
  2003-06-20  9:56 ` Jesper Harder
  2003-06-20 10:47   ` Katsumi Yamaoka
@ 2003-06-23 12:13   ` Didier Verna
  1 sibling, 0 replies; 8+ messages in thread
From: Didier Verna @ 2003-06-23 12:13 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> wrote:

> This line:
>
>> +          (set-buffer gnus-original-article-buffer)
>
> fails when previewing a message (`C-c RET P'), because
> `gnus-original-article-buffer' is nil in that case.

        Fixed.

-- 
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être, France   Fax.+33 (1) 53 14 59 22   didier@xemacs.org



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

* Re: [COMMIT] Face Fix
  2003-06-20 10:47   ` Katsumi Yamaoka
  2003-06-20 19:34     ` [COMMIT] Face Fix -- still buggy Hanak David
@ 2003-06-23 12:14     ` Didier Verna
  2003-06-23 23:16       ` Katsumi Yamaoka
  1 sibling, 1 reply; 8+ messages in thread
From: Didier Verna @ 2003-06-23 12:14 UTC (permalink / raw)
  Cc: ding

Katsumi Yamaoka <yamaoka@jpl.org> wrote:

> Hi,
>
> And Faces in forwarded message/rfc822 parts aren't displayed.

        There seems to be a general problem for faces x-faces and picons in
this area. I'll look into it.

-- 
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être, France   Fax.+33 (1) 53 14 59 22   didier@xemacs.org



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

* Re: [COMMIT] Face Fix -- still buggy
  2003-06-20 19:34     ` [COMMIT] Face Fix -- still buggy Hanak David
@ 2003-06-23 17:55       ` Didier Verna
  0 siblings, 0 replies; 8+ messages in thread
From: Didier Verna @ 2003-06-23 17:55 UTC (permalink / raw)
  Cc: ding

Hanak David <dhanak@inf.bme.hu> wrote:

> 1. When both X-Face and Face headers are given, both of them are displayed. 
> There is no way to favor one.

        Yup. This is also annoying me. I'll try to find a solution.

-- 
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être, France   Fax.+33 (1) 53 14 59 22   didier@xemacs.org



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

* Re: [COMMIT] Face Fix
  2003-06-23 12:14     ` [COMMIT] Face Fix Didier Verna
@ 2003-06-23 23:16       ` Katsumi Yamaoka
  0 siblings, 0 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2003-06-23 23:16 UTC (permalink / raw)



[-- Attachment #0: Type: message/rfc822, Size: 794 bytes --]

From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: [COMMIT] Face Fix

>>>>> In <mux8yrtxa7h.fsf@uzeb.lrde.epita.fr>
>>>>>	Didier Verna <didier@lrde.epita.fr> wrote:

> Katsumi Yamaoka <yamaoka@jpl.org> wrote:

>> And Faces in forwarded message/rfc822 parts aren't displayed.

drv> There seems to be a general problem for faces x-faces and picons
drv> in this area. I'll look into it.

That's great!  Now I can see all Faces and X-Faces in forwarded
parts.  `W f' and `W D d' don't toggle those Faces though, it is
not a real problem.

Thank you,
-- 
Katsumi Yamaoka <yamaoka@jpl.org>




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

end of thread, other threads:[~2003-06-23 23:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 10:50 [COMMIT] Face Fix Didier Verna
2003-06-20  9:56 ` Jesper Harder
2003-06-20 10:47   ` Katsumi Yamaoka
2003-06-20 19:34     ` [COMMIT] Face Fix -- still buggy Hanak David
2003-06-23 17:55       ` Didier Verna
2003-06-23 12:14     ` [COMMIT] Face Fix Didier Verna
2003-06-23 23:16       ` Katsumi Yamaoka
2003-06-23 12:13   ` Didier Verna

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