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

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

Improving faces inserting


From: giglio robbo' d'acciaio
Subject: Improving faces inserting
Date: Wed, 30 Apr 2008 18:26:35 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

I use the following function in order to insert a random faces:

,----
| (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)
`----

I'd like to improve it testing before sending if a faces header is already
present.
Can you help me? Thanks.
-- 
      Daniele Giglio      Dona i tuoi cicli di clock alla ricerca!
      email in ROT13      http://boinc.berkeley.edu/
      qtvtyvb@vby.vg
                          --------------------
           This signature was automatically generated with
           Signify v1.14.  For this and other cool products,
           check out http://www.debian.org/





reply via email to

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