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

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

Re: Tip of the day


From: Tassilo Horn
Subject: Re: Tip of the day
Date: Sun, 24 Jun 2007 22:43:04 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Adam <nospam@example.com> writes:

Hi Adam,

> There was a note on planet.emacsen.org regarding a "Tip of the Day"
> prompt.
>
> I can't see any totd in the Emacs manual, or via C-H help. It sounds a
> nice idea though.

The code was provided in the blog article. Here it is:

--8<---------------cut here---------------start------------->8---
(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"
               "========================nn"
               (describe-function command)
               "nnInvoke with:nn"
               (with-temp-buffer
                 (where-is command t)
                 (buffer-string)))))))
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo
-- 
When Chuck Norris plays Monopoly, it affects the actual world economy.


reply via email to

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