From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/7263 Path: news.gmane.org!not-for-mail From: Giacomo Boffi Newsgroups: gmane.emacs.gnus.user Subject: Re: TINY signature randomizer Date: Fri, 05 May 2006 12:24:56 +0200 Organization: One Step Beyond Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146825628 22047 80.91.229.2 (5 May 2006 10:40:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 May 2006 10:40:28 +0000 (UTC) Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri May 05 12:40:26 2006 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FbxjN-000528-VH for gegu-info-gnus-english@m.gmane.org; Fri, 05 May 2006 12:40:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbxjM-0001xu-V6 for gegu-info-gnus-english@m.gmane.org; Fri, 05 May 2006 06:40:17 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!switch.ch!newsserver.news.garr.it!newsserver.cilea.it!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 35 Original-NNTP-Posting-Host: boffi95.stru.polimi.it Original-X-Trace: newsserver.cilea.it 1146824692 13151 131.175.189.141 (5 May 2006 10:24:52 GMT) Original-X-Complaints-To: news@cilea.it Original-NNTP-Posting-Date: 5 May 2006 10:24:52 GMT User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b26 (linux) Cancel-Lock: sha1:QDS6geb3WhFJOVBEYxwolKYthCs= Original-Xref: shelby.stanford.edu gnu.emacs.gnus:77445 Original-To: info-gnus-english@gnu.org X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:7263 Archived-At: Giacomo Boffi 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