Discussion:
[9fans] Acme: how to search only in selection
(too old to reply)
dexen deVries
2012-08-09 13:11:01 UTC
Permalink
Hi list,


how do I perform right-click search only in highlighted range?


Use case: while editing C-like code (PHP), I highlight whole function by
clicking on opening brace and would like to search only the selection for all
occurrences of some symbol stored in window's tag. Preferably with wrap-around
after reaching end of the selection :D


(cue boyd with ``it's easier to post to 9fans than to think'')
--
dexen deVries

[[[↓][→]]]
Rudolf Sykora
2012-08-09 13:46:47 UTC
Permalink
Post by dexen deVries
Hi list,
how do I perform right-click search only in highlighted range?
Use case: while editing C-like code (PHP), I highlight whole function by
clicking on opening brace and would like to search only the selection for all
occurrences of some symbol stored in window's tag. Preferably with wrap-around
after reaching end of the selection :D
(cue boyd with ``it's easier to post to 9fans than to think'')
--
dexen deVries
[[[↓][→]]]
I don't know a direct way and am afraid there is no one immediately
ready to use.
Once the text is selected, however, you may fairly easily copy it to a
new window, and then rightclicking should work, even with a
wrap-around...

Otherwise, using '>g pattern' will make a list, in the Error window,
of lines where the pattern is, so then you can go through it.

Ruda
dexen deVries
2012-08-09 14:00:09 UTC
Permalink
Post by Rudolf Sykora
(...)
Otherwise, using '>g pattern' will make a list, in the Error window,
of lines where the pattern is, so then you can go through it.
thank you, Ruda, this solves my problem :^)
--
dexen deVries

[[[↓][→]]]
Matthew Veety
2012-08-09 15:28:08 UTC
Permalink
Post by dexen deVries
Post by Rudolf Sykora
(...)
Otherwise, using '>g pattern' will make a list, in the Error window,
of lines where the pattern is, so then you can go through it.
thank you, Ruda, this solves my problem :^)
--
dexen deVries
[[[↓][→]]]
This sounds like a good feature to add though. Might hack on this tonight.

--
Veety
Paul Lalonde
2012-08-09 15:47:26 UTC
Permalink
The real question is how to handle the next selection; tracking two
dots seems wrong.
Post by Matthew Veety
Post by dexen deVries
Post by Rudolf Sykora
(...)
Otherwise, using '>g pattern' will make a list, in the Error window,
of lines where the pattern is, so then you can go through it.
thank you, Ruda, this solves my problem :^)
--
dexen deVries
[[[↓][→]]]
This sounds like a good feature to add though. Might hack on this tonight.
--
Veety
dexen deVries
2012-08-09 17:30:57 UTC
Permalink
Post by Paul Lalonde
The real question is how to handle the next selection; tracking two
dots seems wrong.
i believe Ruda's solution comes very close: pipe selected range to separate
window (+Error, if you must) and then operate on it. However, it is not good
enough: line numbers do not match original file.

Is there a way to recover range of dot from script ran from Acme window? I
couldn't find; expected the `acme/$winid/addr' file to contain char ranges of
dot after `echo addr=dot | 9p write acme/$winid/ctl', but the
`acme/$winid/addr' stays `0 0'. Using plan9port here.

If there was a way to get $firstLine, $lastLine or $firstChar, $lastChar, it'd
be easy enough to filter lines with sed or awk for match of both RegEx and line
number or char range. Or to re-number lines as output by grep.
--
dexen deVries

1972 - Dennis Ritchie invents a powerful gun that shoots both forward and
backward simultaneously. Not satisfied with the number of deaths and permanent
maimings from that invention he invents C and Unix.
erik quanstrom
2012-08-09 19:08:12 UTC
Permalink
Post by dexen deVries
1972 - Dennis Ritchie invents a powerful gun that shoots both forward and
backward simultaneously. Not satisfied with the number of deaths and permanent
maimings from that invention he invents C and Unix.
i think it crosses some line to imply that dennis intended folks
physical harm, even if the whole thing is absurd.

- erik
Kurt H Maier
2012-08-09 19:27:55 UTC
Permalink
Post by erik quanstrom
i think it crosses some line to imply that dennis intended folks
physical harm, even if the whole thing is absurd.
http://en.wikipedia.org/wiki/Comedic_device#Hyperbole
dexen deVries
2012-08-09 20:00:41 UTC
Permalink
Post by erik quanstrom
Post by dexen deVries
1972 - Dennis Ritchie invents a powerful gun that shoots both forward and
backward simultaneously. Not satisfied with the number of deaths and
permanent maimings from that invention he invents C and Unix.
i think it crosses some line to imply that dennis intended folks
physical harm, even if the whole thing is absurd.
% src
http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html

for me, almost everything goes in comedy. if anything, more regretable is lack
of attribution to ken et al.
--
dexen deVries
Continue reading on narkive:
Loading...