help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: elisp question


From: N. Raghavendra
Subject: Re: elisp question
Date: 01 Dec 2005 11:54:28 +0530
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

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

HTH,
Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute   | and OpenPGP details.


reply via email to

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