Quoth sirjofri via 9fans <[email protected]>:
[…]
> I think most people (including me) who want to execute text with
> spaces and don't want to select a line put the text into parentheses
> or brackets () [] {}.  In case you don't know, you can double click
> one of the parentheses to select everything that it encloses.  You can
> then middle click the selection like usual.
> 
> Some people put commands they use more often into scratch files like that.
[…]

Indeed.  For example, to create a debug "menu" in the tag line of
acme, one can exploit a variation of the following snippet to ease
debugging via chording, double click, middle clicking:

  ---
  RUN: (acid -l ACIDFILE PID)
  BRK: (bpset(FUNNAME)) | (bpset(filepc("src:line"))) | (bptab())
  SRC: (Bsrc(*PC))      | (src(*PC))
  STP: (cont())         | (next())                    | (run())
  SEE: ((TYPE)FUN:VAR)  ((*FUN:VAR)\D)
  ---

The reason commands are wrapped in parentheses is to speed up
selection by double clicking right after ( or before ).

This functionality might be a bit hard to imagine.  Hence, there is a
screencast demonstrating its use here:

• http://www.9lab.org/plan9/debugging-with-acid/

Note that you can develop your own set of "menus" if you are using
acme for a variety of different tasks (edit text, debug, compose and
process emails, analyze data,…) that you can expand in the tag line by
middle clicking.  For example, to have the above debug menu at a click
of the middle buttin one ca simply type 'a/tag/acid' and middle click,
where 'a/tag/acid' might contain the following:

  % cd $home
  % cat bin/rc/a/tag/acid
  #!/bin/rc
  echo >/mnt/acme/$winid/tag
  cat /bin/a/tag/acid.tag >/mnt/acme/$winid/tag
  % cat /bin/a/tag/acid.tag
  RUN: (acid -l ACIDFILE PID)
  BRK: (bpset(FUNNAME)) | (bpset(filepc("src:line"))) | (bptab())
  SRC: (Bsrc(*PC))      | (src(*PC))
  STP: (cont())         | (next())                    | (run())
  SEE: ((TYPE)FUN:VAR)  ((*FUN:VAR)\D)

HTH


------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T0cb5225b3a37eb99-M01932686194ae9b104ce822d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to