all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* GTK Emacs and input modules
@ 2022-09-03 15:59 Yuri Khan
  2022-09-03 16:03 ` Yuri Khan
  2022-09-04  0:38 ` Po Lu
  0 siblings, 2 replies; 8+ messages in thread
From: Yuri Khan @ 2022-09-03 15:59 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Can someone please consult me on Emacs’s interaction with GTK input modules?

Steps:

1. $ emacs -Q
2. C-h k C-S-u

Observed: no reaction.

3. C-S-u

Observed: Emacs gets into a state where it ignores any keys except
ESC, 0-9, a-f, A-F, RET, SPC. Pressing any of these keys except RET
takes it out of this state.

4. C-h k C-; (also C-., C-,, C-0, C-1, C-9)

Observed: C-; is undefined. (C-0, C-1, C-9 run the command digit-argument.)

So: things mostly work but C-S-u doesn’t.

Same behavior with $ GTK_IM_MODULE=ibus emacs.

----

1. $ GTK_IM_MODULE=xim emacs
2–4. same

Observed: C-u (translated from C-S-u) runs the command universal-argument.

; runs the command self-insert-command.
. runs the command self-insert-command.
, runs the command self-insert-command.
0 runs the command self-insert-command.
1 runs the command self-insert-command.
9 runs the command self-insert-command.

So: Now C-S-u works but a bunch of other keys lose their Ctrl.

----

If I set GTK_IM_MODULE to pretty much any other value from the list I
get from running
/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0, C-S-u
displays an underlined letter ‘u’, then ignores any keys except ESC,
SPC, RET, 0-9, a-f, A-F.

----

How can I get all of C-S-u, C-;, C-., C-, C-0, C-1, C-9 keys in GTK Emacs?

(Of course I want C-S-u for insert-char. No, C-x 8 RET is not an
acceptable alternative because every other application uses
Ctrl+Shift+U and I want consistency across my desktop.)



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

* Re: GTK Emacs and input modules
  2022-09-03 15:59 GTK Emacs and input modules Yuri Khan
@ 2022-09-03 16:03 ` Yuri Khan
  2022-09-04  0:39   ` Po Lu
  2022-09-04  0:38 ` Po Lu
  1 sibling, 1 reply; 8+ messages in thread
From: Yuri Khan @ 2022-09-03 16:03 UTC (permalink / raw)
  To: help-gnu-emacs

On Sat, 3 Sept 2022 at 22:59, Yuri Khan <yuri.v.khan@gmail.com> wrote:

> Can someone please consult me on Emacs’s interaction with GTK input modules?

Oh! Missed the most important section:

I am on Ubuntu 22.04 with its default version of GTK+3:

    $ dpkg -l libgtk-3-0
    ii  libgtk-3-0:amd64 3.24.33-1ubuntu2 amd64        GTK graphical
user interface library

Emacs is version 29.0.50, installed via this PPA:

https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa

    ii  emacs-snapshot 20220826:108459-c1442f96db~ubuntu22.04.1 amd64
      GNU Emacs editor (with GTK+ user interface)



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

* Re: GTK Emacs and input modules
  2022-09-03 15:59 GTK Emacs and input modules Yuri Khan
  2022-09-03 16:03 ` Yuri Khan
@ 2022-09-04  0:38 ` Po Lu
  2022-09-04  8:00   ` Yuri Khan
  1 sibling, 1 reply; 8+ messages in thread
From: Po Lu @ 2022-09-04  0:38 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> Hello,
>
> Can someone please consult me on Emacs’s interaction with GTK input modules?
>
> Steps:
>
> 1. $ emacs -Q
> 2. C-h k C-S-u
>
> Observed: no reaction.
>
> 3. C-S-u
>
> Observed: Emacs gets into a state where it ignores any keys except
> ESC, 0-9, a-f, A-F, RET, SPC. Pressing any of these keys except RET
> takes it out of this state.
>
> 4. C-h k C-; (also C-., C-,, C-0, C-1, C-9)
>
> Observed: C-; is undefined. (C-0, C-1, C-9 run the command digit-argument.)
>
> So: things mostly work but C-S-u doesn’t.
>
> Same behavior with $ GTK_IM_MODULE=ibus emacs.
>
> ----
>
> 1. $ GTK_IM_MODULE=xim emacs
> 2–4. same
>
> Observed: C-u (translated from C-S-u) runs the command universal-argument.
>
> ; runs the command self-insert-command.
> . runs the command self-insert-command.
> , runs the command self-insert-command.
> 0 runs the command self-insert-command.
> 1 runs the command self-insert-command.
> 9 runs the command self-insert-command.
>
> So: Now C-S-u works but a bunch of other keys lose their Ctrl.
>
> ----
>
> If I set GTK_IM_MODULE to pretty much any other value from the list I
> get from running
> /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0, C-S-u
> displays an underlined letter ‘u’, then ignores any keys except ESC,
> SPC, RET, 0-9, a-f, A-F.
>
> ----
>
> How can I get all of C-S-u, C-;, C-., C-, C-0, C-1, C-9 keys in GTK Emacs?
>
> (Of course I want C-S-u for insert-char. No, C-x 8 RET is not an
> acceptable alternative because every other application uses
> Ctrl+Shift+U and I want consistency across my desktop.)

What kind of GTK Emacs is this?

If this is the X build, then:

If you want to use X input methods, do _not_ use the GTK XIM module.
Emacs has built-in support for them that generally works better.

If you want some other input module, set `x-gtk-native-input' to a
non-nil value.



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

* Re: GTK Emacs and input modules
  2022-09-03 16:03 ` Yuri Khan
@ 2022-09-04  0:39   ` Po Lu
  0 siblings, 0 replies; 8+ messages in thread
From: Po Lu @ 2022-09-04  0:39 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> Emacs is version 29.0.50, installed via this PPA:
>
> https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa
>
>     ii  emacs-snapshot 20220826:108459-c1442f96db~ubuntu22.04.1 amd64
>       GNU Emacs editor (with GTK+ user interface)

Is that PGTK or GTK?



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

* Re: GTK Emacs and input modules
  2022-09-04  0:38 ` Po Lu
@ 2022-09-04  8:00   ` Yuri Khan
  2022-09-04  8:36     ` Po Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Yuri Khan @ 2022-09-04  8:00 UTC (permalink / raw)
  To: Po Lu; +Cc: help-gnu-emacs

On Sun, 4 Sept 2022 at 07:38, Po Lu <luangruo@yahoo.com> wrote:

> What kind of GTK Emacs is this?

Hm, it turns out that it is a PGTK build.

On the plus side, I won’t need to look for it when I migrate to
Wayland. On the minus side, I’m currently on X and I know your
warnings about PGTK Emacs on X not being a recommended configuration.

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-option-checking --disable-silent-rules
 '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=-snapshot --with-modules=yes --with-x=yes
 --with-x-toolkit=gtk3 --with-xwidgets=yes --with-pgtk=yes 'CFLAGS=-g
 -O2
 -ffile-prefix-map=/build/emacs-snapshot-drhUtZ/emacs-snapshot-108459=.
 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects
 -fstack-protector-strong -Wformat -Werror=format-security'
 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
 'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects
 -flto=auto -Wl,-z,relro''

> If this is the X build, then:
>
> If you want to use X input methods, do _not_ use the GTK XIM module.
> Emacs has built-in support for them that generally works better.
>
> If you want some other input module, set `x-gtk-native-input' to a
> non-nil value.

I do not want any input module, not even the default one that seems to
grab Ctrl+Shift+U.



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

* Re: GTK Emacs and input modules
  2022-09-04  8:00   ` Yuri Khan
@ 2022-09-04  8:36     ` Po Lu
  2022-09-04  9:26       ` Yuri Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Po Lu @ 2022-09-04  8:36 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On the plus side, I won’t need to look for it when I migrate to
> Wayland. On the minus side, I’m currently on X and I know your
> warnings about PGTK Emacs on X not being a recommended configuration.

It's not only recommended, it comes with severe defects up to and
including crashes.

> I do not want any input module, not even the default one that seems to
> grab Ctrl+Shift+U.

Try GTK_IM_CONTEXT=simple.

But your best option is simply to not use the PGTK build, and to put
this in your ~/.Xresources:

  Emacs.useXIM: false

Thanks.



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

* Re: GTK Emacs and input modules
  2022-09-04  8:36     ` Po Lu
@ 2022-09-04  9:26       ` Yuri Khan
  2022-09-04 12:53         ` Po Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Yuri Khan @ 2022-09-04  9:26 UTC (permalink / raw)
  To: Po Lu; +Cc: help-gnu-emacs

On Sun, 4 Sept 2022 at 15:37, Po Lu <luangruo@yahoo.com> wrote:

> > On the plus side, I won’t need to look for it when I migrate to
> > Wayland. On the minus side, I’m currently on X and I know your
> > warnings about PGTK Emacs on X not being a recommended configuration.
>
> It's not only recommended, it comes with severe defects up to and
> including crashes.

Never encountered any, except for the C-S-u issue.

> > I do not want any input module, not even the default one that seems to
> > grab Ctrl+Shift+U.
>
> Try GTK_IM_CONTEXT=simple.

No, with this build, Ctrl+Shift+U still pops up an underlined ‘u’ and
ignores keypresses up to the next entered hexadecimal digit.

> But your best option is simply to not use the PGTK build, and to put
> this in your ~/.Xresources:
>
>   Emacs.useXIM: false
>
> Thanks.

I’ll try that, thank you.

Just so that I’m prepared: do the C-S-u and C-; problems exist in PGTK
Emacs on Wayland?



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

* Re: GTK Emacs and input modules
  2022-09-04  9:26       ` Yuri Khan
@ 2022-09-04 12:53         ` Po Lu
  0 siblings, 0 replies; 8+ messages in thread
From: Po Lu @ 2022-09-04 12:53 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> Never encountered any, except for the C-S-u issue.

Select all of a large file, such as xdisp.c or xterm.c in the Emacs
source code, and try to insert it into another program.

Emacs will probably crash with a BadAlloc error.

> Just so that I’m prepared: do the C-S-u and C-; problems exist in PGTK
> Emacs on Wayland?

Yes, unless you also run (pgtk-use-im-context nil).



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

end of thread, other threads:[~2022-09-04 12:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-03 15:59 GTK Emacs and input modules Yuri Khan
2022-09-03 16:03 ` Yuri Khan
2022-09-04  0:39   ` Po Lu
2022-09-04  0:38 ` Po Lu
2022-09-04  8:00   ` Yuri Khan
2022-09-04  8:36     ` Po Lu
2022-09-04  9:26       ` Yuri Khan
2022-09-04 12:53         ` Po Lu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.