unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* unable to map C-_ to undo in wsl ubuntu emacs
@ 2021-09-06 13:09 Sivaram Neelakantan
  2021-09-06 13:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-06 13:09 UTC (permalink / raw)
  To: help-gnu-emacs

I've got Emacs-27.2 running in Emacs -nw and when I do C-_, I get RET
which I confirmed by C-h k "RET runs the command newline (found in
global-map)... compiled lisp function in 'simple.el'"

Now I try to reset to undo by doing M-x global-set-key and generating
the mapping by C-x ESC ESC which gives me

;; mapping C-_ to undo as it seems to be not recognized in some settings
(global-set-key "\x1f" 'undo)

This doesn't work and I can't figure out why C-_ is mapped to undo in
simple.el in one OS (win64) and RET in WSL ubuntu terminal Emacs simple.el.

How should I go about fixing this please?

sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-06 13:09 unable to map C-_ to undo in wsl ubuntu emacs Sivaram Neelakantan
@ 2021-09-06 13:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-09-06 15:37 ` Eli Zaretskii
  2021-09-12 14:29 ` Ken Goldman
  2 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-09-06 13:49 UTC (permalink / raw)
  To: help-gnu-emacs

Sivaram Neelakantan wrote:

> I've got Emacs-27.2 running in Emacs -nw and when I do C-_,
> I get RET which I confirmed by C-h k "RET runs the command
> newline (found in global-map)... compiled lisp function in
> 'simple.el'"

If it says it is RET then setting it sets RET as well.

But I get "C-_ is undefined" so something is different
between us.

A terminal emulator issue, perhaps?

> ;; mapping C-_ to undo as it seems to be not recognized in some settings
> (global-set-key "\x1f" 'undo)

Good idea for a shortcut, I have M-0 run `undo'. Much better
than before, the left thumb just goes from SPC to Meta and the
left ring finger straight up to 0, so both minimal or very
close/short movements and equally easy to reset/get back to
asdf/jkl;.

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-06 13:09 unable to map C-_ to undo in wsl ubuntu emacs Sivaram Neelakantan
  2021-09-06 13:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-09-06 15:37 ` Eli Zaretskii
  2021-09-06 17:29   ` Sivaram Neelakantan
  2021-09-12 14:29 ` Ken Goldman
  2 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2021-09-06 15:37 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Sivaram Neelakantan <nsivaram.net@gmail.com>
> Date: Mon, 06 Sep 2021 18:39:37 +0530
> User-Mail-Address: nsivaram.net@gmail.com
> 
> I've got Emacs-27.2 running in Emacs -nw and when I do C-_, I get RET
> which I confirmed by C-h k "RET runs the command newline (found in
> global-map)... compiled lisp function in 'simple.el'"

What terminal emulator are you using?  Does that terminal emulator
have some settings, where perhaps you can configure what it sends
given a certain control key?



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-06 15:37 ` Eli Zaretskii
@ 2021-09-06 17:29   ` Sivaram Neelakantan
  2021-09-06 18:37     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-06 17:29 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Sep 06 2021,Eli Zaretskii wrote:

>> From: Sivaram Neelakantan <nsivaram.net@gmail.com>
>> Date: Mon, 06 Sep 2021 18:39:37 +0530
>> User-Mail-Address: nsivaram.net@gmail.com
>> 
>> I've got Emacs-27.2 running in Emacs -nw and when I do C-_, I get RET
>> which I confirmed by C-h k "RET runs the command newline (found in
>> global-map)... compiled lisp function in 'simple.el'"
>
> What terminal emulator are you using?  Does that terminal emulator
> have some settings, where perhaps you can configure what it sends
> given a certain control key?
>
>

This is on MS windows terminal from app store and the settings.json
has this url https://aka.ms/terminal-profiles-schema and am
reproducing the actions settngs alone of settings.json.  I searched
for _ as well as underscore and couldn't see anything that would help
in identifying the issue in the url above.

 "actions": 
    [
        {
            "command": 
            {
                "action": "copy",
                "singleLine": false
            },
            "keys": "ctrl+c"
        },
        {
            "command": "find",
            "keys": "ctrl+shift+f"
        },
        {
            "command": "paste",
            "keys": "ctrl+v"
        },
        {
            "command": 
            {
                "action": "splitPane",
                "split": "auto",
                "splitMode": "duplicate"
            },
            "keys": "alt+shift+d"
        }
    ],




sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-06 17:29   ` Sivaram Neelakantan
@ 2021-09-06 18:37     ` Eli Zaretskii
  2021-09-10  6:22       ` Sivaram Neelakantan
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2021-09-06 18:37 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Sivaram Neelakantan <nsivaram.net@gmail.com>
> Date: Mon, 06 Sep 2021 22:59:29 +0530
> 
> On Mon, Sep 06 2021,Eli Zaretskii wrote:
> 
> >> I've got Emacs-27.2 running in Emacs -nw and when I do C-_, I get RET
> >> which I confirmed by C-h k "RET runs the command newline (found in
> >> global-map)... compiled lisp function in 'simple.el'"
> >
> > What terminal emulator are you using?  Does that terminal emulator
> > have some settings, where perhaps you can configure what it sends
> > given a certain control key?
> 
> This is on MS windows terminal from app store and the settings.json
> has this url https://aka.ms/terminal-profiles-schema and am
> reproducing the actions settngs alone of settings.json.  I searched
> for _ as well as underscore and couldn't see anything that would help
> in identifying the issue in the url above.
> 
>  "actions": 
>     [
>         {
>             "command": 
>             {
>                 "action": "copy",
>                 "singleLine": false
>             },
>             "keys": "ctrl+c"
>         },
>         {
>             "command": "find",
>             "keys": "ctrl+shift+f"
>         },
>         {
>             "command": "paste",
>             "keys": "ctrl+v"
>         },
>         {
>             "command": 
>             {
>                 "action": "splitPane",
>                 "split": "auto",
>                 "splitMode": "duplicate"
>             },
>             "keys": "alt+shift+d"
>         }
>     ],

Could be a real problem with that terminal.  What does "showkey -a"
display for C-_ on that terminal?



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-06 18:37     ` Eli Zaretskii
@ 2021-09-10  6:22       ` Sivaram Neelakantan
  2021-09-10  7:03         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-10  6:22 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Sep 06 2021,Eli Zaretskii wrote:


[snipped 48 lines]

> Could be a real problem with that terminal.  What does "showkey -a"
> display for C-_ on that terminal?
>
>

$ showkey -a

Press any keys - Ctrl-D will terminate this program

^M       13 0015 0x0d
^M       13 0015 0x0d
^D        4 0004 0x04
user1@CompName:~$

sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-10  6:22       ` Sivaram Neelakantan
@ 2021-09-10  7:03         ` Eli Zaretskii
  2021-09-10 12:30           ` Sivaram Neelakantan
  2021-09-12  4:48           ` Sivaram Neelakantan
  0 siblings, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2021-09-10  7:03 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Sivaram Neelakantan <nsivaram.net@gmail.com>
> Date: Fri, 10 Sep 2021 11:52:12 +0530
> User-Mail-Address: nsivaram.net@gmail.com
> 
> > Could be a real problem with that terminal.  What does "showkey -a"
> > display for C-_ on that terminal?
> >
> >
> 
> $ showkey -a
> 
> Press any keys - Ctrl-D will terminate this program
> 
> ^M       13 0015 0x0d
> ^M       13 0015 0x0d
> ^D        4 0004 0x04

So that's a real problem with that terminal, please report it to the
appropriate issue tracker.  There's nothing Emacs can do about such a
strange remapping of keys, and rebinding RET to a different function
in Emacs will wreak havoc much worse than what you have now.

I suggest to learn to use "C-x u" instead, for now.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-10  7:03         ` Eli Zaretskii
@ 2021-09-10 12:30           ` Sivaram Neelakantan
  2021-09-12  4:48           ` Sivaram Neelakantan
  1 sibling, 0 replies; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-10 12:30 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Sep 10 2021,Eli Zaretskii wrote:


[snipped 14 lines]

>> ^M       13 0015 0x0d
>> ^D        4 0004 0x04
>
> So that's a real problem with that terminal, please report it to the
> appropriate issue tracker.  There's nothing Emacs can do about such a
> strange remapping of keys, and rebinding RET to a different function
> in Emacs will wreak havoc much worse than what you have now.

Right, I'll report this to the app issue tracker.  Thanks for helping
to track this down.

sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-10  7:03         ` Eli Zaretskii
  2021-09-10 12:30           ` Sivaram Neelakantan
@ 2021-09-12  4:48           ` Sivaram Neelakantan
  2021-09-12  6:28             ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-12  4:48 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Sep 10 2021,Eli Zaretskii wrote:


[snipped 13 lines]

>> ^M       13 0015 0x0d
>> ^M       13 0015 0x0d
>> ^D        4 0004 0x04
>
> So that's a real problem with that terminal, please report it to the
> appropriate issue tracker.  There's nothing Emacs can do about such a
> strange remapping of keys, and rebinding RET to a different function
> in Emacs will wreak havoc much worse than what you have now.
>

This seems to happen if the keyboard is changed from US to
IN(Indian).  If I switch to US Kb, it works as expected.  I've anyway
raised a bug with the team.

sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-12  4:48           ` Sivaram Neelakantan
@ 2021-09-12  6:28             ` Eli Zaretskii
  2021-09-14 15:28               ` Sivaram Neelakantan
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2021-09-12  6:28 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Sivaram Neelakantan <nsivaram.net@gmail.com>
> Date: Sun, 12 Sep 2021 10:18:44 +0530
> User-Mail-Address: nsivaram.net@gmail.com
> 
> >> ^M       13 0015 0x0d
> >> ^M       13 0015 0x0d
> >> ^D        4 0004 0x04
> >
> > So that's a real problem with that terminal, please report it to the
> > appropriate issue tracker.  There's nothing Emacs can do about such a
> > strange remapping of keys, and rebinding RET to a different function
> > in Emacs will wreak havoc much worse than what you have now.
> >
> 
> This seems to happen if the keyboard is changed from US to
> IN(Indian).  If I switch to US Kb, it works as expected.  I've anyway
> raised a bug with the team.

Does that make sense when typing in IN languages?  (I don't speak and
don't read any of those.)  What is the significance of C-_ in those
languages that could justify this mapping?



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-06 13:09 unable to map C-_ to undo in wsl ubuntu emacs Sivaram Neelakantan
  2021-09-06 13:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-09-06 15:37 ` Eli Zaretskii
@ 2021-09-12 14:29 ` Ken Goldman
  2021-09-14 15:30   ` Sivaram Neelakantan
  2 siblings, 1 reply; 13+ messages in thread
From: Ken Goldman @ 2021-09-12 14:29 UTC (permalink / raw)
  To: help-gnu-emacs

On 9/6/2021 9:09 AM, Sivaram Neelakantan wrote:
> 
> ;; mapping C-_ to undo as it seems to be not recognized in some settings
> (global-set-key "\x1f" 'undo)

I run emacs native, through WSL and through VNC.  There are several
key chords that don't work the same on all three.  I don't think
emacs can fix it.

Specifically, I map undo to F1, since I use it so often.

(global-set-key [f1]  'undo)






^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-12  6:28             ` Eli Zaretskii
@ 2021-09-14 15:28               ` Sivaram Neelakantan
  0 siblings, 0 replies; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-14 15:28 UTC (permalink / raw)
  To: help-gnu-emacs

On Sun, Sep 12 2021,Eli Zaretskii wrote:


[snipped 17 lines]

>
> Does that make sense when typing in IN languages?  (I don't speak and
> don't read any of those.)  What is the significance of C-_ in those
> languages that could justify this mapping?
>
>

No idea.  MS folks confirmed it is a bug, that as C-_ should either
give _ or app specific char.

sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: unable to map C-_ to undo in wsl ubuntu emacs
  2021-09-12 14:29 ` Ken Goldman
@ 2021-09-14 15:30   ` Sivaram Neelakantan
  0 siblings, 0 replies; 13+ messages in thread
From: Sivaram Neelakantan @ 2021-09-14 15:30 UTC (permalink / raw)
  To: help-gnu-emacs

On Sun, Sep 12 2021,Ken Goldman wrote:

> On 9/6/2021 9:09 AM, Sivaram Neelakantan wrote:
>> ;; mapping C-_ to undo as it seems to be not recognized in some
>> settings
>> (global-set-key "\x1f" 'undo)
>
> I run emacs native, through WSL and through VNC.  There are several
> key chords that don't work the same on all three.  I don't think
> emacs can fix it.
>
> Specifically, I map undo to F1, since I use it so often.
>
> (global-set-key [f1]  'undo)
>

Right, though MS folks have confirmed that it's a bug. Thing is, in
both Emacs and terminal it was showing RET, which is weird.

sivaram
-- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-14 15:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-06 13:09 unable to map C-_ to undo in wsl ubuntu emacs Sivaram Neelakantan
2021-09-06 13:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-06 15:37 ` Eli Zaretskii
2021-09-06 17:29   ` Sivaram Neelakantan
2021-09-06 18:37     ` Eli Zaretskii
2021-09-10  6:22       ` Sivaram Neelakantan
2021-09-10  7:03         ` Eli Zaretskii
2021-09-10 12:30           ` Sivaram Neelakantan
2021-09-12  4:48           ` Sivaram Neelakantan
2021-09-12  6:28             ` Eli Zaretskii
2021-09-14 15:28               ` Sivaram Neelakantan
2021-09-12 14:29 ` Ken Goldman
2021-09-14 15:30   ` Sivaram Neelakantan

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).