zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: two missing styles in _zstyle
Date: Tue, 8 Feb 2000 10:55:09 +0100 (MET)	[thread overview]
Message-ID: <200002080955.KAA01399@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Alexandre Duret-Lutz's message of 07 Feb 2000 18:31:05 +0100


Alexandre Duret-Lutz wrote:

> This adds two missing styles in zstyle completion function.
> 
> I have noticed that the function incremental-complete-word
> use undocumented style `stop' and `break' (well `stop' is documented
> but not for the way it is used in i-c-w, should these be renamed
> to stop-key and break-key ?)

This doesn't do the renaming, but maybe, yes.

The cursor style for predict-on wasn't documented either.

Bye
 Sven

diff -ru ../z.old/Completion/Builtins/_zstyle Completion/Builtins/_zstyle
--- ../z.old/Completion/Builtins/_zstyle	Tue Feb  8 10:16:36 2000
+++ Completion/Builtins/_zstyle	Tue Feb  8 10:52:30 2000
@@ -13,10 +13,11 @@
   add-space		 c:bool
   arguments		 c:
   auto-description	 c:
+  break                  c:
   completer		 c:completer
   completions		 c:
   condition		 c:
-  cursor		 c:bool
+  cursor		 c:cursor
   disable-stat		 c:bool
   domains                c:
   expand		 c:
@@ -130,6 +131,19 @@
     boolauto) 
       _wanted values expl boolean &&
 	compadd "$expl[@]" true false auto select
+      ;;
+
+    cursor)
+      if [[ "$words[2]" = *:completion:inc* ]]; then
+        _wanted values expl 'cursor positioning' &&
+	  compadd "$expl[@]" complete key default
+      elif [[ "$words[2]" = *:completion::* ]]; then
+        _wanted values expl 'cursor positioning' &&
+	  compadd "$expl[@]" true false
+      else
+        _wanted values expl 'cursor positioning' &&
+	  compadd "$expl[@]" complete key default true false
+      fi
       ;;
 
     completer)
diff -ru ../z.old/Doc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- ../z.old/Doc/Zsh/compsys.yo	Tue Feb  8 10:16:18 2000
+++ Doc/Zsh/compsys.yo	Tue Feb  8 10:45:22 2000
@@ -697,6 +697,13 @@
 it may be useful to set this style to something like `tt(specify: %d)'. 
 Note that this may not work for some commands.
 )
+item(tt(break))(
+This style is used by the tt(incremental-complete-word) widget (found
+in the tt(Functions/Zle) directory of the distribution). Its value
+should be a pattern and all keys matching this pattern will cause the
+widget to stop incremental completion without the key having any
+further effect.
+)
 item(tt(completer))(
 The strings given as the value of this style give the names of the
 completer functions to use. The available completer functions are
@@ -747,6 +754,21 @@
 generating filenames as matches to find out if the cursor should be left
 after the first ambiguous pathname component even when menucompletion
 is used.
+
+The tt(predict-on) widget uses this style to decide where to place the 
+cursor after completion has been tried. If it is set to tt(complete),
+the cursor is left at the place where completion left it, but only if
+it is after a character equal to the one just inserted by the user. If 
+it is after another character, the value is treated as if it where the 
+string tt(key). If the value is set to tt(key), the cursor is left
+after the var(n)th occurrence of the character just inserted, where
+var(n) is the number of times that character appeared in the word
+before completion was attempted. In short, this has the effect of
+leaving the cursor after the character just typed even if the
+completion code found out that no other characters need to be inserted 
+at that position. Finally, any other value for this style
+unconditionally leaves the cursor at the position where the completion
+code left it.
 )
 item(tt(disable-stat))(
 This is used with the an empty tag by the function completing for the
@@ -1012,6 +1034,10 @@
 When using the tt(incremental-complete-word) widget, this style says
 if the matches should be listed on every key press (if they fit on the 
 screen).
+
+The tt(predict-on) widget uses this style to decide if the completion
+should be shown even if there is only one possible completion. This is 
+done if the value of this style is the string tt(always).
 )
 item(tt(list-arguments))(
 Like the tt(arguments) style, but used when calling the tt(ps) command 
@@ -1271,6 +1297,11 @@
 command will always insert matches as if menucompletion were started
 and it will stop when the last match is inserted. If this style is set
 to tt(verbose) a message will be displayed when the last match is reached.
+
+This style is also used by the tt(incremental-complete-word)
+widget. Here its value is used like the one for the tt(break)
+style. But all keys matching the pattern given as its value will stop
+incremental completion and will then execute their usual function.
 )
 item(tt(substitute))(
 If this is unset or set to the empty string, the tt(_expand) completer

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-02-08  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-08  9:55 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-02-07 17:31 Alexandre Duret-Lutz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200002080955.KAA01399@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).