unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* troubleshoot C-M-/ key binding (dabbrev-completion)
@ 2024-01-21 17:16 Michael V. Antosha
  2024-01-21 19:37 ` Martin Marshall
  0 siblings, 1 reply; 4+ messages in thread
From: Michael V. Antosha @ 2024-01-21 17:16 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Key binding C-M-/ (dabbrev-completion) does not seem to work for me.
Could someone point me in a right direction to find the cause of this behavior?


Details:

1. dabbrev-completion works fine if used explicitly (M-x dabbrev-completion).

2. M-/ (dabbrev-expand) and C-/ (undo) both work as expected.

3. Using C-M-/ (i.e. pressing Ctrl+Alt+SLASH) seems to have the same
effect as M-/ (dabbrev-expand).

4. Other C-M-... combinations seem to work fine.

For example, C-M-\ (indent-region), C-\ (toggle-input-method) and M-\
(delete-horizontal-space) all work as expected, each doing its own
function.

5. From the output of describe-bindings (C-h b):

    M-/             dabbrev-expand
    C-M-/           dabbrev-completion
    C-/             undo

    C-\             toggle-input-method
    M-\             delete-horizontal-space
    C-M-\           indent-region


Any hints?
I want to find out what is wrong with my setup
(and how to troubleshoot -- step by step -- similar issues with Emacs).

Thank you in advance!

Best regards,
Michael


-- 
Michael V. Antosha



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

* Re: troubleshoot C-M-/ key binding (dabbrev-completion)
  2024-01-21 17:16 troubleshoot C-M-/ key binding (dabbrev-completion) Michael V. Antosha
@ 2024-01-21 19:37 ` Martin Marshall
  2024-01-21 21:59   ` Michael V. Antosha
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Marshall @ 2024-01-21 19:37 UTC (permalink / raw)
  To: Michael V. Antosha; +Cc: help-gnu-emacs

"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?

Are you sure there are multiple completion candidates in the buffer?  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.

You can check which key Emacs thinks you pressed and which command it
called by invoking `view-lossage' (bound to "C-h l").

-- 
Best regards,
Martin Marshall



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

* Re: troubleshoot C-M-/ key binding (dabbrev-completion)
  2024-01-21 19:37 ` Martin Marshall
@ 2024-01-21 21:59   ` Michael V. Antosha
  2024-01-21 23:52     ` Pierre Rouleau
  0 siblings, 1 reply; 4+ messages in thread
From: Michael V. Antosha @ 2024-01-21 21:59 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Martin Marshall

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



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

* Re: troubleshoot C-M-/ key binding (dabbrev-completion)
  2024-01-21 21:59   ` Michael V. Antosha
@ 2024-01-21 23:52     ` Pierre Rouleau
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Rouleau @ 2024-01-21 23:52 UTC (permalink / raw)
  To: Michael V. Antosha; +Cc: help-gnu-emacs, Martin Marshall

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


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

end of thread, other threads:[~2024-01-21 23:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-21 17:16 troubleshoot C-M-/ key binding (dabbrev-completion) Michael V. Antosha
2024-01-21 19:37 ` Martin Marshall
2024-01-21 21:59   ` Michael V. Antosha
2024-01-21 23:52     ` Pierre Rouleau

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