* Tip of the day
@ 2007-06-24 20:32 Adam
2007-06-24 20:43 ` Tassilo Horn
0 siblings, 1 reply; 11+ messages in thread
From: Adam @ 2007-06-24 20:32 UTC (permalink / raw)
To: help-gnu-emacs
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.
Can anyone advise if or where there's a
Tip of the Day package for Emacs.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Tip of the day
2007-06-24 20:32 Tip of the day Adam
@ 2007-06-24 20:43 ` Tassilo Horn
2007-06-24 21:58 ` Adam
0 siblings, 1 reply; 11+ messages in thread
From: Tassilo Horn @ 2007-06-24 20:43 UTC (permalink / raw)
To: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Tip of the day
2007-06-24 20:43 ` Tassilo Horn
@ 2007-06-24 21:58 ` Adam
2007-06-24 22:51 ` Tyler Smith
0 siblings, 1 reply; 11+ messages in thread
From: Adam @ 2007-06-24 21:58 UTC (permalink / raw)
To: help-gnu-emacs
Thanks Tassilo.
Forgive my ignorance, I suppose really I was wanting
to give that function a test-run, by not including it
in my startup file, but by entering it into my Emacs
session. Then running (totd) or M-x totd
Then including in .emacs, and binding to a key later.
Is this possible, by entering the function into
the *scratch* buffer and evaluating it somehow.
Or should I be in a buffer of a more of an
interactive mode?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Tip of the day
2007-06-24 21:58 ` Adam
@ 2007-06-24 22:51 ` Tyler Smith
2007-06-24 23:13 ` Adam
2007-06-25 6:58 ` Christian Herenz
0 siblings, 2 replies; 11+ messages in thread
From: Tyler Smith @ 2007-06-24 22:51 UTC (permalink / raw)
To: help-gnu-emacs
On 2007-06-24, Adam <nospam@example.com> wrote:
>
> Thanks Tassilo.
>
> Forgive my ignorance, I suppose really I was wanting
> to give that function a test-run, by not including it
> in my startup file, but by entering it into my Emacs
> session. Then running (totd) or M-x totd
>
> Then including in .emacs, and binding to a key later.
>
> Is this possible, by entering the function into
> the *scratch* buffer and evaluating it somehow.
>
Yes, if you copy the function to scratch, move the cursor to the line
after the end of the function, you can evaluate it with C-x C-e. You can
then run the code with M-x totd <ret> or M-: (totd) <ret>.
Note that you should probably change the 'n' values in the concat
strings to '\n' to get properly formatted output.
HTH,
Tyler
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Tip of the day
2007-06-24 22:51 ` Tyler Smith
@ 2007-06-24 23:13 ` Adam
2007-06-25 6:58 ` Christian Herenz
1 sibling, 0 replies; 11+ messages in thread
From: Adam @ 2007-06-24 23:13 UTC (permalink / raw)
To: help-gnu-emacs
> Yes, if you copy the function to scratch, move the cursor to the line
> after the end of the function, you can evaluate it with C-x C-e. You can
> then run the code with M-x totd <ret> or M-: (totd) <ret>.
Ah ha. I was placing the cursor at the opening
bracket of the function - and getting an "End of
file during parsing" error.
[Maybe its the Slime C-x C-e that works at either end].
> Note that you should probably change the 'n' values in the concat
> strings to '\n' to get properly formatted output.
Yes - correcting the 4 instances of that make
it comfortably legible.
Wonderful. Many thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Tip of the day
2007-06-24 22:51 ` Tyler Smith
2007-06-24 23:13 ` Adam
@ 2007-06-25 6:58 ` Christian Herenz
2007-06-25 9:20 ` Tassilo Horn
1 sibling, 1 reply; 11+ messages in thread
From: Christian Herenz @ 2007-06-25 6:58 UTC (permalink / raw)
To: help-gnu-emacs
> Yes, if you copy the function to scratch, move the cursor to the line
> after the end of the function, you can evaluate it with C-x C-e. You can
> then run the code with M-x totd <ret> or M-: (totd) <ret>.
>
> Note that you should probably change the 'n' values in the concat
> strings to '\n' to get properly formatted output.
>
> HTH,
>
> Tyler
Hi,
Thanks for describing this here, I wondered about the n's ... Now it
really looks good!
Greetz,
Christian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Tip of the day
2007-06-25 6:58 ` Christian Herenz
@ 2007-06-25 9:20 ` Tassilo Horn
0 siblings, 0 replies; 11+ messages in thread
From: Tassilo Horn @ 2007-06-25 9:20 UTC (permalink / raw)
To: help-gnu-emacs
Christian Herenz <herenz@physik.hu-berlin.de> writes:
Hi,
>> Note that you should probably change the 'n' values in the concat
>> strings to '\n' to get properly formatted output.
>
> Thanks for describing this here, I wondered about the n's ... Now it
> really looks good!
Ups, I simply copy&pasted it from the web page planet.emacsen.org. ;-)
Bye,
Tassilo
--
Chuck Norris did not "lose" his virginity, he stalked it and then
destroyed it with extreme prejudice.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Tip of the day: buffer navigation with global mark
@ 2003-04-05 20:39 Kai Großjohann
2003-04-07 15:35 ` Tip of the day Robert Epprecht
0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2003-04-05 20:39 UTC (permalink / raw)
It is well known that you can do C-SPC at various spots in a buffer,
and subsequently, C-u C-SPC takes you back. (Repeat to go further
back.) Kinda like the web browser history.
But it is less well known, I think, that the global mark ring exists
and can be navigated in a similar manner. If the previous mark was
set in another buffer, C-SPC also pushes mark on the global mark
ring. This can be used with C-x C-@ to jump back to it.
So you can do C-SPC, then go to another buffer and do stuff. Then
later on, C-x C-@ will go back to the original buffer.
It might land you in the wrong spot, though. But C-u C-SPC will cure
that.
--
A preposition is not a good thing to end a sentence with.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-06-25 9:20 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-24 20:32 Tip of the day Adam
2007-06-24 20:43 ` Tassilo Horn
2007-06-24 21:58 ` Adam
2007-06-24 22:51 ` Tyler Smith
2007-06-24 23:13 ` Adam
2007-06-25 6:58 ` Christian Herenz
2007-06-25 9:20 ` Tassilo Horn
-- strict thread matches above, loose matches on Subject: below --
2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
2003-04-07 15:35 ` Tip of the day Robert Epprecht
2003-04-07 17:00 ` Kai Großjohann
2003-04-07 18:47 ` David Kastrup
2003-04-07 19:28 ` Robert Epprecht
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).