Skip to content

Commit

Permalink
Add /in command and supporting changes (#118)
Browse files Browse the repository at this point in the history
* Add /in command

This allows running commands like setwindow or mode
in contexts other than the currently focused window.

Also adds two new command types, adds focus to the context Args can work with,
and reworks a handful of commands to not fetch clientFocus themselves.
It also tweaks /list to not use extensionArg anymore.

There is still some work that needs doing in support of this one command
(as well as future metacommands but never mind):
- Tab completion needs to be burned to the ground.
- Views (names, masks) need to be changed to respect the override.
- `/in #channel-im-not-in masks b` should really just work.

ClientCommands don't make sense with /in and can exhibit surprising behavior,
and so /in currently rejects them.

* Make subfocuses work correctly with /in

Also adjusts the status line to show overridden foci.

* Rework focus label in status line

Minor changes were made in an earlier commit.
These changes are a bit more radical due to subfocuses
no longer being "sub"focuses so much.

Also changes the application title.

* Implement macro expansion in /in

This commit also undoes a decision to forbid client-wide commands from /in.
It's simpler this way.
  • Loading branch information
TheDaemoness authored Apr 17, 2024
1 parent 0308148 commit 08a7f94
Show file tree
Hide file tree
Showing 19 changed files with 395 additions and 269 deletions.
17 changes: 16 additions & 1 deletion doc/cmds_client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ Reload the client configuration file.
If `filename` is provided it will be used to reload.
Otherwise the previously loaded configuration file will be reloaded.

== /in

Execute a command on a window other than the current one.

`focus` is the name of a window as would be used with the `channel` command.

`command` is the name of a command or macro followed by its arguments.
Macro expansions will be resolved as if `focus` was the current focus.

See also: channel

=== Examples

`+/in libera: list+` +
`+/in #glirc setwindow louder+`

== /extension

Run a command provided by an extension.
Expand Down Expand Up @@ -85,4 +101,3 @@ Show command documentation.

When `command` is omitted, a list of all commands and macros is shown.
When `command` is specified, detailed help for that command is shown.

6 changes: 3 additions & 3 deletions doc/cmds_queries.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ Sends a LIST query and caches the result;
on larger networks, this may take several seconds to complete.
The view may be exited while loading.

`clientarg` is an optionally-comma-separated list of options.
`clientopts` is an optionally-comma-separated list of options.
A single comma may be used to denote an empty list.

`serverarg` is sent as-is to the server.
`elist` is sent as-is to the server.
It is generally used as the ELIST parameter to LIST.
glirc does not validate this parameter against the ELIST ISUPPORT token.

Expand All @@ -83,7 +83,7 @@ glirc does not validate this parameter against the ELIST ISUPPORT token.
`+/list+` - List public channels.
`+/list >99+` - List public channels with at least 100 users.
`+/list >50<1000+` - List public channels with between 51 and 999 users.
`+/list ~ <20+` - List public channels with fewer than 20 users.
`+/list ~ <20+` - List public channels with fewer than 20 users.
`+/list , *-ops+` - List public channels whose names end with "-ops".

== /links
Expand Down
Loading

0 comments on commit 08a7f94

Please sign in to comment.