Gnus development mailing list
 help / color / mirror / Atom feed
From: Rasmus <rasmus@gmx.us>
To: ding@gnus.org
Subject: Re: Posting styles and Faces
Date: Thu, 05 Sep 2013 21:05:02 +0200	[thread overview]
Message-ID: <87sixjt7hd.fsf@gmx.us> (raw)
In-Reply-To: <b4mmwnsqjr2.fsf@jpl.org>


Hi Katsumi,

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Rasmus wrote:
>> I have noticed that I can't insert a (PNG Base64) Face with
>> gnus-posting-styles.  Here's an example that can be evaluated in
>> emacs -q:
>
> #+BEGIN_SRC emacs-lisp
> (progn
>   (require 'gnus-msg)
>   (setq gnus-posting-styles
> 	'((".*"
> 	   (name "Rasmus")
> 	   (address "rasmus@gmx.us")
> 	   (Face "FOO")
> 	   (X-Face "FOO2")
> 	   (-Face "BAR")))
> 	gnus-select-method '(nnml ""))
>   (add-to-list 'gnus-secondary-select-methods
> 	       '(nntp "gmane"
> 		      (nntp-address "news.gmane.org")))
>   (gnus)
>   (gnus-group-mail))
> #+END_SRC
>
>> Note that -Face is present, but neither Face nor X-Face is set.
>
> In that message buffer, what does the variable `message-setup-hook'
> get?  (Try `C-h v message-setup-hook RET' in the message buffer.)
> What I got is as follows and there's nothing strange, i.e., I got
> those three face headers in the message buffer.  That's a mystery.

Mine looks pretty similar to yours cf below.  When switching to
text-mode nothing is shown.  However, when saving the message as a
draft and reading the saved draft in plain text the headers are there!
So I guess Gnus is somehow smart enough to only insert them in the
last moment, which is nice, I guess.  Also, clicking C-c C-c finalizes
the Face headers.

Thanks,
Rasmus

For reference here are the relevant versions:

GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2) of
2013-08-26 on rasmus
Gnus v5.13


#+BEGIN_SRC emacs-lisp
Value: ((lambda nil
   (set
    (make-local-variable 'user-mail-address)
    "rasmus@gmx.us")
   (let
       ((user-full-name "Rasmus")
	(user-mail-address "rasmus@gmx.us"))
     (save-excursion
       (message-remove-header "From")
       (message-goto-eoh)
       (insert "From: "
	       (message-make-from)
	       "\n"))))
 (lambda nil
   (save-excursion
     (message-remove-header "X-Face")
     (let
	 ((value "FOO2"))
       (when value
	 (message-goto-eoh)
	 (insert "X-Face" ": " value)
	 (unless
	     (bolp)
	   (insert "\n"))))))
 (lambda nil
   (save-excursion
     (message-remove-header "Face")
     (let
	 ((value "FOO"))
       (when value
	 (message-goto-eoh)
	 (insert "Face" ": " value)
	 (unless
	     (bolp)
	   (insert "\n"))))))
 (lambda nil
   (save-excursion
     (message-remove-header "-Face")
     (let
	 ((value "BAR"))
       (when value
	 (message-goto-eoh)
	 (insert "-Face" ": " value)
	 (unless
	     (bolp)
	   (insert "\n"))))))
 t)
#+END_SRC 

> #v+
> ((lambda nil
>    (set (make-local-variable 'user-mail-address) "rasmus@gmx.us")
>    (let ((user-full-name "Rasmus")
> 	 (user-mail-address "rasmus@gmx.us"))
>      (save-excursion
>        (message-remove-header "From")
>        (message-goto-eoh)
>        (insert "From: " (message-make-from) "\n"))))
>  (lambda nil
>    (save-excursion
>      (message-remove-header "X-Face")
>      (let ((value "FOO2"))
>        (when value
> 	 (message-goto-eoh)
> 	 (insert "X-Face" ": " value)
> 	 (unless (bolp)
> 	   (insert "\n"))))))
>  (lambda nil
>    (save-excursion
>      (message-remove-header "Face")
>      (let ((value "FOO"))
>        (when value
> 	 (message-goto-eoh)
> 	 (insert "Face" ": " value)
> 	 (unless (bolp)
> 	   (insert "\n"))))))
>  (lambda nil
>    (save-excursion
>      (message-remove-header "-Face")
>      (let ((value "BAR"))
>        (when value
> 	 (message-goto-eoh)
> 	 (insert "-Face" ": " value)
> 	 (unless (bolp)
> 	   (insert "\n"))))))
>  t)
> #v-


-- 
May contains speling mistake




      reply	other threads:[~2013-09-05 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 18:03 Rasmus
2013-09-04 22:56 ` Katsumi Yamaoka
2013-09-05 19:05   ` Rasmus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sixjt7hd.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).