* PATCH: 3.1.5-pws-7: compctl -LM
@ 1999-02-08 15:38 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-02-08 15:38 UTC (permalink / raw)
To: Zsh hackers list
This is fairly trivial, but it seemed to me that `compctl -LM' should
work in the obvious way --- am I right that at the moment you have to
grope it out of a full compctl -L ?. The catch is that `compctl -M -L'
also works in the obvious way, but it's a different way. At least you
get an error message in the second case. Most of the code for this is
already there.
--- Doc/Zsh/compctl.yo.LM Wed Feb 3 10:08:42 1999
+++ Doc/Zsh/compctl.yo Mon Feb 8 16:30:42 1999
@@ -11,7 +11,7 @@
[ tt(PLUS()) var(options) [ tt(-x) ... tt(--) ] ... [tt(PLUS())] ] \
[ var(command) ... ])
list(tt(compctl) tt(-M) var(match-specs) ...)
-list(tt(compctl) tt(-L) [ tt(-CDT) ] [ var(command) ... ])
+list(tt(compctl) tt(-L) [ tt(-CDTM) ] [ var(command) ... ])
list(tt(compctl) tt(PLUS()) var(command) ...)
endlist()
@@ -99,9 +99,9 @@
item(tt(-L))(
lists the existing completion behavior in a manner suitable for
putting into a start-up script; the existing behavior is not changed.
-Any combination of the above forms may be specified, otherwise all
-defined completions are listed. Any other flags supplied
-are ignored.
+Any combination of the above forms, or the tt(-M) flag (which must
+follow the tt(-L) flag), may be specified, otherwise all defined
+completions are listed. Any other flags supplied are ignored.
)
item(em(no argument))(
If no argument is given, tt(compctl) lists all defined completions
--- Src/Zle/compctl.c.LM Mon Feb 8 10:59:25 1999
+++ Src/Zle/compctl.c Mon Feb 8 16:26:34 1999
@@ -38,6 +38,7 @@
#define COMP_DEFAULT (1<<2) /* -D */
#define COMP_FIRST (1<<3) /* -T */
#define COMP_REMOVE (1<<4)
+#define COMP_LISTMATCH (1<<5) /* -L and -M */
#define COMP_SPECIAL (COMP_COMMAND|COMP_DEFAULT|COMP_FIRST)
@@ -713,7 +714,9 @@
cct.mask2 |= CC_NOSORT;
break;
case 'M':
- if ((*argv)[1]) {
+ if (cclist & COMP_LIST) {
+ cclist |= COMP_LISTMATCH;
+ } else if ((*argv)[1]) {
if ((cct.matcher =
parse_cmatcher(name, (cct.mstr = (*argv) + 1))) ==
pcm_err) {
@@ -1573,7 +1576,7 @@
/* If no commands and no -C, -T, or -D, print all the compctl's *
* If some flags (other than -C, -T, or -D) were given, then *
* only print compctl containing those flags. */
- if (!*argv && !(cclist & COMP_SPECIAL)) {
+ if (!*argv && !(cclist & (COMP_SPECIAL|COMP_LISTMATCH))) {
Patcomp pc;
for (pc = patcomps; pc; pc = pc->next)
@@ -1620,6 +1623,8 @@
printcompctl("", &cc_default, 0, 0);
if (cclist & COMP_FIRST)
printcompctl("", &cc_first, 0, 0);
+ if (cclist & COMP_LISTMATCH)
+ print_gmatcher(COMP_LIST);
return ret;
}
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-02-08 15:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-08 15:38 PATCH: 3.1.5-pws-7: compctl -LM Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).