The "current group" is an important concept in Agroups operations. Most Agroups operations focus on the current group.
Unless otherwise specified all operations and the selection of a group entry apply to the current group. After typing KA, Agroups is waiting for the selection of a group entry to execute from the current group. After typing KA KO, Agroups is waiting for an operation to be selected that will operate on the current group unless otherwise specified.
Any top level group or subgroup nested to any level from any top level group can be made the current group. At any time there is only one current group. You can see in the minibuffer what the current group is with the operation
What is current group (keys: w)
The current persistent group is the group that will be the current group when you first run Emacs. In other words, it is the group that is saved to a save file persistently as the current group.
The current group and current persistent group can be two different groups during an Agroups session. And in fact, this turns out to be a simple but quite useful device. For one example, the current persistent group serves as a sort of home base group while switching between current groups. As a specific example of that: You may be working on a project for days in which case you might want to make that project the current persistent group. But then someone interrupts you with a problem on another project. So you make that other project the current group for awhile then go back to the persistent current group project as the current group.
Any top level group or subgroup nested to any level from any top level group can be made the current persistent group. At any time there is only one current persistent group. You can see in the minibuffer what the current persistent group is with the operation
What is current persistent group (keys: W)
You can also see both the current group and current persistent group in relation to other groups with the operation for displaying the top level groups See section Group Information.
As motioned above, when you first run Emacs the current group is also the current persistent group, but it common to set any group or subgroup to be the current persistent group See section Setting Current Group. The group that is the current persistent group when you exit Emacs will be the current persistent group and current group when you reenter Emacs at a later time.
At any time the current group is the last group selected as the current group by the user. However the current group status can for one time, that is for one operation or one group action, belong to any group or subgroup. The consequence of this can be stated simply in the following principle
The "current group one time" means that for any group that can be selected by a user input sequence, pretend that that group is the current group for the rest of that sequence.
Sequences that select groups fall into two categories, those that select groups with operations and those that select subgroups by executing them. Those that select by operations fall into two more categories, those that select using the meta operation KG and those that select with ordinary operations.
Any group can temporarily become the current group by typing KA KG and then selecting any top level group. Or selecting any top level group and then selecting any subgroup. For example, selecting an entry in another group, the sequence
KA KG G a
selects a group named "G" and then an entry in that group named "a" regardless of what the current group is. And selecting an operation in that group, for example
KA KG G KO d
would display the entries of the group named "G" regardless of what the current group is.
Similarly if the current group has a subgroup entry named "g" then
KA g a
would execute an entry named "a" in that subgroup named "g". And
KA g KO d
would display the entries in the subgroup "g".
Similarly if that subgroup "g" has a subsubgroup "g" within it and in turn that subsubgroup has an action "a" then
KA g g a
would execute that action "a" and
KA g g KO m a
would move that action "a". One example of an ordinary operation that selects a group as current one time is that of visiting the last displayed group See section Last Non-Current Displayed Group.
The reason that Agroups has this "Current Group One Time" concept is by doing this there is only one paradigm for operating on a group and its entries, which is the paradigm for operating on the current group. Consequently, anywhere in the document that refers to an operation on or in "the current group" also applies to a Current Group One Time sequence.
At all times some group is the current group. To make some other group the current group use the operation
Make current group the Current group (keys: c)
This sounds a little confusing at first until we realize that when we say current group in an operation like this we mean more generally the current group or current group one time See section Current Group One Time. In general to make some other group the current group select the other group though any sequence of operations and then apply this "c" operation. For example
KA KG ! KO c
makes the zzzap group the current group one time and then the "KO c" makes it the current group. Another example is
KA a KO c
which makes a subgroup within the current group named "a" the current group. The operation
Make a group the Current persistent group (keys: C)
does the same thing as the "c" operation but the current group also becomes the current persistent group.
Conversely, the current persistent group can be made the current group with the operation
Make current persistent group the Current group (keys: C-c)
This operation is also useful when you want to make some group other than the current persistent group the current group and then revert back.
There are conditions where the current group is automatically set by Agroups as follows
The rationale here is that the appearance of a group at the top level frequently means that the group will be operated on subsequently.
The parent of the current group can be visited for current group one time operations. The following operation
Visit Parent of current group (keys: p)
is exactly equivalent to selecting the parent of the current group through the KA meta operation. This operation will report an error if the current group is a top level group, which has no parent.
Here is an example of using this operation
KA KO p KO d
It would display the current group's parent group entries. Because of the current group one time principle the following
KA KO p KO p d
would display the parent of the parent of the current group.
When you display any group that is not the actual current group with the "d" operation it gets recorded as the "Last Non-Current Displayed" group and keeps this status until another such non-current group is displayed. When such a group is recorded it can be more easily revisited with the operation
Revisit last non-current Displayed group (keys: C-d)
So if some non-current group g was displayed then the subsequent sequence of
KA <sequence that selects non-current group g> <anything>
is exactly equivalent to
KA KO C-d <anything>
So for example if we display a subgroup s of some non-current group g
KA KG g s KO d
then later we can execute an entry e in s with
KA KO C-d e
or do any operation like edit that entry e with
KA KO C-d KO e e
The basic idea is that if you need to display the group first to see the entries then later you shouldn't have to reenter all the keys that it took to display that group to operate on it. But this has other uses such as conveniently working on two groups at the same time.
Go to the first, previous, next, last section, table of contents.