Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* TINY signature randomizer
@ 2006-04-20 15:54 Giacomo Boffi
  2006-05-05 10:24 ` Giacomo Boffi
  0 siblings, 1 reply; 2+ messages in thread
From: Giacomo Boffi @ 2006-04-20 15:54 UTC (permalink / raw)


;; At present, it works with a "~/.signature" file, where (possibly
;; multiline) stuff is separated by a line containing ONLY a "%"
;;
;; Change the filename in expand-file-name and the separator in
;; split-string below as you feel appropriate, and drop in your
;; "~/.gnus"
;;
(defun sig_rand ()
  (with-temp-buffer
    (insert-file-contents-literally (expand-file-name "~/.signature"))
    (let ((lista (split-string (buffer-string (current-buffer)) "\n%\n")))
      (elt lista (random (length lista))))))
(setq message-signature 'sig_rand)
-- 
sapete contare fino a venticinque?
Olimpia Milano Jugoplastika Split Partizan Beograd
Roberto Premier Duska Ivanovic Zarko Paspalj

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

end of thread, other threads:[~2006-05-05 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-20 15:54 TINY signature randomizer Giacomo Boffi
2006-05-05 10:24 ` Giacomo Boffi

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