From: Giacomo Boffi <giacomo.boffi@polimi.it>
Subject: Re: TINY signature randomizer
Date: Fri, 05 May 2006 12:24:56 +0200 [thread overview]
Message-ID: <n9mwtd022h3.fsf@boffi95.stru.polimi.it> (raw)
In-Reply-To: <n9mzmig6y56.fsf@boffi95.stru.polimi.it>
Giacomo Boffi <giacomo.boffi@polimi.it> writes:
> ;; 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")))
(let ((lista (split-string (buffer-string ) "\n%\n")))
> (elt lista (random (length lista))))))
> (setq message-signature 'sig_rand)
sorry, the original version is good for XEmacs, but does not run in
Emacs, where
,----
| buffer-string is a built-in function in `C source code'.
| (buffer-string)
|
| Return the contents of the current buffer as a string.
| If narrowing is in effect, this function returns only the visible part
| of the buffer.
`----
the corrected version works in XEmacs too, as the BUFFER argument is
optional
--
Sarebbe essere un atto di pieta'.
Contro i miei principi. -- whip, in IFMdI
prev parent reply other threads:[~2006-05-05 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-20 15:54 Giacomo Boffi
2006-05-05 10:24 ` Giacomo Boffi [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=n9mwtd022h3.fsf@boffi95.stru.polimi.it \
--to=giacomo.boffi@polimi.it \
/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).