info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improving xface insertion


From: giglio robbo' d'acciaio
Subject: Improving xface insertion
Date: Tue, 04 Aug 2009 15:17:42 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hi, I use the following lisp function to insert a random face header pic in my
posts.

,----
| (defun random-face-header-insert ()
|   (let* ((faces (directory-files "~/News/xfaces" t "\\.png\\(\\.0\\)?$"))
|        (face (nth (random (length faces)) faces)))
|     (save-excursion  
|       (goto-char (point-min))    
|       (insert "Face: "  (gnus-convert-png-to-face face) "\n")    
|       (when (string-match "0$" face)
|       (insert "Face: "
|               (gnus-convert-png-to-face (replace-match face "0$" "1"))
|               "\n")))))
| 
| (add-hook 'message-send-hook 'random-face-header-insert)
`----

Though it doesn't check if a such header is already inserted in case it
prevents to insert it again. How can I do it?

Thanks in advance.
-- 
      Daniele Giglio      Dona i tuoi cicli di clock alla ricerca!
                          http://boinc.berkeley.edu/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]