From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Adam Hardy Newsgroups: gmane.emacs.help Subject: Re: Organized Learning Date: Thu, 25 Sep 2003 10:40:11 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F72A9EB.70603@cyberspaceroad.com> References: <3F71E06C.7070901@yahoo.com> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1064479311 3078 80.91.224.253 (25 Sep 2003 08:41:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2003 08:41:51 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 10:41:49 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A2Rh7-0006EC-00 for ; Thu, 25 Sep 2003 10:41:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A2RgQ-0007XE-UG for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2003 04:41:06 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A2RgC-0007Wr-00 for help-gnu-emacs@gnu.org; Thu, 25 Sep 2003 04:40:52 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A2RgA-0007Wh-Ha for help-gnu-emacs@gnu.org; Thu, 25 Sep 2003 04:40:51 -0400 Original-Received: from [212.227.126.189] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A2RgA-0007We-01 for help-gnu-emacs@gnu.org; Thu, 25 Sep 2003 04:40:50 -0400 Original-Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1A2Rg8-00074Z-00 for help-gnu-emacs@gnu.org; Thu, 25 Sep 2003 10:40:48 +0200 Original-Received: from [217.88.247.83] (helo=cyberspaceroad.com) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1A2Rg8-0006ZL-00 for help-gnu-emacs@gnu.org; Thu, 25 Sep 2003 10:40:48 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030917 X-Accept-Language: de-de, en, en-us In-Reply-To: <3F71E06C.7070901@yahoo.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12780 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12780 Here comes the lisp amateur...... I can't get it to work! When I execute (totd) it says "(void-function loop)". Have I got to install some package or something? On 09/24/2003 08:20 PM Kevin Rodgers wrote: > Jesper Harder wrote: > >> googleartist@yahoo.com (Artist) writes: >> >>> I recently came upon a website called Stumbleupon.com where there is >>> a small toolbar to download and you get different website each time >>> you click the stumble icon matching to your interest and then you >>> rate the website etc.. >>> >>> Question: How we can converge the theme of the application with >>> emacs to learn new emacs things >>> >> >> This small code snippet (by Dave Pearson) that displays a "tip of the >> day": >> >> (defun totd () >> (interactive) >> (with-output-to-temp-buffer "*Tip of the day*" >> (let* ((commands (loop for s being the symbols >> when (commandp s) collect s)) >> (command (nth (random (length commands)) commands))) >> (princ >> (concat "Your tip for the day is:\n========================\n\n" >> (describe-function command) >> "\n\nInvoke with:\n\n" >> (with-temp-buffer >> (where-is command t) >> (buffer-string))))))) > > > That could be extended to describe user options as well as commands: > > > ------------------------------------------------------------------------ > > (defun totd () > (interactive) > (with-output-to-temp-buffer "*Tip of the day*" > (let* ((symbols (loop for s being the symbols > when (or (commandp s) (user-variable-p s)) > collect s)) > (symbol (nth (random (length symbols)) symbols))) > (princ > (concat "Your tip for the day is:\n========================\n\n" > (cond ((commandp symbol) > (concat (describe-function symbol) > "\n\nInvoke with:\n\n" > (with-temp-buffer > (where-is symbol t) > (buffer-string)))) > ((user-variable-p symbol) > (describe-variable symbol)))))))) > > > ------------------------------------------------------------------------ > > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://mail.gnu.org/mailman/listinfo/help-gnu-emacs -- GNU Emacs 21.3.1 on Linux 2.4.20 RH9