Re: Second Ctl in keychord not detected

2022-01-19 Thread Loris Bennett
Ihor Radchenko  writes:

> "Loris Bennett"  writes:
>
 Does anyone know what is happening to the second Ctl and how the problem
 can be fixed?
>>>
>>> Try to run M-x describe-key  C-c C-, and look at the output.
>>
>> The second C- disappears.
>>
>> I also get
>>
>>   C-c C-.  ->  C-c .
>
> Then, it is terminal input problem. See
> https://stackoverflow.com/questions/0801/why-does-ctrl-not-work-when-i-bind-it-to-a-command-in-emacs/8511#8511

You're right, the problem also happens locally when I start Emacs with
'-nw'.  Thanks for the link - I'll have a look at the various solutions,
although it might just be easier to rebind the command ;-)

Cheers,

Loris

-- 
This signature is currently under construction.



Re: Second Ctl in keychord not detected

2022-01-19 Thread Ihor Radchenko
"Loris Bennett"  writes:

>>> Does anyone know what is happening to the second Ctl and how the problem
>>> can be fixed?
>>
>> Try to run M-x describe-key  C-c C-, and look at the output.
>
> The second C- disappears.
>
> I also get
>
>   C-c C-.  ->  C-c .

Then, it is terminal input problem. See
https://stackoverflow.com/questions/0801/why-does-ctrl-not-work-when-i-bind-it-to-a-command-in-emacs/8511#8511

Best,
Ihor



Re: Second Ctl in keychord not detected

2022-01-19 Thread tomas
On Wed, Jan 19, 2022 at 01:08:10PM +0100, Loris Bennett wrote:
> Hi,
> 
> This is not really an Org question but an Emacs or possibly tmux
> problem.  However, the problem manifests itself in an Org context.

I guess this is tmux. It behaves more or less like an oldskool terminal,
where C- is transferred as the ASCII code with bit 7 masked out.
This would mean only C-@ (mapped to ASCII 0, which might have its own...
interesting issues) through a few chars after CTRL-Z do make sense in
this context.

This "protocol" can't even express things like CTRL-. or CTRL-, -- that
luxury is reserved to more GUI-ish environments :-)

(NOTE: just a guess, I haven't direct experience with tmux).

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Second Ctl in keychord not detected

2022-01-19 Thread Anssi Saari
"Loris Bennett"  writes:

> installed.  I am using tmux and want to run
>
>   org-insert-structure-template
>
> which is bound to
>
>   C-c C-, 
>
> When I type that, however, the function
>
>   org-priority
>
> is executed instead, which is bound to 
>
>   C-c ,

> Does anyone know what is happening to the second Ctl and how the problem
> can be fixed?

Yes. I actually asked about this recently. The problem is that in a
terminal, C-, doesn't exist. Hitting C-, gets you just a comma. In other
words, there is no control character in existence that would be sent in
a terminal when the user hits C-,.

I asked for suggestions for remapping org-insert-structure-template to
some other keys and got a suggestion on how to find what key
combinations are free. Also a suggestion to use older way to get the
template (require 'org-tempo and use < s TAB).

Problem with that old way is that it doesn't wrap region in the
+BEGIN_SRC/+END_SRC tags, it just dumbly inserts them. I typically start
writing code in an ORG document and *then* realize it should be inside
those tags so C-c C-, would be perfect. Just not in a terminal.

It might be worth reporting this key binding as a bug since it doesn't
work in a terminal.

Other than mapping org-insert-structure-template to some other key
combination or using 

Re: Second Ctl in keychord not detected

2022-01-19 Thread Loris Bennett
Hi Ihor,

Ihor Radchenko  writes:

> "Loris Bennett"  writes:
>
>>   C-c ,
>>
>> Does anyone know what is happening to the second Ctl and how the problem
>> can be fixed?
>
> Try to run M-x describe-key  C-c C-, and look at the output.

The second C- disappears.

I also get

  C-c C-.  ->  C-c .
  C-c C-;  ->  C-c ;
  C-c C-:  ->  C-c :
  C-c C-\  ->  C-c \
  C-c C-=  ->  C-c =

but

  C-c C-c  ->  C-c C-c
  C-c C-_  ->  C-c C-_
  C-c C-@  ->  C-c C-@

Gnome could potentially also be intercepting some keys.

Cheers,

Loris

-- 
This signature is currently under construction.



Re: Second Ctl in keychord not detected

2022-01-19 Thread Ihor Radchenko
"Loris Bennett"  writes:

>   C-c ,
>
> Does anyone know what is happening to the second Ctl and how the problem
> can be fixed?

Try to run M-x describe-key  C-c C-, and look at the output.

Best,
Ihor