GNU bug report logs -
#18182
24.3.92; C-[ does not work as ESC in viper-mode
Previous Next
To reply to this bug, email your comments to 18182 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Sun, 03 Aug 2014 15:24:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
iquiw <iku.iwasa <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 03 Aug 2014 15:24:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
Ref. http://lists.gnu.org/archive/html/help-gnu-emacs/2014-07/msg00539.html
In GNU Emacs 24.3.92.1 (i686-pc-mingw32)
of 2014-06-27 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'
Important settings:
value of $LANG: JPN
locale-coding-system: cp932
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
M-x v i p e r <return> n 5 n i ESC C-g <escape> M-x
r e p o r t - e m a c s - b u g <return>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading viper...
Inhibit Viper startup message? (y or n) n
The last message is in buffer `Viper Startup Message'
Do you wish to make this change permanent? (y or n) n
Loading viper...done
C-M-g is undefined
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils viper viper-ex viper-macs viper-mous
viper-cmd viper-keym ring viper-util viper-init advice help-fns
time-date japan-util tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win
w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
w32notify w32 multi-tty emacs)
Memory information:
((conses 8 86796 5253)
(symbols 32 18900 0)
(miscs 32 67 93)
(strings 16 14303 3778)
(string-bytes 1 380276)
(vectors 8 11981)
(vector-slots 4 482985 3024)
(floats 8 69 98)
(intervals 28 203 9)
(buffers 508 15))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Sun, 03 Aug 2014 16:31:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 18182 <at> debbugs.gnu.org (full text, mbox):
> From: iquiw <iku.iwasa <at> gmail.com>
> Date: Sun, 3 Aug 2014 21:43:44 +0900
>
> 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.
FWIW, in "emacs -nw", C-[ does exit the viper insert mode.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Mon, 18 Aug 2014 18:29:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 18182 <at> debbugs.gnu.org (full text, mbox):
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Mon, 18 Aug 2014 13:52:12 -0400
>
>
> It would be helpful if someone could bisect
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18116
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18182
>
> to find the causes.
> Please send any reply to the relevant bug addresses.
Crystal ball says that 18182 is due to r112692.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Mon, 18 Aug 2014 18:59:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 18182 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> Crystal ball says that 18182 is due to r112692.
Our survey says... nope.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Tue, 19 Aug 2014 02:24:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 18182 <at> debbugs.gnu.org (full text, mbox):
> 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))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Tue, 19 Aug 2014 14:00:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 18182 <at> debbugs.gnu.org (full text, mbox):
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 <at> 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))
>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Wed, 20 Aug 2014 19:45:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 18182 <at> debbugs.gnu.org (full text, mbox):
> Thank you for the detailed explanation.
> I tried the patch, but the behavior does not changed.
Hmm... yes, sorry, I forgot that many keys are bound to an ESC prefix
(all the "M-" keys). I guess you could use
(define-key input-decode-map [?\e] [escape])
which does seem to work. Of course, that'll only work in the terminal
in which you start. E.g. it won't work when you make-frame-on-display
or if you use emacs-daemon.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Thu, 21 Aug 2014 14:10:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 18182 <at> debbugs.gnu.org (full text, mbox):
On Thu, Aug 21, 2014 at 4:44 AM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
> Hmm... yes, sorry, I forgot that many keys are bound to an ESC prefix
> (all the "M-" keys). I guess you could use
>
> (define-key input-decode-map [?\e] [escape])
>
> which does seem to work.
Yes, it works as expected.
I will use this configuration.
Thank you.
Severity set to 'normal' from 'important'
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 01 Oct 2014 22:25:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Wed, 09 Sep 2020 10:06:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 18182 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> 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.
This problem is still present in Emacs 28.
> 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).
I had a look to see what the point of the change was, but the commit
helpfully says:
* viper-keym.el (viper-ESC-key): constant changed (Stefan Monnier's
patch).
Stefan? Would it make sense to change it back to ?\e again?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Wed, 09 Sep 2020 13:51:01 GMT)
Full text and
rfc822 format available.
Message #34 received at 18182 <at> debbugs.gnu.org (full text, mbox):
>>> 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.
>
> This problem is still present in Emacs 28.
>
>> 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).
>
> I had a look to see what the point of the change was, but the commit
> helpfully says:
>
> * viper-keym.el (viper-ESC-key): constant changed (Stefan Monnier's
> patch).
>
> Stefan? Would it make sense to change it back to ?\e again?
IIRC this had to do with the code that distinguishes "ESC the key" from
"ESC the prefix in escape sequences" on ttys. The patch basically
changes input-decode-map to turn ESC into `escape` if there's no other
input after a short timeout.
But maybe we can keep using `ESC`, by relying on the function-key-map to
map `escape` back to `ESC`.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Thu, 10 Sep 2020 12:22:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 18182 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> IIRC this had to do with the code that distinguishes "ESC the key" from
> "ESC the prefix in escape sequences" on ttys. The patch basically
> changes input-decode-map to turn ESC into `escape` if there's no other
> input after a short timeout.
>
> But maybe we can keep using `ESC`, by relying on the function-key-map to
> map `escape` back to `ESC`.
OK; I've now done this on the trunk, and I guess we'll find out whether
that leads to any problems...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 10 Sep 2020 12:22:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
18182 <at> debbugs.gnu.org and iquiw <iku.iwasa <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 10 Sep 2020 12:22:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 09 Oct 2020 11:24:09 GMT)
Full text and
rfc822 format available.
bug No longer marked as fixed in versions 28.1 and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 20 Oct 2021 08:07:01 GMT)
Full text and
rfc822 format available.
Removed tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 20 Oct 2021 08:07:01 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 20 Oct 2021 08:07:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18182
; Package
emacs
.
(Wed, 20 Oct 2021 08:08:01 GMT)
Full text and
rfc822 format available.
Message #52 received at 18182 <at> debbugs.gnu.org (full text, mbox):
This led to problems in non-gui Emacs. See bug#51253.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug No longer marked as fixed in versions 28.1 and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 20 Oct 2021 08:08:02 GMT)
Full text and
rfc822 format available.
Removed tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 20 Oct 2021 08:08:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 236 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.