* one shortcut next occurrence search
@ 2010-12-22 8:20 zismad
2010-12-23 3:03 ` Drew Adams
[not found] ` <mailman.16.1293073448.15570.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 21+ messages in thread
From: zismad @ 2010-12-22 8:20 UTC (permalink / raw)
To: Help-gnu-emacs
Hi all ,
I would like to have a new binding so that if im having the cursur on a
word, one shortcut click (say f3) whould find the next occurrence of the
word in the text and so one.
what is the right bind for it ?
I tried [(control s)(control w)] but its wrong.
thanks !
Zvika
--
View this message in context: http://old.nabble.com/one-shortcut-next-occurrence-search-tp30512323p30512323.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: one shortcut next occurrence search
2010-12-22 8:20 one shortcut next occurrence search zismad
@ 2010-12-23 3:03 ` Drew Adams
2010-12-23 7:22 ` zismad
[not found] ` <mailman.1.1293088974.1406.help-gnu-emacs@gnu.org>
[not found] ` <mailman.16.1293073448.15570.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 21+ messages in thread
From: Drew Adams @ 2010-12-23 3:03 UTC (permalink / raw)
To: 'zismad', Help-gnu-emacs
> I would like to have a new binding so that if im having the
> cursur on a word, one shortcut click (say f3) whould find
> the next occurrence of the word in the text and so one.
What's wrong with ordinary `C-s C-w C-s C-s ...'?
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: one shortcut next occurrence search
2010-12-23 3:03 ` Drew Adams
@ 2010-12-23 7:22 ` zismad
2010-12-23 8:29 ` Tassilo Horn
` (2 more replies)
[not found] ` <mailman.1.1293088974.1406.help-gnu-emacs@gnu.org>
1 sibling, 3 replies; 21+ messages in thread
From: zismad @ 2010-12-23 7:22 UTC (permalink / raw)
To: Help-gnu-emacs
I want the the marked word to be found next when I hit f3.
maybe you'll call me lazy but `C-s C-w' is too much for me ...
thanks
Zvika
Drew Adams wrote:
>
>> I would like to have a new binding so that if im having the
>> cursur on a word, one shortcut click (say f3) whould find
>> the next occurrence of the word in the text and so one.
>
> What's wrong with ordinary `C-s C-w C-s C-s ...'?
>
>
>
>
--
View this message in context: http://old.nabble.com/one-shortcut-next-occurrence-search-tp30512323p30519989.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-23 7:22 ` zismad
@ 2010-12-23 8:29 ` Tassilo Horn
2010-12-23 13:26 ` zismad
2010-12-23 9:17 ` Eli Zaretskii
2010-12-23 17:12 ` Drew Adams
2 siblings, 1 reply; 21+ messages in thread
From: Tassilo Horn @ 2010-12-23 8:29 UTC (permalink / raw)
To: help-gnu-emacs
zismad <zismad@gmail.com> writes:
Hi!
> I want the the marked word to be found next when I hit f3. maybe
> you'll call me lazy but `C-s C-w' is too much for me ...
I use highlight-symbol.el for that (and many other things):
http://nschum.de/src/emacs/highlight-symbol/
That's my config:
(require 'highlight-symbol)
(global-set-key [f8] 'highlight-symbol-at-point)
(global-set-key [(control f8)] 'highlight-symbol-next)
(global-set-key [(meta f8)] 'highlight-symbol-prev)
So F8 highlights any occurrence of the current word (symbol), C-F8 moves
to the next occurrence, M-F8 to the previous occurrence.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-23 8:29 ` Tassilo Horn
@ 2010-12-23 13:26 ` zismad
2010-12-23 13:50 ` Tassilo Horn
0 siblings, 1 reply; 21+ messages in thread
From: zismad @ 2010-12-23 13:26 UTC (permalink / raw)
To: Help-gnu-emacs
thanks a lot Tassilo this is almost exactly as i wanted it to be.
is there anyway where i could search next my makred word
example
if i mark ex1-ex2 from line 1 and I hit f3 i want to it to jump to line 3
and not line2 as it does now :
ex1-ex2 ex3
ex1
ex1-ex2
thanks again
Zvika
Tassilo Horn-5 wrote:
>
> zismad <zismad@gmail.com> writes:
>
> Hi!
>
>> I want the the marked word to be found next when I hit f3. maybe
>> you'll call me lazy but `C-s C-w' is too much for me ...
>
> I use highlight-symbol.el for that (and many other things):
>
> http://nschum.de/src/emacs/highlight-symbol/
>
> That's my config:
>
> (require 'highlight-symbol)
> (global-set-key [f8] 'highlight-symbol-at-point)
> (global-set-key [(control f8)] 'highlight-symbol-next)
> (global-set-key [(meta f8)] 'highlight-symbol-prev)
>
> So F8 highlights any occurrence of the current word (symbol), C-F8 moves
> to the next occurrence, M-F8 to the previous occurrence.
>
> Bye,
> Tassilo
>
>
>
>
--
View this message in context: http://old.nabble.com/one-shortcut-next-occurrence-search-tp30512323p30520429.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-23 13:26 ` zismad
@ 2010-12-23 13:50 ` Tassilo Horn
0 siblings, 0 replies; 21+ messages in thread
From: Tassilo Horn @ 2010-12-23 13:50 UTC (permalink / raw)
To: help-gnu-emacs
zismad <zismad@gmail.com> writes:
Hi Zvika,
> is there anyway where i could search next my makred word
> example
>
> if i mark ex1-ex2 from line 1 and I hit f3 i want to it to jump to line 3
> and not line2 as it does now :
>
> ex1-ex2 ex3
> ex1
> ex1-ex2
For me, doing M-x highlight-symbol-next when point is on the first
line's ex1-ex2 jumps to the ex1-ex2 in line 3, just as you want it to
behave.
BTW: I'd pretty much advise against binding that to F3 (or F4), because
these are bound to macre creation and call by default. Those are much
too useful features to override their bindings.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-23 7:22 ` zismad
2010-12-23 8:29 ` Tassilo Horn
@ 2010-12-23 9:17 ` Eli Zaretskii
2010-12-23 17:12 ` Drew Adams
2 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2010-12-23 9:17 UTC (permalink / raw)
To: Help-gnu-emacs
> Date: Wed, 22 Dec 2010 23:22:48 -0800 (PST)
> From: zismad <zismad@gmail.com>
>
>
> I want the the marked word to be found next when I hit f3.
You never said anything about the word being "marked", in your
original message. You only talked about "having cursor on a word".
How does the "marked" part enters this picture?
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: one shortcut next occurrence search
2010-12-23 7:22 ` zismad
2010-12-23 8:29 ` Tassilo Horn
2010-12-23 9:17 ` Eli Zaretskii
@ 2010-12-23 17:12 ` Drew Adams
2 siblings, 0 replies; 21+ messages in thread
From: Drew Adams @ 2010-12-23 17:12 UTC (permalink / raw)
To: 'zismad', Help-gnu-emacs
> >> I would like to have a new binding so that if im having the
> >> cursur on a word, one shortcut click (say f3) whould find
> >> the next occurrence of the word in the text and so one.
> >
> > What's wrong with ordinary `C-s C-w C-s C-s ...'?
>
> I want the the marked word to be found next when I hit f3.
> maybe you'll call me lazy but `C-s C-w' is too much for me ...
The `C-w' is only to "mark" the word, i.e. to say which word(s) you want to
visit. Thereafter, all you need is `C-s' for "the marked word to be found
next". And you can of course use any other key you like (e.g. f3) instead of
`C-s'.
So wrt laziness: hitting `f3' to visit each occurrence is no more difficult than
hitting `f3' to visit each occurrence. ;-)
> ex1-ex2 ex3
> ex1
> ex1-ex2
For that example, if you want to visit only the `ex1-ex2' occurrences, then
start by `C-s C-w C-w'.
Another alternative, besides `C-s' and the one Tassilo mentioned, is `occur'.
You can also access `occur' from `isearch' (`C-s').
And there are `occur' variants (enhancements) that provide other behavior.
Thierry Volpiatto's `ioccur' is one. Icicles's `C-'' is another
(`icicle-occur'). All of these (including vanilla `occur') let you not only
cycle among occurrences but also visit specific occurrences directly.
http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview#toc2
http://www.emacswiki.org/emacs/OccurMode
^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <mailman.1.1293088974.1406.help-gnu-emacs@gnu.org>]
[parent not found: <mailman.16.1293073448.15570.help-gnu-emacs@gnu.org>]
* Re: one shortcut next occurrence search
[not found] ` <mailman.16.1293073448.15570.help-gnu-emacs@gnu.org>
@ 2010-12-24 9:44 ` rusi
2010-12-24 10:18 ` Teemu Likonen
` (2 more replies)
0 siblings, 3 replies; 21+ messages in thread
From: rusi @ 2010-12-24 9:44 UTC (permalink / raw)
To: help-gnu-emacs
On Dec 23, 8:03 am, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > I would like to have a new binding so that if im having the
> > cursur on a word, one shortcut click (say f3) whould find
> > the next occurrence of the word in the text and so one.
>
> What's wrong with ordinary `C-s C-w C-s C-s ...'?
Thats very nifty -- thanks. So now a meta-question Drew: How do I find
out about things like C-w?
Specifically: How do I poke around in the keymap associated with C-s?
IOW, normally to find out about a keybinding, say C-x o, I'd type C-h
c C-x o, but if I do C-h c C-w I get kill-region -- nothing to do with
the C-w 'inside' C-s.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-24 9:44 ` rusi
@ 2010-12-24 10:18 ` Teemu Likonen
2010-12-24 10:36 ` Elena
2010-12-25 16:37 ` Bob Proulx
2 siblings, 0 replies; 21+ messages in thread
From: Teemu Likonen @ 2010-12-24 10:18 UTC (permalink / raw)
To: help-gnu-emacs
* 2010-12-24 01:44 (-0800), rusi wrote:
> Specifically: How do I poke around in the keymap associated with C-s?
> IOW, normally to find out about a keybinding, say C-x o, I'd type C-h
> c C-x o, but if I do C-h c C-w I get kill-region -- nothing to do with
> the C-w 'inside' C-s.
You can use keys
C-h m
C-h k
C-h b
in isearch mode to get help. This particular feature is also documented
in Emacs reference manual section "19.1.5 Isearch Yanking".
(info "(emacs) Isearch Yank")
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-24 9:44 ` rusi
2010-12-24 10:18 ` Teemu Likonen
@ 2010-12-24 10:36 ` Elena
2010-12-24 10:51 ` Tassilo Horn
[not found] ` <mailman.0.1293187918.15516.help-gnu-emacs@gnu.org>
2010-12-25 16:37 ` Bob Proulx
2 siblings, 2 replies; 21+ messages in thread
From: Elena @ 2010-12-24 10:36 UTC (permalink / raw)
To: help-gnu-emacs
On Dec 24, 10:44 am, rusi <rustompm...@gmail.com> wrote:
> On Dec 23, 8:03 am, "Drew Adams" <drew.ad...@oracle.com> wrote:
>
> > > I would like to have a new binding so that if im having the
> > > cursur on a word, one shortcut click (say f3) whould find
> > > the next occurrence of the word in the text and so one.
>
> > What's wrong with ordinary `C-s C-w C-s C-s ...'?
>
> Thats very nifty -- thanks. So now a meta-question Drew: How do I find
> out about things like C-w?
>
> Specifically: How do I poke around in the keymap associated with C-s?
> IOW, normally to find out about a keybinding, say C-x o, I'd type C-h
> c C-x o, but if I do C-h c C-w I get kill-region -- nothing to do with
> the C-w 'inside' C-s.
"C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
you into Isearch mode (as you can see into modeline), and you can
learn about its keybindings with "C-h m".
Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
h" and so on.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-24 10:36 ` Elena
@ 2010-12-24 10:51 ` Tassilo Horn
2010-12-24 16:39 ` Drew Adams
[not found] ` <mailman.0.1293187918.15516.help-gnu-emacs@gnu.org>
1 sibling, 1 reply; 21+ messages in thread
From: Tassilo Horn @ 2010-12-24 10:51 UTC (permalink / raw)
To: help-gnu-emacs
Elena <egarrulo@gmail.com> writes:
> "C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
> you into Isearch mode (as you can see into modeline), and you can
> learn about its keybindings with "C-h m".
>
> Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
> h" and so on.
Yes, especially C-h b is useful for finding out the bindings for the
preceeding prefix. For example,
C-s C-h b
tells you all bindings of isearch.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: one shortcut next occurrence search
2010-12-24 10:51 ` Tassilo Horn
@ 2010-12-24 16:39 ` Drew Adams
0 siblings, 0 replies; 21+ messages in thread
From: Drew Adams @ 2010-12-24 16:39 UTC (permalink / raw)
To: 'Tassilo Horn', help-gnu-emacs
> > Otherwise, you can try "<prefix key> C-h", that is "C-c
> > C-h", "C-x C-h" and so on.
>
> Yes, especially C-h b is useful for finding out the bindings for the
> preceeding prefix. For example, C-s C-h b tells you all bindings of
> isearch.
Actually, Isearch is the exception in this regard. As Elena indicated,
typically all you have to do is hit the prefix key and then `C-h', to see the
bindings on that key.
IIRC, Isearch (`C-s') used to be that way too (Many Moon Ago), but then for a
long time `C-h' didn't work at all for `C-s'. Then Someone(TM) thought it would
be better for `C-s C-h' to give more general help, not just the bindings. So
now you need to add `b' to get the bindings.
[In Isearch+, I bind `C-s C-h' to a version of the standard command
`isearch-mode-help' that (a) gives help about Isearch and (b) lists the Isearch
key bindings. The (a) part is what vanilla Isearch gives you with `C-s C-h m'.
The (b) part is what it gives you with `C-s C-h b'.]
---
I will make a plug here also for command `describe-keymap' in library
help-fns+.el. It is bound to `C-h M-k'. It gives you a human-readable view of
keymaps. The only thing it leaves out (purposely) are menu bindings.
`C-h M-k RET isearch-mode-map' shows you the same thing as `C-s C-h b'. But the
`C-h' trick does not work with all prefix keys. And there are many keymaps that
are not bound to prefix keys.
`C-h M-k' can be useful even for keymaps that you cannot get to easily, such as
the minibuffer keymaps. You can even use it with `global-map'. But you can use
it only for keymaps that are the value of a variable (you are prompted for the
variable name).
^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <mailman.0.1293187918.15516.help-gnu-emacs@gnu.org>]
* Re: one shortcut next occurrence search
[not found] ` <mailman.0.1293187918.15516.help-gnu-emacs@gnu.org>
@ 2010-12-24 11:17 ` Elena
2010-12-24 11:27 ` Elena
2010-12-24 16:39 ` Drew Adams
2010-12-24 11:27 ` Richard Riley
1 sibling, 2 replies; 21+ messages in thread
From: Elena @ 2010-12-24 11:17 UTC (permalink / raw)
To: help-gnu-emacs
On Dec 24, 11:51 am, Tassilo Horn <tass...@member.fsf.org> wrote:
> Elena <egarr...@gmail.com> writes:
> > "C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
> > you into Isearch mode (as you can see into modeline), and you can
> > learn about its keybindings with "C-h m".
>
> > Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
> > h" and so on.
>
> Yes, especially C-h b is useful for finding out the bindings for the
> preceeding prefix. For example,
>
> C-s C-h b
>
> tells you all bindings of isearch.
I didn't know about the "C-h b". What's the difference? Why I have
to type "C-c C-h", "C-x C-h", etc. but "C-s C-h" does not work whilst
"C-s C-h b" does?
Funnily enough, according to "C-h c", "C-c C-h" and "C-x C-h" are not
bound to anything, neither is "C-h" alone (it is a prefix key).
Thanks.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-24 11:17 ` Elena
@ 2010-12-24 11:27 ` Elena
2010-12-24 16:39 ` Drew Adams
1 sibling, 0 replies; 21+ messages in thread
From: Elena @ 2010-12-24 11:27 UTC (permalink / raw)
To: help-gnu-emacs
On Dec 24, 12:17 pm, Elena <egarr...@gmail.com> wrote:
> Funnily enough, according to "C-h c", "C-c C-h" and "C-x C-h" are not
> bound to anything, neither is "C-h" alone (it is a prefix key).
Wrong. "C-h" is not a prefix key, it is bound to "help". However,
I've not been able to figure out this by using help's bindings: "C-h
c", "C-h C-h b", etc.
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: one shortcut next occurrence search
2010-12-24 11:17 ` Elena
2010-12-24 11:27 ` Elena
@ 2010-12-24 16:39 ` Drew Adams
1 sibling, 0 replies; 21+ messages in thread
From: Drew Adams @ 2010-12-24 16:39 UTC (permalink / raw)
To: 'Elena', help-gnu-emacs
> I didn't know about the "C-h b". What's the difference? Why I have
> to type "C-c C-h", "C-x C-h", etc. but "C-s C-h" does not work whilst
> "C-s C-h b" does?
Someone(TM)'s infinite wisdom. See my earlier message.
> Funnily enough, according to "C-h c", "C-c C-h" and "C-x C-h" are not
> bound to anything, neither is "C-h" alone (it is a prefix key).
Yes, things like `C-c' are sometimes handled specially to get the `C-h'
behavior. `C-h' does not show up on the keymap (which in the case of `C-c' is
`mode-specific-map'). Try `C-h M-k' and you will see.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
[not found] ` <mailman.0.1293187918.15516.help-gnu-emacs@gnu.org>
2010-12-24 11:17 ` Elena
@ 2010-12-24 11:27 ` Richard Riley
1 sibling, 0 replies; 21+ messages in thread
From: Richard Riley @ 2010-12-24 11:27 UTC (permalink / raw)
To: help-gnu-emacs
Tassilo Horn <tassilo@member.fsf.org> writes:
> Elena <egarrulo@gmail.com> writes:
>
>> "C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
>> you into Isearch mode (as you can see into modeline), and you can
>> learn about its keybindings with "C-h m".
>>
>> Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
>> h" and so on.
>
> Yes, especially C-h b is useful for finding out the bindings for the
> preceeding prefix. For example,
>
> C-s C-h b
>
Heh. Learn something new every day ... Thanks!
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: one shortcut next occurrence search
2010-12-24 9:44 ` rusi
2010-12-24 10:18 ` Teemu Likonen
2010-12-24 10:36 ` Elena
@ 2010-12-25 16:37 ` Bob Proulx
2 siblings, 0 replies; 21+ messages in thread
From: Bob Proulx @ 2010-12-25 16:37 UTC (permalink / raw)
To: help-gnu-emacs
rusi wrote:
> Drew Adams wrote:
> > What's wrong with ordinary `C-s C-w C-s C-s ...'?
>
> Thats very nifty -- thanks. So now a meta-question Drew: How do I find
> out about things like C-w?
Once you know a key you can find the documentation associated with the
function associated with that key very easily.
C-h K C-s
That will take you to section 19.1.1 "Basics of Incremental Search"
where you can browse the documentation isearch-forward bound to to
C-s by default. In 19.1.5 "Isearch Yanking" you will encounter C-w.
The hard part is knowing what key you want to read about. But once
you have the key then you can find the documentation quite easily.
Bob
^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <mailman.10.1293068065.15570.help-gnu-emacs@gnu.org>]
end of thread, other threads:[~2010-12-25 16:37 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22 8:20 one shortcut next occurrence search zismad
2010-12-23 3:03 ` Drew Adams
2010-12-23 7:22 ` zismad
2010-12-23 8:29 ` Tassilo Horn
2010-12-23 13:26 ` zismad
2010-12-23 13:50 ` Tassilo Horn
2010-12-23 9:17 ` Eli Zaretskii
2010-12-23 17:12 ` Drew Adams
[not found] ` <mailman.1.1293088974.1406.help-gnu-emacs@gnu.org>
2010-12-23 13:39 ` Vagn Johansen
[not found] ` <mailman.16.1293073448.15570.help-gnu-emacs@gnu.org>
2010-12-24 9:44 ` rusi
2010-12-24 10:18 ` Teemu Likonen
2010-12-24 10:36 ` Elena
2010-12-24 10:51 ` Tassilo Horn
2010-12-24 16:39 ` Drew Adams
[not found] ` <mailman.0.1293187918.15516.help-gnu-emacs@gnu.org>
2010-12-24 11:17 ` Elena
2010-12-24 11:27 ` Elena
2010-12-24 16:39 ` Drew Adams
2010-12-24 11:27 ` Richard Riley
2010-12-25 16:37 ` Bob Proulx
[not found] <mailman.10.1293068065.15570.help-gnu-emacs@gnu.org>
2010-12-23 9:31 ` Elena
2010-12-23 22:06 ` LanX
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).