Gnus development mailing list
 help / color / mirror / Atom feed
From: Leo <sdl.web@gmail.com>
Subject: Re: Message mode Face and X-Face preview
Date: Mon, 27 Nov 2006 23:14:04 +0000	[thread overview]
Message-ID: <m2slg4bhz7.fsf@sl392.st-edmunds.cam.ac.uk> (raw)
In-Reply-To: <m2zmady5up.fsf@sl392.st-edmunds.cam.ac.uk>

On Monday, 27 Nov 2006, Leo wrote:

> On Monday, 27 Nov 2006, Leo wrote:
>
>> (defun sdl-message-display-face ()
>>   "Display any Face headers in the header."
>>   (interactive)
>>   (let (face png image)
>>     (save-restriction
>>       (mail-narrow-to-head)
>>       (setq face (mail-fetch-field "Face")))
>>     (when face
>>       (when (setq png (gnus-convert-face-to-png face))
>> 	(setq image (gnus-create-image png 'png t))
>> 	(message-goto-from)
>> 	(message-beginning-of-line) (backward-char)
>> 	(gnus-add-image 'face image)
>> 	(gnus-put-image image nil 'face)))))
>

[...]

It should be:

(defun sdl-message-display-face ()
  "Display any Face headers in the header."
  (interactive)
  (save-excursion
    (let (faces from)
      (save-restriction
	(mail-narrow-to-head)
	(while (re-search-forward "^Face:" nil t)
	  (push (mail-header-field-value) faces)))
      (goto-char (point-min))
      (setq from (re-search-forward "^From:" nil t))
      (when (and from faces)
	(let (png image)
	  (while faces
	    (when (setq png (gnus-convert-face-to-png (pop faces)))
	      (setq image (gnus-create-image png 'png t))
	      (goto-char from)
	      (gnus-add-image 'face image)
	      (gnus-put-image image nil 'face))))))))

-- 
Leo




      reply	other threads:[~2006-11-27 23:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24 17:40 Leo
2006-11-24 18:00 ` Zlatko Calusic
2006-11-24 18:13 ` Reiner Steib
2006-11-27  1:01   ` Leo
2006-11-27  2:35     ` Leo
2006-11-27 23:14       ` Leo [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=m2slg4bhz7.fsf@sl392.st-edmunds.cam.ac.uk \
    --to=sdl.web@gmail.com \
    /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).