9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Acme: how to search only in selection
@ 2012-08-09 13:11 dexen deVries
  2012-08-09 13:46 ` Rudolf Sykora
  0 siblings, 1 reply; 9+ messages in thread
From: dexen deVries @ 2012-08-09 13:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

[[[↓][→]]]



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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 13:11 [9fans] Acme: how to search only in selection dexen deVries
@ 2012-08-09 13:46 ` Rudolf Sykora
  2012-08-09 14:00   ` dexen deVries
  0 siblings, 1 reply; 9+ messages in thread
From: Rudolf Sykora @ 2012-08-09 13:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 9 August 2012 15:11, dexen deVries <dexen.devries@gmail.com> wrote:
> 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



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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 13:46 ` Rudolf Sykora
@ 2012-08-09 14:00   ` dexen deVries
  2012-08-09 15:28     ` Matthew Veety
  0 siblings, 1 reply; 9+ messages in thread
From: dexen deVries @ 2012-08-09 14:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thursday 09 of August 2012 15:46:47 Rudolf Sykora wrote:
> (...)
> 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

[[[↓][→]]]




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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 14:00   ` dexen deVries
@ 2012-08-09 15:28     ` Matthew Veety
  2012-08-09 15:47       ` Paul Lalonde
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Veety @ 2012-08-09 15:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

On Aug 9, 2012 10:00 AM, "dexen deVries" <dexen.devries@gmail.com> wrote:
>
> On Thursday 09 of August 2012 15:46:47 Rudolf Sykora wrote:
> > (...)
> > 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

[-- Attachment #2: Type: text/html, Size: 693 bytes --]

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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 15:28     ` Matthew Veety
@ 2012-08-09 15:47       ` Paul Lalonde
  2012-08-09 17:30         ` dexen deVries
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Lalonde @ 2012-08-09 15:47 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

The real question is how to handle the next selection; tracking two
dots seems wrong.

On Thu, Aug 9, 2012 at 8:28 AM, Matthew Veety <mveety@gmail.com> wrote:
>
> On Aug 9, 2012 10:00 AM, "dexen deVries" <dexen.devries@gmail.com> wrote:
>>
>> On Thursday 09 of August 2012 15:46:47 Rudolf Sykora wrote:
>> > (...)
>> > 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



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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 15:47       ` Paul Lalonde
@ 2012-08-09 17:30         ` dexen deVries
  2012-08-09 19:08           ` erik quanstrom
  0 siblings, 1 reply; 9+ messages in thread
From: dexen deVries @ 2012-08-09 17:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thursday 09 of August 2012 08:47:26 Paul Lalonde wrote:
> 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.



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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 17:30         ` dexen deVries
@ 2012-08-09 19:08           ` erik quanstrom
  2012-08-09 19:27             ` Kurt H Maier
  2012-08-09 20:00             ` dexen deVries
  0 siblings, 2 replies; 9+ messages in thread
From: erik quanstrom @ 2012-08-09 19:08 UTC (permalink / raw)
  To: 9fans

> 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



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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 19:08           ` erik quanstrom
@ 2012-08-09 19:27             ` Kurt H Maier
  2012-08-09 20:00             ` dexen deVries
  1 sibling, 0 replies; 9+ messages in thread
From: Kurt H Maier @ 2012-08-09 19:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thu, Aug 09, 2012 at 03:08:12PM -0400, erik quanstrom wrote:
>
> 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



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

* Re: [9fans] Acme: how to search only in selection
  2012-08-09 19:08           ` erik quanstrom
  2012-08-09 19:27             ` Kurt H Maier
@ 2012-08-09 20:00             ` dexen deVries
  1 sibling, 0 replies; 9+ messages in thread
From: dexen deVries @ 2012-08-09 20:00 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thursday 09 of August 2012 15:08:12 erik quanstrom wrote:
> > 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




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

end of thread, other threads:[~2012-08-09 20:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-09 13:11 [9fans] Acme: how to search only in selection dexen deVries
2012-08-09 13:46 ` Rudolf Sykora
2012-08-09 14:00   ` dexen deVries
2012-08-09 15:28     ` Matthew Veety
2012-08-09 15:47       ` Paul Lalonde
2012-08-09 17:30         ` dexen deVries
2012-08-09 19:08           ` erik quanstrom
2012-08-09 19:27             ` Kurt H Maier
2012-08-09 20:00             ` dexen deVries

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 NNTP newsgroup(s).