From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim McNamara Newsgroups: gmane.emacs.help Subject: Re: elisp question Date: Thu, 01 Dec 2005 13:32:02 -0600 Organization: ipHouse - Welcome Home! Message-ID: References: <86acfl49nn.fsf@riemann.mri.ernet.in> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133465839 11715 80.91.229.2 (1 Dec 2005 19:37:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Dec 2005 19:37:19 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 01 20:37:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EhuDb-0000Jh-Br for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Dec 2005 20:35:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhuDZ-0005ix-Td for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Dec 2005 14:35:46 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!newsread.com!news-xfer.newsread.com!indigo.octanews.net!green.octanews.net!news-out.octanews.net!news-2.mpls.iphouse.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Cancel-Lock: sha1:JqDy6un/ks0/rTtTNmVvMxsyvy4= Original-Lines: 24 Original-NNTP-Posting-Date: 01 Dec 2005 13:32:02 CST Original-NNTP-Posting-Host: 753a659a.newsreader.iphouse.net Original-X-Trace: DXC=_N4B7d6KGiSXMkU3_QlY5YVn\Tj8`^Bb[eHS>e[L>83P4V09HFNfSNSm:@8]TdIggUf@e7N90MVd]Uh?jdWg@OUU Original-X-Complaints-To: abuse@iphouse.net Original-Xref: shelby.stanford.edu gnu.emacs.help:135978 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31585 Archived-At: "N. Raghavendra" writes: > At 2005-11-30T17:13:33-06:00, Tim McNamara wrote: > >> I am looking to write a small program for Emacs which will create a >> new buffer and read a randomly selected text file into it after >> launching Emacs- rather like yow or fortune, except the files would >> be Dharma snippets. ... >> >> The files are in a subdirectory (called kaya) > > You could use the `fortune.el' which is part of Emacs, and uses > fortune(6) to randomly select a cookie. The relevant init file > expressions are like this: > > (setq fortune-buffer-name "*Dharma*") > (add-hook 'after-init-hook > (lambda () > (fortune (expand-file-name "~/kaya")))) Thank you, I will look into that further. I didn't realize that Emacs had its own fortune program and had errantly thought that the standard Unix fortune was being called. Dang- I've been using Emacs for 2-3 years and am still a newbie!