zsh-workers
 help / color / mirror / code / Atom feed
* Use of "enable" in compsys (Re: Problem after upgrade from 4.3 to 5.2)
       [not found] ` <12614.1460767375@thecus.kiddle.eu>
@ 2016-04-16  4:31   ` Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2016-04-16  4:31 UTC (permalink / raw)
  To: zsh-workers; +Cc: Henrik Johansson

On Apr 16,  2:42am, Oliver Kiddle wrote:
} Subject: Re: Problem after upgrade from 4.3 to 5.2
}
} Henrik Johansson wrote:
} >
} > After upgrade of zsh I got a problem with completion.
} > In this example I write 'ls -l .z<TAB>
} >
} > server.user 1045> ls -l .zenable: printer "-p" non-existent
} 
} There's a name clash for "enable" / "disable" between the shell builtins
} and external commands for enabling/disabling printers.

Seems like there ought to be a way to invoke a disabled builtin, at least
in the case of enable, but we can easily avoid Henrik's error.  Additional
changes below are to use explicit semicolons on all lines in _comp_setup,
I'm not sure why those were used on some of them but not others, but it
seems prudent to have them.

diff --git a/Completion/compinit b/Completion/compinit
index 4b9a778..6612bac 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -167,11 +167,11 @@ _comp_options=(
 typeset -gH _comp_setup='local -A _comp_caller_options;
              _comp_caller_options=(${(kv)options[@]});
              setopt localoptions localtraps localpatterns ${_comp_options[@]};
-             local IFS=$'\'\ \\t\\r\\n\\0\''
-             enable -p \| \~ \( \? \* \[ \< \^ \#
+             local IFS=$'\'\ \\t\\r\\n\\0\'';
+             builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>/dev/null;
              exec </dev/null;
-             trap - ZERR
-             local -a reply
+             trap - ZERR;
+             local -a reply;
              local REPLY'
 
 # These can hold names of functions that are to be called before/after all

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-16  4:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <57116948.903@mail.se>
     [not found] ` <12614.1460767375@thecus.kiddle.eu>
2016-04-16  4:31   ` Use of "enable" in compsys (Re: Problem after upgrade from 4.3 to 5.2) Bart Schaefer

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