unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Pierre Rouleau <prouleau001@gmail.com>
To: "Michael V. Antosha" <michael.antosha@gmail.com>
Cc: help-gnu-emacs@gnu.org, Martin Marshall <law@martinmarshall.com>
Subject: Re: troubleshoot C-M-/ key binding (dabbrev-completion)
Date: Sun, 21 Jan 2024 18:52:20 -0500	[thread overview]
Message-ID: <CALTqLiZLQZfptHasRkEDZBumax6Vc+a+FEV0Z_EmBoDO4A2u2Q@mail.gmail.com> (raw)
In-Reply-To: <CABUXKX7UXxghPGbEKBhk_5ZtGK=Pjpm38DxiqC1gpMcpLcTHjw@mail.gmail.com>

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


      reply	other threads:[~2024-01-21 23:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=CALTqLiZLQZfptHasRkEDZBumax6Vc+a+FEV0Z_EmBoDO4A2u2Q@mail.gmail.com \
    --to=prouleau001@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=law@martinmarshall.com \
    --cc=michael.antosha@gmail.com \
    /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.
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).