From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10141 invoked by alias); 29 Feb 2016 23:30:32 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21333 Received: (qmail 7174 invoked from network); 29 Feb 2016 23:30:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=iThUnpJr/0WT4E4ASv/YNP5+K9sbp/Qs9NS93ccxnf4=; b=OG3H82iYy8vb3LZSTKlhz1CV4YKS20iww6YjuF4WZ00an+vRdUAcl92LhUFOCueZgx JyoDg7brHd8EWYQH0jfvTKOk+rIvWHgMh/8y5PWDOcqMPDANkOCgMPqZZ44IZRHcWe8p ShfUyZdj5F9wVy/9EH20bWU6/KrUQoG+WboC/EpV9GkTVdyfQ0BJA7uA1yHm9QqGDG+1 tBcpxLLvonKGzBIgfg2XBOGhfLQHGLr0SnUWeVPSCsTYC9d3Gdxsqc9iHb9/fa7cJNGB j2G7lBSAIaGJzcCzV9/aPg4jRKKGYzKY04uyqa/ezeCC9kFmW2gt5CJlvoTwRBMW6Qvf xMTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=iThUnpJr/0WT4E4ASv/YNP5+K9sbp/Qs9NS93ccxnf4=; b=Z6DgxKMMlubtKv6IgFer8CMmGKq158ic78T12jrtTrhVF9XVtje1fSwPvPno9tpco4 NqGPdUieVBrcemG1fzDvBa0M2jGrw4rhMgqtJjk3VoG9JZbj+dg8Ys49jp1mPsoUQgEw DeMrH5brOZbWySsbFroaIjXmNqmuHZw0jqiwcoWNOvRdqNC6+R6vfLB2ttAbBjT+oty8 LvN+XWTPBxonAWonQ8gXK9zPt5vRGNH7lh2GxzxdAaQ7ref2WW4dj8sR0c2eLy5oJ9yh 1yOOVpWhrMiSRgZcY+ykrmEs4sbpgDYqD1LKivMCaaQpebU24ZpdOTczjcP2D8A5CfL0 vR2g== X-Gm-Message-State: AD7BkJIi9iHoMs7fUHDZEO3cHcDNYR+cNcn0Ig6BG1Cvuhl1/0vwUIeDGTD8CEtkOf8t1A== X-Received: by 10.98.10.81 with SMTP id s78mr13487523pfi.119.1456788629265; Mon, 29 Feb 2016 15:30:29 -0800 (PST) From: Bart Schaefer Message-Id: <160229153039.ZM4912@torch.brasslantern.com> Date: Mon, 29 Feb 2016 15:30:39 -0800 In-Reply-To: Comments: In reply to Hugh X "Re: visual/viopp modes are not detected by zle-keymap-select" (Feb 24, 4:59pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: visual/viopp modes are not detected by zle-keymap-select MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 24, 4:59pm, Hugh X wrote: } } Got it. Thanks for the explanation. My preliminary thought is to use } the "visual" to update the prompt so that I can add/debug some key } bindings in the visual mode. OK, that's the one context where it's potentially useful, but: } Since you mentioned that these local keymaps will have their own } widget-binding methods through the interpreter, I wound whether there } is such special widgets that similar to *_init and *_exit. In fact visual mode is the one case where there is NOT any such local interpreter -- there's just a different keymap, which is still handled by the global interpreter. This is why it would not break anything to invoke the zle-keymap-select hook. However, there's also no clear begin/end of visual mode. As presently implemented, visual mode is a combination of a couple of different states that can each be changed independently; the determination of whether this "mode" is in effect is not made until the last instant before ZLE waits for the next keystroke, and is forgotten as soon as the keystroke has been consumed. The keymap isn't even in place long enough for the corresponding widget to see it; it's indistinguishable from vicmd mode. Consequently the zle-keymap-select hook would be called twice on every keystroke during visual "mode", if naive implementation were adopted.