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

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

RE: simple requirement, so simple don't know how to search


From: Maindoor
Subject: RE: simple requirement, so simple don't know how to search
Date: Tue, 2 Feb 2010 20:50:14 -0800 (PST)

Drew,
Thank you for the explanation.
Richard's mail to this thread earlier was 
something that I would be interested in. But it has a major feature flaw.
Buffer local bookmarks ? It would be great if it were global. Another
user wanted global scope too.

Maindoor.

--- On Tue, 2/2/10, Drew Adams <drew.adams@oracle.com> wrote:

From: Drew Adams <drew.adams@oracle.com>
Subject: RE: simple requirement, so simple don't know how to search
To: "'Maindoor'" <sanjeevfiles@yahoo.com>, "'Mario Domenech Goulart'" <mario.goulart@gmail.com>
Cc: help-gnu-emacs@gnu.org
Date: Tuesday, February 2, 2010, 9:20 PM

> Sorry, I'll be more verbose on my requirements this time. and looking at your
> contributions to emacswiki, I can safely assume that such a thing does not
exist
> if you don't know the answer.

Bad assumption - I'm not as knowledgable as you suppose.

And it's not about being verbose. It's about making clear what you're looking
for. Current session only? Multiple buffers? Multiple positions per buffer?
Visual markings? Named positions? The possibilities depend on the answers.

> When browsing file1.c i come to 400th line in function fnA(). I want to
remember
> this particular line. so I press F2.  Then I goto file2.c, look  and I don't
> want to do anything. Then I go to file3.c, and visit line 50 in fnB(). I want
> to remember this, so I press F2. and so on.
> Now I want to browse through the marked places so I press F3 and F4 to go back

> and forth in the list that I marked. The list now contains two entries 400th
line in
> FnA() and 50 the line in FnB().
> I can also limit the total number of entries in the list say to 20 or 50.
> So at most I will be able to remember 20 or 50 places after which the oldest
> entries will be overwritten.
> Now registers and bookmarks will have tags associated with them and I don't
> want to use tags. I just want to browse through the remembered entries.
>   
> Will things-cmd.el serve the purpose ? or is there some other utility ?

No. thing-cmds.el is for selecting things (text). You want to record positions
and then move among them.
   
So based on what you just said, it seems: You want to be able to (quickly -
single key) set a "marker" (placeholder) of sorts at a location, without needing
to provide a name (what you called a "tag"), and later, in the same session,
return to that marker from anywhere else. Even a one-character name (as for a
register) is too much bother. You don't need persistence (cross-session
"markers"), and you don't need named "markers". You don't need to record very
many such places. You don't need more than one such "marker" per buffer (based
on your example).

Richard R. gave you one possibility: library bm.el offers visible, unnamed marks
that you can cycle through.

Another possibility is to use ordinary global marks - see node `Global Mark
Ring' in the Emacs manual. If you do need multiple "markers" in the same buffer,
then use local marks - see node `Mark Ring' in the manual. You can cycle among
the marks in either ring.

Using the mark rings, you cannot easily see the possible destinations, and it
can take a moment to see where you've arrived (cursor location) after you move
to a mark. Library bm.el helps with that by making marked positions visible.

If you use Icicles, then you can trip around among local and global marks more
flexibly, and you can also see easily where you've arrived (cross-hairs). You
can cycle among marks, but you can also move directly to any mark you want. See
http://www.emacswiki.org/emacs/Icicles_-_Tripping (commands `icicle-goto-marker'
and `icicle-goto-global-marker').

This direct access is possible because, though you don't name the marks, you can
refer to the text (lines) they are in to distinguish them. The text around each
mark is an Icicles completion candidate. When you cycle among candidates, you
can simultaneously move to their locations.

You can cycle through them all to get to one you want (which is OK if there are
few), or you can type a bit of text to narrow the candidates down, then cycle or
type some more, etc. Or you can just pick candidates from the *Completions*
buffer with the mouse.

If you decide you do want persistent "markers", but you still don't want to name
them, you can use Icicles together with Bookmark+ to get what you want. The same
key is used for setting a (book)mark and jumping to (any number of) bookmarks.
With `-' as prefix arg, you jump. With `0' or any other digit, you set (mark).
Or bind your own keys.

When you define a bookmark this way, it is named automatically, without any
interaction. The name is taken from the position's context: the buffer name plus
some text from the line (or the region, if active). You can use Icicles to trip
around among candidate bookmarks the same way as among Emacs marks.

HTH.



reply via email to

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