Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Adding "face" in conjunction with gnus-posting-styles
@ 2007-07-23 22:53 Hadron
  2007-07-24 13:52 ` David Z Maze
  0 siblings, 1 reply; 3+ messages in thread
From: Hadron @ 2007-07-23 22:53 UTC (permalink / raw)
  To: info-gnus-english


I currently use the gnus-posting-styles attribute "x-face-file" which
takes an xface file as a parameter.

I wish to add a "face"

(http://gnus.org/manual/gnus_286.html)

I have this in my .gnus

(setq message-required-news-headers
           (nconc message-required-news-headers
                  (list '(Face . (lambda ()
                                   (gnus-face-from-file
           "~/.xfaces/face.jpeg"))))))

Could someone help me integrate it into gnus-posting-styles so it only
adds the face header if the group name contains "pattern".

thanks for any help.

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

* Re: Adding "face" in conjunction with gnus-posting-styles
  2007-07-23 22:53 Adding "face" in conjunction with gnus-posting-styles Hadron
@ 2007-07-24 13:52 ` David Z Maze
  2007-07-30 15:26   ` Hadron
  0 siblings, 1 reply; 3+ messages in thread
From: David Z Maze @ 2007-07-24 13:52 UTC (permalink / raw)
  To: info-gnus-english

Hadron <hadronquark@googlemail.com> writes:

> I currently use the gnus-posting-styles attribute "x-face-file" which
> takes an xface file as a parameter.
>
> I wish to add a "face"

(Note that X-Face and Face are two different syntaxes; both declare a
48x48 graphic, but X-Face has a custom format for a black-and-white
bitmap, Face is a base64-encoded color PNG file.)

> Could someone help me integrate it into gnus-posting-styles so it only
> adds the face header if the group name contains "pattern".

I might do something like

(setq hq-face (gnus-face-from-file "~/.xfaces/face.jpeg"))
(setq gnus-posting-styles (("^gnu\\.emacs\\.gnus$" (face hq-face))))

Or, alternatively

(setq hq-face-file-name (expand-file-name "~/.xfaces/face.jpeg))
(setq gnus-posting-styles
  '(("^gnu\\.emacs\\.gnus$"
     (face (lambda () (gnus-face-from-file hq-face-file-name))))))

The first form should be more efficient in only building the face string
once (at load time); the second form will work if you change the file
name variable or contents of the file while Gnus is running.  You could
also inline it into the posting styles variable itself.

info://gnus/Posting+Styles is pretty informative and has an extended
example you could probably work from.

  --dzm

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

* Re: Adding "face" in conjunction with gnus-posting-styles
  2007-07-24 13:52 ` David Z Maze
@ 2007-07-30 15:26   ` Hadron
  0 siblings, 0 replies; 3+ messages in thread
From: Hadron @ 2007-07-30 15:26 UTC (permalink / raw)
  To: info-gnus-english

David Z Maze <dmaze@mit.edu> writes:

> Hadron <hadronquark@googlemail.com> writes:
>
>> I currently use the gnus-posting-styles attribute "x-face-file" which
>> takes an xface file as a parameter.
>>
>> I wish to add a "face"
>
> (Note that X-Face and Face are two different syntaxes; both declare a
> 48x48 graphic, but X-Face has a custom format for a black-and-white
> bitmap, Face is a base64-encoded color PNG file.)
>
>> Could someone help me integrate it into gnus-posting-styles so it only
>> adds the face header if the group name contains "pattern".
>
> I might do something like
>
> (setq hq-face (gnus-face-from-file "~/.xfaces/face.jpeg"))
> (setq gnus-posting-styles (("^gnu\\.emacs\\.gnus$" (face hq-face))))
>
> Or, alternatively
>
> (setq hq-face-file-name (expand-file-name "~/.xfaces/face.jpeg))
> (setq gnus-posting-styles
>   '(("^gnu\\.emacs\\.gnus$"
>      (face (lambda () (gnus-face-from-file hq-face-file-name))))))
>
> The first form should be more efficient in only building the face string
> once (at load time); the second form will work if you change the file
> name variable or contents of the file while Gnus is running.  You could
> also inline it into the posting styles variable itself.
>
> info://gnus/Posting+Styles is pretty informative and has an extended
> example you could probably work from.
>
>   --dzm

I recently "upgraded" my posting styles to use "rx". Much easier. I now
have:

(setq gnus-posting-styles
      `(

	(
	 ,(rx(or "linux" "ubuntu" "ecb" "emacs" ))
	 (name "Hadron")(address "hadronquark@googlemail.com")
	 (x-face-file "~/.xfaces/hadron.xface")
	 (organization "http://en.wikipedia.org/wiki/Quark")
	 (face (gnus-face-from-file "~/.xfaces/quark.jpg"))
	 (eval (setq pgg-gpg-user-id "********"))
	 )

;; *snip other clauses*

	)

)

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

end of thread, other threads:[~2007-07-30 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-23 22:53 Adding "face" in conjunction with gnus-posting-styles Hadron
2007-07-24 13:52 ` David Z Maze
2007-07-30 15:26   ` Hadron

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