zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: Why does ^X? behave differently than TAB?
Date: Fri, 19 May 2000 15:28:05 +0000	[thread overview]
Message-ID: <1000519152805.ZM4279@candle.brasslantern.com> (raw)
In-Reply-To: <200005191324.PAA08160@beta.informatik.hu-berlin.de>

On May 19,  3:24pm, Sven Wischnowsky wrote:
} Subject: Re: Why does ^X? behave differently than TAB?
}
} You wrote:
} 
} > Here's the actual script.  Run it as an autoloaded function.  At the
} > "ftpupdate command: " prompt, type ^X? twice.
} > 
} > ...
} > 
} > trap "$r ; trap - 0 2 3 15 ZERR ; return 1" 0 2 3 15 ZERR
} 
} The `compadd -x' in _message returns non-zero and makes this trap be
} called. And of course, the next time round, there is no `compctl -T'
} anymore.
} 
} Hm. I don't want to change the return value of compadd and it wouldn't 
} solve the problem anyway. Do we have to temporarily unset/default all
} traps in completion? Urgh.

Not all traps, just ZERR.  We should handle the errexit option, too.

Index: Completion/Commands/_complete_debug
===================================================================
@@ -3,6 +3,8 @@
 setopt localoptions nullglob rcexpandparam extendedglob
 unsetopt markdirs globsubst shwordsplit nounset ksharrays
 
+setopt localtraps noerrexit ; trap - ZERR
+
 (( $+_debug_count )) || integer -g _debug_count
 local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count]
 local w="${(qq)words}"
Index: Completion/Core/_main_complete
===================================================================
@@ -20,6 +20,9 @@
 unsetopt markdirs globsubst shwordsplit nounset ksharrays
 exec </dev/null	# ZLE closes stdin, which can cause errors
 
+# Failed returns from this code are not real errors
+setopt localtraps noerrexit ; trap - ZERR
+
 local func funcs ret=1 tmp _compskip format nm call \
       _completers _completer _completer_num curtag _comp_force_list \
       _matchers _matcher _matcher_num _comp_tags _comp_mesg \

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


       reply	other threads:[~2000-05-19 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200005191324.PAA08160@beta.informatik.hu-berlin.de>
2000-05-19 15:28 ` Bart Schaefer [this message]
2000-05-18  9:19 Sven Wischnowsky

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=1000519152805.ZM4279@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --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).