unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: iquiw <iku.iwasa@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 18182@debbugs.gnu.org
Subject: bug#18182: 24.3.92; C-[ does not work as ESC in viper-mode
Date: Tue, 19 Aug 2014 22:59:02 +0900	[thread overview]
Message-ID: <CAOAV122TV6Tv2CBwy1PCB8sujmQNOcbGXZd7Hgfgp-FvoZoogA@mail.gmail.com> (raw)
In-Reply-To: <jwvegwdgrh5.fsf-monnier+emacsbugs@gnu.org>

Thank you for the detailed explanation.

I tried the patch, but the behavior does not changed.

After viper is enabled, function-key-map has the following value.
```
(keymap (27 . [escape]) (right-fringe keymap (mouse-3 .
mouse--strip-first-event) (mouse-2 . mouse--strip-first-event)
(mouse-1 . mouse--strip-first-event)) (left-fringe keymap (mouse-3 .
mouse--strip-first-event) (mouse-2 . mouse--strip-first-event)
(mouse-1 . mouse--strip-first-event)) (escape . [27]) (return . [13])
(clear . [12]) (linefeed . [10]) (tab . [9]) (kp-equal . [61])
(kp-separator . [44]) (kp-tab . [9]) ...)
```

Complete value is pasted in https://gist.github.com/iquiw/10c49212fd59fc795c59


On Tue, Aug 19, 2014 at 11:22 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> The following steps reproduce the problem.
>> 1. Run "emacs -Q".
>> 2. Type "M-x viper" to enable viper-mode.
>> 3. Type "i" to enter viper insert mode.
>> 4. Type "C-[".
>
>> On Emacs 24.3, it exits from viper insert mode as well as ESC key does.
>> On Emacs 24.3.92, it displays "ESC-" in minibuffer and does not exit
>> from viper insert mode.
>
> In Emacs-24.4, Viper's escape key sequence (in viper-ESC-key) was
> changed from [?\e] to [escape], i.e. from the ASCII escape char (usually
> called ESC in Emacs) to the `escape' key (usually called `escape' in
> Emacs).
>
> When `escape' has no specific binding, Emacs remaps it to ESC (via
> function-key-map), so previously the `escape' key worked to trigger the
> ESC binding of Viper.
>
> The C-[ key is an alias (at a lower level) for the ESC char, so indeed
> now it doesn't work any more to trigger the "viper-ESC-key" behavior.
>
> Actually it still works under a tty, since under a tty Viper receives
> ESC (rather than `escape') when you hit the escape key, so it has
> special code that maps this ESC to an `escape' (but only for tty frames,
> not in GUI frames).
>
> I think the hack below should work.  Can you confirm it works for you?
>
>
>         Stefan
>
>
> === modified file 'lisp/emulation/viper.el'
> --- lisp/emulation/viper.el     2014-06-29 02:33:50 +0000
> +++ lisp/emulation/viper.el     2014-08-19 02:22:11 +0000
> @@ -600,6 +600,9 @@
>                     ))
>               (viper-set-expert-level 'dont-change-unless)))
>
> +        (if (equal viper-ESC-key [escape])
> +            (define-key function-key-map [?\e] [escape]))
> +
>         (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi
>             (memq major-mode viper-insert-state-mode-list) ; don't switch
>             (viper-change-state-to-vi))
>





  reply	other threads:[~2014-08-19 13:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <wu61hp65yr.fsf@fencepost.gnu.org>
2014-08-18 18:28 ` bug#18182: bug bisection help Eli Zaretskii
2014-08-03 12:43   ` bug#18182: 24.3.92; C-[ does not work as ESC in viper-mode iquiw
2014-08-03 16:29     ` Eli Zaretskii
2014-08-18 18:58     ` bug#18182: bug bisection help Glenn Morris
2014-08-19  2:22     ` bug#18182: 24.3.92; C-[ does not work as ESC in viper-mode Stefan Monnier
2014-08-19 13:59       ` iquiw [this message]
2014-08-20 19:44         ` Stefan Monnier
2014-08-21 14:08           ` iquiw
2020-09-09 10:05       ` Lars Ingebrigtsen
2020-09-09 13:50         ` Stefan Monnier
2020-09-10 12:21           ` Lars Ingebrigtsen
2021-10-20  8:07             ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOAV122TV6Tv2CBwy1PCB8sujmQNOcbGXZd7Hgfgp-FvoZoogA@mail.gmail.com \
    --to=iku.iwasa@gmail.com \
    --cc=18182@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).