[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: troubleshoot C-M-/ key binding (dabbrev-completion)
From: |
Pierre Rouleau |
Subject: |
Re: troubleshoot C-M-/ key binding (dabbrev-completion) |
Date: |
Sun, 21 Jan 2024 18:52:20 -0500 |
Hi Michael,
Are you using Emacs in terminal mode?
If you are, it's quite possible that any key sequence that does not map to
ASCII Control characters will not work.
Note that C-\ is a valid ASCII Control code (hex byte value 0x5c).
And C-\ is not a valid ASCII control code.
Therefore Emacs, in terminal mode will not be able to recognize C-M-\
In graphics mode, Emacs will be able to identify C-M-\ as it will decode
the key sequence from the keyboard
directly and won't have to use a terminal emulator standard.
To see if a key sequence is recognized, type C-h k followed by the key
sequence you're looking for.
Type C-h k C-M-\ to see the mapping of that key sequence and whether it
is recognized.
Hope this helps,
/Pierre
On Sun, Jan 21, 2024 at 5:00 PM Michael V. Antosha <
michael.antosha@gmail.com> wrote:
> On 1/21/24, Martin Marshall <law@martinmarshall.com> wrote:
> > "Michael V. Antosha" <michael.antosha@gmail.com> writes:
> >
> >> 3. Using C-M-/ (i.e. pressing Ctrl+Alt+SLASH) seems to have the same
> >> effect as M-/ (dabbrev-expand).
> >
> > What effect is that?
>
> I prepared a description of a test procedure to specify the effect,
> but I chose to skip sending it to keep my post shorter and because it
> seems unnecessary now (explained below).
>
>
> > Are you sure there are multiple completion candidates in the buffer?
>
> Yes.
>
>
> > If there's only one candidate in the buffer, `dabbrev-completion' will
> > immediately complete the word without bringing up a "*Completions*"
> > buffer. That would look like the same thing `dabbrev-expand' does.
>
> I understand differences and similarities between the two commands, I
> first tested their behavior without key bindings, through M-x
> dabbrev-*
>
>
> > You can check which key Emacs thinks you pressed and which command it
> > called by invoking `view-lossage' (bound to "C-h l").
>
> Martin, thank you very much!
> That's really useful.
>
>
> What I'm seeing now proves my original suspicion:
> - when I press "Alt+SLASH" emacs interprets it as ESC / [dabbrev-expand]
> - when I press "Ctrl+Alt+SLASH" emacs interprets it, as ESC /
> [dabbrev-expand]
>
> ESC / [dabbrev-expand]
> C-h l [view-lossage]
>
> What could I do further to find out why these different combinations
> are understood by emacs as ESC / sequence?
>
>
> For comparison, Ctrl+Alt+BACKSLASH works fine.
> Below are keys/commands from C-h l after pressing Ctr+BACKSLASH, then
> Alt+BACKSLASH, then Ctrl+Alt+BACKSLASH:
>
> C-\ [toggle-input-method]
> ...
> ESC \ [delete-horizontal-space]
> ...
> ESC C-\ [indent-region]
> C-h l [view-lossage]
>
>
> I also tried to emulate C-M-/ by pressing ESC and then pressing Ctrl+SLASH,
> the result is quite unexpected:
>
> ESC C-_ [nil]
> C-h l [view-lossage]
>
>
> --
> Michael V. Antosha
>
>
--
/Pierre