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: Re: Standard setopts for completion system, again
Date: Thu, 19 Oct 2000 10:57:14 +0200 (MET DST)	[thread overview]
Message-ID: <200010190857.KAA16307@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Wed, 18 Oct 2000 04:31:31 +0000


Bart Schaefer wrote:

> ...
> 
> Another choice (still in compinit) would be simply to stuff the desired
> options into an array:
> 
> _comp_setopts=(nullglob rcexpandparam extendedglob unset
>      no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob})
> 
> and then reference them:
> 
> setopt localoptions $_comp_setopts
> 
> I guess I slightly prefer the latter, since we're already cluttering the
> parameter space with completion stuff and I'd rather stay out of the alias
> space, but either one would be OK.

Here is the patch for it (committed soon). I hope nobody objects to me 
naming the array `_comp_options'?

I've also initialised that array in what I hope is a more readable form.

Bye
 Sven

Index: Completion/Commands/_bash_completions
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_bash_completions,v
retrieving revision 1.7
diff -u -r1.7 _bash_completions
--- Completion/Commands/_bash_completions	2000/10/06 05:18:25	1.7
+++ Completion/Commands/_bash_completions	2000/10/19 08:55:42
@@ -25,8 +25,7 @@
 # that will not have been overridden, so you should add '~' to the
 # list of keys at the top of the for-loop.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 local key=$KEYS[-1] expl
 
Index: Completion/Commands/_complete_debug
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_debug,v
retrieving revision 1.10
diff -u -r1.10 _complete_debug
--- Completion/Commands/_complete_debug	2000/10/06 05:18:25	1.10
+++ Completion/Commands/_complete_debug	2000/10/19 08:55:42
@@ -1,7 +1,6 @@
 #compdef -k complete-word \C-x?
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 setopt localtraps noerrexit ; trap - ZERR
 
Index: Completion/Commands/_complete_help
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_complete_help,v
retrieving revision 1.10
diff -u -r1.10 _complete_help
--- Completion/Commands/_complete_help	2000/10/06 05:18:25	1.10
+++ Completion/Commands/_complete_help	2000/10/19 08:55:43
@@ -1,8 +1,8 @@
 #compdef -k complete-word \C-xh
 
 _complete_help() {
-  setopt localoptions nullglob rcexpandparam extendedglob unset
-  unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+  setopt localoptions $_comp_options
+
   exec </dev/null	# ZLE closes stdin, which can cause errors
 
   local _sort_tags=_help_sort_tags text i j k
Index: Completion/Commands/_correct_word
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_correct_word,v
retrieving revision 1.4
diff -u -r1.4 _correct_word
--- Completion/Commands/_correct_word	2000/10/06 05:18:25	1.4
+++ Completion/Commands/_correct_word	2000/10/19 08:55:43
@@ -7,8 +7,7 @@
 # If configurations keys with the prefix `correctword_' are
 # given they override those starting with `correct_'.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 local curcontext="$curcontext"
 
Index: Completion/Commands/_expand_word
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_expand_word,v
retrieving revision 1.7
diff -u -r1.7 _expand_word
--- Completion/Commands/_expand_word	2000/10/11 12:19:24	1.7
+++ Completion/Commands/_expand_word	2000/10/19 08:55:43
@@ -2,8 +2,7 @@
 
 # Simple completion front-end implementing expansion.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
 
 local curcontext="$curcontext"
 
Index: Completion/Commands/_history_complete_word
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_history_complete_word,v
retrieving revision 1.8
diff -u -r1.8 _history_complete_word
--- Completion/Commands/_history_complete_word	2000/10/06 05:18:25	1.8
+++ Completion/Commands/_history_complete_word	2000/10/19 08:55:43
@@ -16,8 +16,7 @@
 #   range -- range of history words to complete
 
 _history_complete_word () {
-  setopt localoptions nullglob rcexpandparam extendedglob unset
-  unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+  setopt localoptions $_comp_options
 
   local expl direction stop curcontext="$curcontext"
   local max slice hmax=$#historywords
Index: Completion/Commands/_next_tags
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Commands/_next_tags,v
retrieving revision 1.10
diff -u -r1.10 _next_tags
--- Completion/Commands/_next_tags	2000/10/06 05:18:25	1.10
+++ Completion/Commands/_next_tags	2000/10/19 08:55:43
@@ -3,8 +3,7 @@
 # Main widget.
 
 _next_tags() {
-  setopt localoptions nullglob rcexpandparam extendedglob unset
-  unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+  setopt localoptions $_comp_options
 
   local ins ops="$PREFIX$SUFFIX"
 
Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.42
diff -u -r1.42 _main_complete
--- Completion/Core/_main_complete	2000/10/06 05:18:25	1.42
+++ Completion/Core/_main_complete	2000/10/19 08:55:43
@@ -16,8 +16,8 @@
 # which makes the output of setopt and unsetopt reflect a different
 # state than the global one for which you are completing.
 
-setopt localoptions nullglob rcexpandparam extendedglob unset
-unsetopt markdirs globsubst shwordsplit shglob ksharrays cshnullglob
+setopt localoptions $_comp_options
+
 exec </dev/null	# ZLE closes stdin, which can cause errors
 
 # Failed returns from this code are not real errors
Index: Completion/Core/compinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/compinit,v
retrieving revision 1.10
diff -u -r1.10 compinit
--- Completion/Core/compinit	2000/07/26 08:54:58	1.10
+++ Completion/Core/compinit	2000/10/19 08:55:43
@@ -120,6 +120,21 @@
   _comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump"
 fi
 
+# The standard options set in completion functions.
+
+_comp_options=(
+       nullglob
+       rcexpandparam
+       extendedglob
+       unset
+    NO_markdirs
+    NO_globsubst
+    NO_shwordsplit
+    NO_shglob
+    NO_ksharrays
+    NO_cshnullglob
+)
+
 # These can hold names of functions that are to be called before/after all
 # matches have been generated.
 

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


             reply	other threads:[~2000-10-19  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-19  8:57 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-10-18  7:13 Sven Wischnowsky
2000-10-18  7:28 ` Andrej Borsenkow
2000-10-06 12:53 Sven Wischnowsky
2000-10-06 14:58 ` Bart Schaefer
2000-10-18  4:31   ` Bart Schaefer

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=200010190857.KAA16307@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).