Gnus development mailing list
 help / color / mirror / Atom feed
* Posting styles and Faces
@ 2013-09-04 18:03 Rasmus
  2013-09-04 22:56 ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Rasmus @ 2013-09-04 18:03 UTC (permalink / raw)
  To: ding

Hi,

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.  I
have tried various things to get it there such as loading Face as an
optional field in message-required-mail-headers, but without success.
Is this desired behavior?

–Rasmus

-- 
. . . The proofs are technical in nature and provides no real understanding.




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

* Re: Posting styles and Faces
  2013-09-04 18:03 Posting styles and Faces Rasmus
@ 2013-09-04 22:56 ` Katsumi Yamaoka
  2013-09-05 19:05   ` Rasmus
  0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2013-09-04 22:56 UTC (permalink / raw)
  To: ding

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.

#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-



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

* Re: Posting styles and Faces
  2013-09-04 22:56 ` Katsumi Yamaoka
@ 2013-09-05 19:05   ` Rasmus
  0 siblings, 0 replies; 3+ messages in thread
From: Rasmus @ 2013-09-05 19:05 UTC (permalink / raw)
  To: ding


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




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

end of thread, other threads:[~2013-09-05 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-04 18:03 Posting styles and Faces Rasmus
2013-09-04 22:56 ` Katsumi Yamaoka
2013-09-05 19:05   ` Rasmus

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