unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Tip of the day: buffer navigation with global mark
@ 2003-04-05 20:39 Kai Großjohann
  2003-04-06 10:43 ` maierh
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ 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] 16+ messages in thread

* Re: Tip of the day: buffer navigation with global mark
  2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
@ 2003-04-06 10:43 ` maierh
  2003-04-06 15:12 ` D. Goel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: maierh @ 2003-04-06 10:43 UTC (permalink / raw)



"Tip of the day" a nice service:).
Harald

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day: buffer navigation with global mark
  2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
  2003-04-06 10:43 ` maierh
@ 2003-04-06 15:12 ` D. Goel
  2003-04-06 15:51 ` Bruce Ingalls
  2003-04-07 15:35 ` Tip of the day Robert Epprecht
  3 siblings, 0 replies; 16+ messages in thread
From: D. Goel @ 2003-04-06 15:12 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) writes:
> later on, C-x C-@ will go back to the original buffer.

And if C-@ is a bit hard to type, C-x C-SPC has the same binding :) 


DG                                 http://gnufans.net/
--

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day: buffer navigation with global mark
  2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
  2003-04-06 10:43 ` maierh
  2003-04-06 15:12 ` D. Goel
@ 2003-04-06 15:51 ` Bruce Ingalls
  2003-04-07 17:17   ` John Russell
  2003-04-07 15:35 ` Tip of the day Robert Epprecht
  3 siblings, 1 reply; 16+ messages in thread
From: Bruce Ingalls @ 2003-04-06 15:51 UTC (permalink / raw)


I like these Tip Of The Days. I hope they outlast the Package Of the Week
http://varnam.org/ (not much left)
I look at many of these tips as a shortcoming in usability. Such is to be
expected in a powerful system, such as Emacs.

For example, if these bookmarks are really useful, it would be nice to put
them into a submenu, with keystrokes displayed, which make it easier to
learn them.
I would put the history of the last 8 in the menu, and these would display
the line number, and the 10 chars following the bookmark.

Here are some other suggestions:
You might consider beginner & expert levels of Tip of the Day.
For example, I do
C-u 3 C-k
C-y
C-y
all the time to copy 3 lines, but you'd be surprised at how many, even long
term Emacs users, don't know this one.

Here's a better suggestion:
Create a tips splash screen, that users can defcustom().
It might explain to users, how they can use customize() to turn it off.
It might also explain, that when it runs out of tips in the local 
package, that
it goes out to the web for more, and how they can disable that feature.

This is where *beginner* tips would come in handy; they'd likely bore our
gnu.emacs.help audience.

Kai Großjohann wrote:
> 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.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day
  2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
                   ` (2 preceding siblings ...)
  2003-04-06 15:51 ` Bruce Ingalls
@ 2003-04-07 15:35 ` Robert Epprecht
  2003-04-07 17:00   ` Kai Großjohann
  2003-04-07 18:47   ` David Kastrup
  3 siblings, 2 replies; 16+ messages in thread
From: Robert Epprecht @ 2003-04-07 15:35 UTC (permalink / raw)



I gave her my finger, but she wanted my arm...  ;-)

Kai, I like your tips.

Hope we'll see more of them,
Robert

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day
  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
  1 sibling, 0 replies; 16+ messages in thread
From: Kai Großjohann @ 2003-04-07 17:00 UTC (permalink / raw)


Robert Epprecht <epprecht@solnet.ch> writes:

> I gave her my finger, but she wanted my arm...  ;-)
>
> Kai, I like your tips.

I've been collecting them; maybe the splash screen thing can be
implemented someday.
-- 
A preposition is not a good thing to end a sentence with.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day: buffer navigation with global mark
  2003-04-06 15:51 ` Bruce Ingalls
@ 2003-04-07 17:17   ` John Russell
  0 siblings, 0 replies; 16+ messages in thread
From: John Russell @ 2003-04-07 17:17 UTC (permalink / raw)


Bruce Ingalls <bingalls@CUT-this-SPAM-BLOCK.fit-zones.com> writes:

> Here are some other suggestions:
> You might consider beginner & expert levels of Tip of the Day.
> For example, I do
> C-u 3 C-k
> C-y
> C-y
> all the time to copy 3 lines, but you'd be surprised at how many, even long
> term Emacs users, don't know this one.

How about this: 

(defun duplicate-line (&optional where)
  "Duplicate the line containing point."
  (interactive "d")
  (save-excursion
    (beginning-of-line)
    (let ((beg (point)))
      (end-of-line)
      (copy-region-as-kill beg (point)))
    (end-of-line)
    (if (eobp)
	(insert ?\n)
      (forward-line))
    (open-line 1)
    (yank)))

(define-key global-map [?whatever] 'duplicate-line)

John

PS Lifted this from some unknown .emacs file on the web, 
but I use it constantly.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day
  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
  1 sibling, 1 reply; 16+ messages in thread
From: David Kastrup @ 2003-04-07 18:47 UTC (permalink / raw)


Robert Epprecht <epprecht@solnet.ch> writes:

> I gave her my finger, but she wanted my arm...  ;-)
> 
> Kai, I like your tips.

His fingertips?

> Hope we'll see more of them,

You want his arm?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Tip of the day
  2003-04-07 18:47   ` David Kastrup
@ 2003-04-07 19:28     ` Robert Epprecht
  0 siblings, 0 replies; 16+ messages in thread
From: Robert Epprecht @ 2003-04-07 19:28 UTC (permalink / raw)


David Kastrup <dak@gnu.org> writes:

> Robert Epprecht <epprecht@solnet.ch> writes:
>
>> I gave her my finger, but she wanted my arm...  ;-)
>> 
>> Kai, I like your tips.
>
> His fingertips?
>
>> Hope we'll see more of them,
>
> You want his arm?

I'd prefer his brains
and his ability to help so many people all over the world :-)

Robert

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Tip of the day
@ 2007-06-24 20:32 Adam
  2007-06-24 20:43 ` Tassilo Horn
  0 siblings, 1 reply; 16+ 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] 16+ messages in thread

* Re: Tip of the day
  2007-06-24 20:32 Adam
@ 2007-06-24 20:43 ` Tassilo Horn
  2007-06-24 21:58   ` Adam
  0 siblings, 1 reply; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread

end of thread, other threads:[~2007-06-25  9:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-05 20:39 Tip of the day: buffer navigation with global mark Kai Großjohann
2003-04-06 10:43 ` maierh
2003-04-06 15:12 ` D. Goel
2003-04-06 15:51 ` Bruce Ingalls
2003-04-07 17:17   ` John Russell
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
  -- strict thread matches above, loose matches on Subject: below --
2007-06-24 20:32 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

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