unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Organized Learning
Date: Wed, 24 Sep 2003 12:20:28 -0600	[thread overview]
Message-ID: <3F71E06C.7070901@yahoo.com> (raw)
In-Reply-To: m3zngvuexz.fsf@defun.localdomain

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

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:


[-- Attachment #2: totd.el --]
[-- Type: text/plain, Size: 617 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 151 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

  reply	other threads:[~2003-09-24 18:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-22 21:08 Organized Learning Artist
2003-09-24  1:56 ` Jesper Harder
2003-09-24 18:20   ` Kevin Rodgers [this message]
2003-09-24 22:26     ` Dan Anderson
     [not found]     ` <mailman.673.1064442401.21628.help-gnu-emacs@gnu.org>
2003-09-24 22:48       ` lawrence mitchell
2003-09-24 23:06       ` Kevin Rodgers
2003-09-25  8:40     ` Adam Hardy
     [not found]     ` <mailman.696.1064479254.21628.help-gnu-emacs@gnu.org>
2003-09-25 15:01       ` Kevin Rodgers
     [not found]         ` <3F75B6AC.2020305@cyberspaceroad.com>
2003-09-27 20:29           ` Adam Hardy
2003-09-25 13:03   ` Kevin Dziulko
2003-09-25 20:18   ` Artist
2003-10-14 21:15 ` Kai Grossjohann
     [not found] <mailman.705.1064496195.21628.help-gnu-emacs@gnu.org>
2003-09-25 15:20 ` Kevin Rodgers

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F71E06C.7070901@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).