On 7 Mar 2021, at 14:43, 'Shoce' via plan9port-dev <plan9p...@googlegroups.com> wrote:
Running commands that produce any output in Acme, a new +Errors window is created with the output. I always add "Edit ,d" to the tag of that window and iterate running the command, inspecting the output and clearing the window with "Edit ,d". I wonder if there is any single-word command that empties a window like "Edit ,d" so i would not need to select that two words but just B2-click.
Is there a single-word command that clears a window? Can i create that command by my own?Is there a reason that the command is not available by default in every new +Errors window? May be the way i do it is not the best and better techniques are possible?Thank you so much! ✊🏽
--
---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plan9port-dev/98f55941-3ccf-4064-bef1-bae0ce4188b0n%40googlegroups.com.
Running commands that produce any output in Acme, a new +Errors window is created with the output. I always add "Edit ,d" to the tag of that window and iterate running the command, inspecting the output and clearing the window with "Edit ,d". I wonder if there is any single-word command that empties a window like "Edit ,d" so i would not need to select that two words but just B2-click.Is there a single-word command that clears a window? Can i create that command by my own?
Is there a reason that the command is not available by default in every new +Errors window? May be the way i do it is not the best and better techniques are possible?
Note you can leave "Edit ,d" highlighted (by selecting it with B1) and then just B2-click anywhere on the highlighted text. Of course that approach doesn't scale if you want more than one multi-word command easily accessible.
You can certainly create your own commands to use with acme - if the word you B2-click on isn't recognised as an internal command then acme will search $PATH for a matching command and run that. So you could create a script called $HOME/bin/Clear for example (assuming $HOME/bin is in your path) which interacts with acme using its filesystem API to erase the text in a window:#!/usr/local/plan9/bin/rc
# You could also write a bash script, the shell isn't important
# acme sets "winid" in the environment to identify the window a command was run in, this just aborts if running in a different context
[ -n $winid ] || exit 1
# The "," addresses all text in the window, as normal
echo -n , | 9p write acme/$winid/addr
# Replace the addressed text with nothing
echo -n | 9p write acme/$winid/dataSee the acme(4) man page for more detail about acme's filesystem interface.
Jacob already mentioned Watch which is great for eg. recompiling code whenever you make an edit. For me in other scenarios I notice I delete error output interactively as I go once it has served its purpose/been dealt with - in this usage it also becomes a sort of checklist and en-mass deletion is not something I often reach for.