zsh-workers
 help / color / mirror / code / Atom feed
* 5.3.1 - lot of bad math expression
@ 2017-01-16 17:22 ` Jens Elkner
  2017-01-16 17:48   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Elkner @ 2017-01-16 17:22 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1334 bytes --]

Hi,

when trying to find a solution/propper settings for the
X=./{etc,bin} ; ls $X   problem I decided to give the latest release aka
5.3.1 a try. However, here I get a lot of errors wrt. the default
completion files e.g. for ls\t like:

_arguments:360: bad math expression: operator expected at `descrs'
_main_complete:341: bad math expression: operator expected at
`lastdescr'
_main_complete:380: bad math expression: operator expected at
`comp_color...'

I guess this version is somewhat closer to ksh than the current one we
have on our systems (5.0.7), and therefore unbraced stuff fails. E.g.

while [[ anum -le  $#descrs ]]; do ... ; done

Is it going to get fixed? If not, what is the best way to do and check,
i.e. make sure, that all files can be used w/o getting into trouble?


BTW: Also I wonder, whether

while (( anum < ${#descrs} )) ; do ... ; done

is a little bit faster than the [[ ]] variant.


Thanx,
jel.

PS: 2 Attachments: my current ~/.zsh{env,rc} - there is no /etc/zshenv
    and /etc/zshrc just contains 'autoload -Uz compinit; compinit -i'.
    /etc/zprofile just exports LOGNAME PATH and set the default umask.
-- 
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 52768

[-- Attachment #2: .zshenv --]
[-- Type: text/plain, Size: 2855 bytes --]

# file: ~/.zshenv

HISTFILE=~/.zshistory
HISTSIZE=100
SAVEHIST=1000

# settings for Changing Directories
setopt AUTO_CD no_POSIX_CD
# Expansion/Globbing settings (ksh behavior: more intuitive)
setopt no_IGNORE_BRACES no_IGNORE_CLOSE_BRACES no_MAGIC_EQUAL_SUBST CASE_MATCH \
	no_NOMATCH no_REMATCH_PCRE MULTIBYTE UNSET \
	GLOB no_GLOB_ASSIGN no_GLOB_DOTS GLOB_SUBST CASE_GLOB \
	no_EXTENDED_GLOB KSH_GLOB NO_SH_GLOB
# tbd: X=./{etc,bin} ; print "$X" # as assigned ; ls $X # should ls ./etc ./bin

# Initialisation settings
setopt no_GLOBAL_EXPORT
# Input/Output settings
setopt ALIASES CLOBBER CORRECT INTERACTIVE_COMMENTS PATH_SCRIPT RM_STAR_SILENT
# Job Control settings
setopt no_BG_NICE CHECK_JOBS no_HUP NOTIFY POSIX_JOBS
# Scripts and Functions
setopt no_C_BASES no_C_PRECEDENCES DEBUG_BEFORE_CMD FUNCTION_ARGZERO \
	LOCAL_LOOPS no_MULTIOS
# Shell Emulation
setopt KSH_ARRAYS KSH_TYPESET KSH_OPTION_PRINT LOCAL_OPTIONS LOCAL_TRAPS \
	POSIX_IDENTIFIERS POSIX_STRINGS POSIX_TRAPS \
	no_SH_FILE_EXPANSION SH_NULLCMD no_SH_OPTION_LETTERS SH_WORD_SPLIT
# History/Prompt/ZLE settings: see ~/.zshrc

# we do not have crappy /usr/local/share/zsh/site-functions so just use default
if [[ ${ZSH_VERSION} == '5.0.7' ]]; then
	FPATH='/usr/share/zsh/5.0.7/functions/Calendar:/usr/share/zsh/5.0.7/functions/Chpwd:/usr/share/zsh/5.0.7/functions/Exceptions:/usr/share/zsh/5.0.7/functions/MIME:/usr/share/zsh/5.0.7/functions/Misc:/usr/share/zsh/5.0.7/functions/Newuser:/usr/share/zsh/5.0.7/functions/Prompts:/usr/share/zsh/5.0.7/functions/TCP:/usr/share/zsh/5.0.7/functions/VCS_Info:/usr/share/zsh/5.0.7/functions/VCS_Info/Backends:/usr/share/zsh/5.0.7/functions/Zftp:/usr/share/zsh/5.0.7/functions/Zle'
	FCPATH='/usr/share/zsh/5.0.7/functions/Completion:/usr/share/zsh/5.0.7/functions/Completion/Base:/usr/share/zsh/5.0.7/functions/Completion/Solaris:/usr/share/zsh/5.0.7/functions/Completion/Unix:/usr/share/zsh/5.0.7/functions/Completion/X:/usr/share/zsh/5.0.7/functions/Completion/Zsh'
else
	ZPROTO=/export/scratch/${LOGNAME}/build/_root
	FPATH=
	[[ -d ${ZPROTO}/usr/share/zsh/${ZSH_VERSION} ]] && \
		MODULE_PATH=${ZPROTO}/usr/lib/zsh/${ZSH_VERSION} || ZPROTO=
	FCPATH="${ZPROTO}/usr/share/zsh/${ZSH_VERSION}/functions/Completion"
	for X in ${ZPROTO}/usr/share/zsh/${ZSH_VERSION}/functions/* ; do
		if [[ ${X##*/} == 'Completion' ]]; then
			for D in ${X}/* ; do
				[[ ${D##*/} =~ ^(AIX|BSD|Cygwin|Darwin|Debian|Linux|Mandriva|Redhat|openSUSE)$ || ! -d $D ]] && continue
				FCPATH+=":$D"
			done
		else
			[[ -d $X ]] && FPATH+=":$X"
			[[ ${X##*/} == 'VCS_Info' ]] && FPATH+=":$X/Backends"
		fi
	done
	FPATH=${FPATH:1}
fi
FPATH+=":${FCPATH}"

cdpath=( ~ ~/workspace ~/tmp/current/build /export/scratch/${LOGNAME}/build )

# ignore duplicated pathes
typeset -U PATH NLSPATH MANPATH INFOPATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64

# vim: ts=4 sw=4 filetype=zsh

[-- Attachment #3: .zshrc --]
[-- Type: text/plain, Size: 1109 bytes --]

# file: ~/.zshrc

#typeset -fUrz compinit ; compinit -i	# usually already done via /etc/zshrc

LOGCHECK=1
REPORTTIME=60
WATCH=all
LISTMAX=4096

unset zle_bracketed_paste	# avoid damnb '\e[200~' '\e[201~' on copy-paste
setopt no_BEEP COMBINING_CHARS EMACS

# Completion settings
setopt AUTO_LIST AUTO_PARAM_SLASH HASH_LIST_ALL LIST_AMBIGUOUS LIST_BEEP \
	LIST_PACKED LIST_TYPES no_ALWAYS_LAST_PROMPT no_BAD_PATTERN
# tcsh Stil (expand-or-complete + COMPLETE_IN_WORD=on ist unzureichend)
bindkey "^I" expand-or-complete-prefix

# History settings
setopt APPEND_HISTORY BANG_HIST EXTENDED_HISTORY HIST_EXPIRE_DUPS_FIRST \
    HIST_FCNTL_LOCK HIST_BEEP CSH_JUNKIE_HISTORY
# Job control
setopt BG_NICE

# Prompting settings
setopt PROMPT_PERCENT no_PROMPT_SUBST no_PROMPT_BANG
if [[ ${TERM:0:5} =~ ^(xterm|gnome|dtter)$ ]]; then
	if (( UID == 0 )); then
		PROMPT=$'%{\e[1;48;5;196;38;5;232m%}%n.%m %3~ #%{\e[0m%} '
	elif (( UID == 101 )); then
		PROMPT=$'%{\e[1;48;5;51;38;5;232m%}%n.%m %3~ %%%{\e[0m%} '
	else
		PROMPT=$'%{\e[1;48;5;191;38;5;232m%}%n.%m %3~ %%%{\e[0m%} '
	fi
else
	PROMPT=$'%B%n.%m %3~ %#%b '
fi

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

* Re: 5.3.1 - lot of bad math expression
  2017-01-16 17:22 ` 5.3.1 - lot of bad math expression Jens Elkner
@ 2017-01-16 17:48   ` Peter Stephenson
  2017-01-16 18:38     ` Jens Elkner
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2017-01-16 17:48 UTC (permalink / raw)
  To: Jens Elkner, zsh-workers

On Mon, 16 Jan 2017 18:22:50 +0100
Jens Elkner <jel+zsh@cs.uni-magdeburg.de> wrote:
> when trying to find a solution/propper settings for the
> X=./{etc,bin} ; ls $X   problem I decided to give the latest release aka
> 5.3.1 a try. However, here I get a lot of errors wrt. the default
> completion files e.g. for ls\t like:
> 
> _arguments:360: bad math expression: operator expected at `descrs'
> _main_complete:341: bad math expression: operator expected at
> `lastdescr'
> _main_complete:380: bad math expression: operator expected at
> `comp_color...'

Looks like that's the POSIX_IDENTIFIERS option.

The _comp_options arrays is there to try to limit option changes so that
most user options percolate through into the completion code.  The
trouble is, as you've discovered, this doesn't really work.

pws

diff --git a/Completion/compinit b/Completion/compinit
index 2715c47..cc663cb 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -154,6 +154,7 @@ _comp_options=(
     NO_markdirs
     NO_octalzeroes
     NO_posixbuiltins
+    NO_posixidentifiers
     NO_shwordsplit
     NO_shglob
     NO_warncreateglobal


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

* Re: 5.3.1 - lot of bad math expression
  2017-01-16 17:48   ` Peter Stephenson
@ 2017-01-16 18:38     ` Jens Elkner
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Elkner @ 2017-01-16 18:38 UTC (permalink / raw)
  To: zsh-workers

On Mon, Jan 16, 2017 at 05:48:52PM +0000, Peter Stephenson wrote:
> On Mon, 16 Jan 2017 18:22:50 +0100
> Jens Elkner <jel+zsh@cs.uni-magdeburg.de> wrote:
> > when trying to find a solution/propper settings for the
> > X=./{etc,bin} ; ls $X   problem I decided to give the latest release aka
> > 5.3.1 a try. However, here I get a lot of errors wrt. the default
> > completion files e.g. for ls\t like:
> > 
> > _arguments:360: bad math expression: operator expected at `descrs'
> > _main_complete:341: bad math expression: operator expected at
> > `lastdescr'
> > _main_complete:380: bad math expression: operator expected at
> > `comp_color...'
> 
> Looks like that's the POSIX_IDENTIFIERS option.

Oh, easier than I thought :)

...
> +++ b/Completion/compinit
...
> +    NO_posixidentifiers

Yepp, seems to fix it.

Thanx a lot,
jel.
-- 
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 52768


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

end of thread, other threads:[~2017-01-16 18:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170116172413epcas2p175e693f3a2c0949043f4edaa7c67158f@epcas2p1.samsung.com>
2017-01-16 17:22 ` 5.3.1 - lot of bad math expression Jens Elkner
2017-01-16 17:48   ` Peter Stephenson
2017-01-16 18:38     ` Jens Elkner

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