From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7579 invoked by alias); 7 Dec 2014 17:39:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33907 Received: (qmail 29581 invoked from network); 7 Dec 2014 17:39:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.25.230] X-Spam: 0 X-Authority: v=2.1 cv=S8BXwecP c=1 sm=1 tr=0 a=c0CwWhpM9oUd/BnC3z6Gzg==:117 a=c0CwWhpM9oUd/BnC3z6Gzg==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=Zk19AuA9H4iE6ST4x-4A:9 a=CjuIK1q_8ugA:10 Date: Sun, 7 Dec 2014 17:39:44 +0000 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: Interrupting globs (Re: Something rotten in tar completion) Message-ID: <20141207173944.2a77c0e7@pws-pc.ntlworld.com> In-Reply-To: References: <20141202155452.647182b4@pwslap01u.europe.root.pri> <141202084858.ZM31517@torch.brasslantern.com> <20141202172654.30e7d380@pwslap01u.europe.root.pri> <141204085606.ZM9146@torch.brasslantern.com> <20141204171226.301e9d2c@pwslap01u.europe.root.pri> <141205002023.ZM19736@torch.brasslantern.com> <20141205145054.655a2f70@pwslap01u.europe.root.pri> <141205100632.ZM508@torch.brasslantern.com> <20141205181330.2b458b46@pwslap01u.europe.root.pri> <20141205203417.2bc66b7b@pws-pc.ntlworld.com> <20141205220717.2f86bdd2@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 6 Dec 2014 12:49:19 +0100 Mikael Magnusson wrote: > Another difference: the menu completion listing could previously be > aborted with ctrl-c and keep the command line. It now closes the > listing and aborts the command line. Here's a suggestion: when we go back to the main keymap, assume that if the user typed ^C in the mean time they want to continue editing from this point. I think that fixes this case. (This is only on the interrupt_abort branch, again.) > Additionally, with menu selection, you could previously ctrl-c out of > selection and get to the menu, ctrl-c that again, and still have the > command line. Now you just go straight from selection to a new empty > command line. This second case was already working for me (interrupt_abort branch with Sven-comment-restoration, commit e385312e0937). I tried both MENU_COMPLETE and AUTO_COMPLETE behaviour. There may be another way in. Does the patch below help with this, too? I'm intending to commit this and then stop patching to allow us to take stock of what effects are now present on the interrupt_abort branch. So feel free to re-report any bad features. pws diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index 30d25eb..48f210c 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -504,6 +504,16 @@ mod_export void selectlocalmap(Keymap m) { localkeymap = m; + if (!m) + { + /* + * No local keymap; so we are returning to the global map. If + * the user ^Ced in the local map, they probably just want to go + * back to normal editing. So remove the interrupt error + * status. + */ + errflag &= ~ERRFLAG_INT; + } } /* Reopen the currently selected keymap, in case it got deleted. This *