Created
January 16, 2015 15:09
-
-
Save saintaardvark/375aa054c15f02c42f45 to your computer and use it in GitHub Desktop.
Emacs tip-of-the-day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I changed
loop
tocl-loop
in Emacs 26.1 to make this work.