zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: compinstall tweak
@ 2001-03-05 21:37 Peter Stephenson
  2001-03-06  7:48 ` Andrej Borsenkow
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2001-03-05 21:37 UTC (permalink / raw)
  To: Zsh hackers list

(Did anybody get this month's FAQ posting?  Mine disappeared again.)

This is on top of Andrej's patch in 13544.  Andrej, you can commit this
with the other bit when you're happy.

I shortened the description and added a separate tweak that compinstall
remembers any arguments you had after `compinit'.

--- Completion/Core/compinstall.before	Mon Mar  5 21:18:21 2001
+++ Completion/Core/compinstall	Mon Mar  5 21:30:09 2001
@@ -25,7 +25,7 @@
 
 typeset startline='# The following lines were added by compinstall'
 typeset endline='# End of lines added by compinstall'
-typeset ifile line fpath_line
+typeset ifile line fpath_line compinit_args
 typeset -A styles
 typeset match mbegin mend warn_unknown warn_old warn_comment
 integer lines_found
@@ -115,6 +115,9 @@
       # no-op
     elif [[ $line = [[:blank:]]#\#* ]]; then
       warn_comment=1
+    elif [[ $line = [[:blank:]]#compinit[[:blank:]]##(#b)([^[:blank:]]*) ]]
+    then
+      compinit_args=$match[1]
     elif [[ $line != [[:blank:]]# &&
       $line != [[:blank:]]#'autoload -U compinit' &&
       $line != [[:blank:]]#compinit &&
@@ -916,18 +919,16 @@
     print "\
               *** compinstall: matcher menu ***
 
-\`Matchers' allow the completion code to play extra tricks when comparing
-the string on the command line with a possible match, as listed below.
-A list of different matchers can be given. The numbers given below show what is
-included in each element of the list; by default everything for 1 is tried
-at the same time, then if necessary everything for 2, etc. until at least
-one possible completion is found. You can change it so that every element
-in the list is added to preceding one(s) instead; this indicated by '+' over
-the element. If no matcher is set ordinary completion will be done at that
-point. Elements from 1 to 4 can be set; empty trailing elements will be
-removed, and if nothing is set, the style will not be set.
+\`Matchers' compare the completion code with the possible matches in some
+special way.  Numbers in parentheses show matchers to be tried and the order.
+The same number can be assigned to different matchers, meaning apply at the
+same time.  Omit a sequence number to try normal matching at that point.
+A \`+' in the first line indicates the element is added to preceeding matchers
+instead of replacing them; toggle this with \`t'.  You don't need to set
+all four, or indeed any matchers --- then the style will not be set.
 
-   ($a_or_r)
+   ($a_or_r)\
+   \`+' indicates add to previous matchers, else replace
 n. ($n_list)\
  No matchers; you may want to try this as the first choice.
 c. ($c_list)\
@@ -941,7 +942,7 @@
  Substring completion:  complete on substrings, not just initial
           strings.  Warning: it is recommended this not be used for element 1.
 
-t.        Toggle replace/augment for matcher group
+t.        Toggle replacing previous matchers (\` ' at top) or add (\`+')
 q.        Return without saving.
 0.        Done setting matchers.
 "
@@ -1780,7 +1781,7 @@
 
   print -r "
 autoload -U compinit
-compinit"
+compinit${compinit_args:+ $compinit_args}"
 
   print -r "$endline"
 } >$tmpout

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: PATCH: compinstall tweak
  2001-03-05 21:37 PATCH: compinstall tweak Peter Stephenson
@ 2001-03-06  7:48 ` Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 2001-03-06  7:48 UTC (permalink / raw)
  To: Zsh hackers list

> 
> (Did anybody get this month's FAQ posting?  Mine disappeared again.)
> 

Not me, I have not seen it.

> This is on top of Andrej's patch in 13544.  Andrej, you can commit this
> with the other bit when you're happy.
> 

Commited both.

-andrej


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-06  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-05 21:37 PATCH: compinstall tweak Peter Stephenson
2001-03-06  7:48 ` Andrej Borsenkow

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).