unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
@ 2021-05-01  9:34 Elia Nolz
  2021-05-08 11:50 ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-01  9:34 UTC (permalink / raw)
  To: 48136

[-- Attachment #1: Type: text/plain, Size: 3574 bytes --]

- Use pgtk feature branch GNU Emacs 
- Use a keyboard layout that utilizes ISO_Level5_Shift (e.g. neoqwertz, bone, …) 
- Launch with `emacs -Q`
- Try to use ISO_Level5_Shift to access arrow keys or other shifted key
- `H-<down> is undefined` appears in echo area instead of sending down 
arrow and invoking `next-line` (This works in GNU Emacs without pgtk) 

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0) 
Repository revision: 8b51761dfda1c85c1e0b2344b005bb435117937a 
Repository branch: master 
Windowing system distributor 'System Description: NixOS 21.05 (Okapi) 

Configured using: 
'configure 
--prefix=/nix/store/nkq5x0gbzjalnq7xq78abfsaxfg00yx7-emacs-pgtkgcc-20210425.0 
--disable-build-details --with-modules --with-x-toolkit=gtk3 
--with-cairo --with-native-compilation --with-pgtk' 

Configured features: 
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON 
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY 
PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM 
GTK3 ZLIB 

Important settings: 
value of $LC_CTYPE: zh_CN.UTF-8 
value of $LC_TIME: en_DK.UTF-8 
value of $LANG: en_US.UTF-8 
locale-coding-system: utf-8-unix 

Major mode: Lisp Interaction 

Minor modes in effect: 
tooltip-mode: t 
global-eldoc-mode: t 
eldoc-mode: t 
electric-indent-mode: t 
mouse-wheel-mode: t 
tool-bar-mode: t 
menu-bar-mode: t 
file-name-shadow-mode: t 
global-font-lock-mode: t 
font-lock-mode: t 
blink-cursor-mode: t 
auto-composition-mode: t 
auto-encryption-mode: t 
auto-compression-mode: t 
line-number-mode: t 
transient-mark-mode: t 

Load-path shadows: 
None found. 

Features: 
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs 
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail 
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs 
eieio-loaddefs password-cache json map text-property-search time-date 
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies 
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs 
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils 
china-util iso-transl tooltip eldoc electric uniquify ediff-hook 
vc-hooks lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win 
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace 
newcomment text-mode elisp-mode lisp-mode prog-mode register page 
tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar 
mouse jit-lock font-lock syntax font-core term/tty-colors frame 
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese 
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek 
romanian slovak czech european ethiopic indian cyrillic chinese 
composite charscript charprop case-table epa-hook jka-cmpr-hook help 
simple abbrev obarray cl-preloaded nadvice button loaddefs faces 
cus-face macroexp files window text-properties overlay sha1 md5 base64 
format env code-pages mule custom widget hashtable-print-readable 
backquote threads dbusbind inotify dynamic-setting system-font-setting 
font-render-setting cairo move-toolbar gtk x-toolkit pgtk multi-tty 
make-network-process nativecomp emacs) 

Memory information: 
((conses 16 67501 7027) 
(symbols 48 6638 0) 
(strings 32 19211 1528) 
(string-bytes 1 687662) 
(vectors 16 13850) 
(vector-slots 8 339430 10291) 
(floats 8 22 31) 
(intervals 56 205 0) 
(buffers 992 10)) 

[-- Attachment #2: Type: text/html, Size: 4964 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-01  9:34 bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken Elia Nolz
@ 2021-05-08 11:50 ` Elia Nolz
  2021-05-09 10:17   ` Yuuki Harano
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-08 11:50 UTC (permalink / raw)
  To: 48136

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

Addendum:

I just tried if the same applied to terminal Emacs by launching it with `emacs -nw` and it does not (presumably because Super and Hyper are not passed from the terminal emulator to Emacs itself).

I was able to work around the bug by using `(define-key key-translation-map (kbd "H-<down>") (kbd "<down>"))` etc. for all ISO_Level5 keys but that is a bit too cluncky and static for my tastes. Is there a way to just translate every "H-" binding to just not have the modifier applied? Is there a list of all possible keys Emacs accepts and that I can use to just `map` over the `define-key` statement.

xmodmap output:

```
xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Shift_L (0x32)
control     Control_L (0x40),  Control_R (0x69)
mod1        Alt_L (0x85),  Meta_L (0xcd)
mod2        BadKey (0xcf)
mod3        ISO_Level5_Shift (0xcb)
mod4        Super_L (0x25),  Super_R (0x86),  Super_L (0xce)
mod5        ISO_Level3_Shift (0x5c)
```

[-- Attachment #2: Type: text/html, Size: 1735 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-08 11:50 ` Elia Nolz
@ 2021-05-09 10:17   ` Yuuki Harano
  2021-05-09 10:47     ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Yuuki Harano @ 2021-05-09 10:17 UTC (permalink / raw)
  To: gnu-emacs; +Cc: 48136


On Sat, 08 May 2021 13:50:28 +0200,
	"Elia Nolz" <gnu-emacs@lycheese.org> wrote:
> I was able to work around the bug by using `(define-key key-translation-map (kbd "H-<down>") (kbd "<down>"))` etc. for all ISO_Level5 keys but that is a bit too cluncky and static for my tastes. Is there a way to just translate every "H-" binding to just not have the modifier applied? Is there a list of all possible keys Emacs accepts and that I can use to just `map` over the `define-key` statement.
> 
> xmodmap output:
> 
> ```
> xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):
> 
> shift       Shift_L (0x32),  Shift_R (0x3e)
> lock        Shift_L (0x32)
> control     Control_L (0x40),  Control_R (0x69)
> mod1        Alt_L (0x85),  Meta_L (0xcd)
> mod2        BadKey (0xcf)
> mod3        ISO_Level5_Shift (0xcb)
> mod4        Super_L (0x25),  Super_R (0x86),  Super_L (0xce)
> mod5        ISO_Level3_Shift (0x5c)
> ```

Thanks for xmodmap output.
mod3 is used as hyper in pgtk emacs.

Does this work for you?

(put 'none 'modifier-value 0)
(setq x-hyper-keysym 'none)

-- 
Yuuki Harano





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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-09 10:17   ` Yuuki Harano
@ 2021-05-09 10:47     ` Elia Nolz
  2021-05-20  9:30       ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-09 10:47 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

On Sun, May 9, 2021, at 12:17, Yuuki Harano wrote:
> Does this work for you?
> 
> (put 'none 'modifier-value 0)
> (setq x-hyper-keysym 'none)

Yes this works perfectly for ISO_Level5_Shift. Thank you very much.

Sadly I stumbled upon another problem:

ISO_Level3_Shift combined with other modifiers is also partly broken. E.g. when using C-ISO_Level3_Shift-w (ISO_Level3_Shift-w is & in my layout) it just sends '&' instead of 'C-&'. Strangely enough the same is not true for 'C-ISO_Level3_Shift-a' which sends 'C-]' as it should. And 'C-IL3-u' sends 'ESC' instead of 'C-['. I am thoroughly confused.

[-- Attachment #2: Type: text/html, Size: 951 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-09 10:47     ` Elia Nolz
@ 2021-05-20  9:30       ` Elia Nolz
  2021-05-20 11:02         ` Yuuki Harano
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-20  9:30 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

On Sun, May 9, 2021, at 12:47, Elia Nolz wrote:
> On Sun, May 9, 2021, at 12:17, Yuuki Harano wrote:
>> Does this work for you?
>> 
>> (put 'none 'modifier-value 0)
>> (setq x-hyper-keysym 'none)
> 
> Yes this works perfectly for ISO_Level5_Shift. Thank you very much.
> 
> Sadly I stumbled upon another problem:
> 
> ISO_Level3_Shift combined with other modifiers is also partly broken. E.g. when using C-ISO_Level3_Shift-w (ISO_Level3_Shift-w is & in my layout) it just sends '&' instead of 'C-&'. Strangely enough the same is not true for 'C-ISO_Level3_Shift-a' which sends 'C-]' as it should. And 'C-IL3-u' sends 'ESC' instead of 'C-['. I am thoroughly confused.

I tested it a bit more and ended up with the following list:

Working key combinations (Ctrl and ISO_Level3_Shift held):
C-_
C-[ (I have since realized that it is expected behaviour that this sends ESC)
C-]
C-^
C-\
C-/
C-{
C-}
C-|
C-~
C-`
C-@

Non-working combinations (Ctrl held):
C-ü
C-ä
C-ö

Non-working combinantions (Ctrl and ISO_Level3_Shift held):
C-…
C-*
C-#
C-$
C-!
C-<
C->
C-=
C-&
C-?
C-(
C-)
C--
C-:
C-+
C-%
C-"
C-'
C-;
C-ſ

I am not really sure how to debug this further since I do not know where the processing of interpreting a key press starts in Emacs. Any tips on this?

[-- Attachment #2: Type: text/html, Size: 2304 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-20  9:30       ` Elia Nolz
@ 2021-05-20 11:02         ` Yuuki Harano
  2021-05-20 13:28           ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Yuuki Harano @ 2021-05-20 11:02 UTC (permalink / raw)
  To: gnu-emacs; +Cc: 48136


On Thu, 20 May 2021 11:30:46 +0200,
	"Elia Nolz" <gnu-emacs@lycheese.org> wrote:
> I am not really sure how to debug this further since I do not know
> where the processing of interpreting a key press starts in
> Emacs. Any tips on this?

Key events are handled in key_press_event() in pgtkterm.c.
I think `keysym` contains a character code, which is already
interpreted.

-- 
Yuuki Harano





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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-20 11:02         ` Yuuki Harano
@ 2021-05-20 13:28           ` Elia Nolz
  2021-05-20 16:02             ` Yuuki Harano
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-20 13:28 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

On Thu, May 20, 2021, at 13:02, Yuuki Harano wrote:
> Key events are handled in key_press_event() in pgtkterm.c.
> I think `keysym` contains a character code, which is already
> interpreted.

I stepped through the code with gdb and watched the keysym values.

I observed the following values for keysym in this order when pressing "C-L3-i" (sends "C-{") (working case):
65507 (state goes to 4 --> state to 0 and modifiers to 4)
65027 (state becomes 132 --> modifiers becomes 132 and state 128)
123 (no changes to state and modifiers)
65515 (should be me using Super+o to switch workspaces in xmonad)

And these for the non working case "C-L3-n" (which sends "(" and should send "C-("):
65507 (state to 4 --> state to 0 and modifiers to 4)
65027 (both state and modifiers become 0)
65515

I was unable to get the keysym of the key itself in the non-working cases.

Used breakpoints in pgtkterm.c:
5669
5687
5701
5710
5731
5809
5860
5876

I sadly do not know enough C to understand why this happens. Does this help you at all? Any further information I could provide that would be helpful?

[-- Attachment #2: Type: text/html, Size: 1715 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-20 13:28           ` Elia Nolz
@ 2021-05-20 16:02             ` Yuuki Harano
  2021-05-20 16:58               ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Yuuki Harano @ 2021-05-20 16:02 UTC (permalink / raw)
  To: gnu-emacs; +Cc: 48136

Thank you for the detail.

On Thu, 20 May 2021 15:28:49 +0200,
	"Elia Nolz" <gnu-emacs@lycheese.org> wrote:
> I was unable to get the keysym of the key itself in the non-working cases.

1. Start pgtk emacs.
2. Execute:
   (pgtk-use-im-context nil)
3. Test once more.

-- 
Yuuki Harano





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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-20 16:02             ` Yuuki Harano
@ 2021-05-20 16:58               ` Elia Nolz
  2021-05-21  6:57                 ` Yuuki Harano
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-20 16:58 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

On Thu, May 20, 2021, at 18:02, Yuuki Harano wrote:
>    (pgtk-use-im-context nil)
With that the keybindings all work. But now I can no longer activate fcitx within Emacs…is it possible to get fcitx working another way or do I need to switch to ddskk or similar?

[-- Attachment #2: Type: text/html, Size: 505 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-20 16:58               ` Elia Nolz
@ 2021-05-21  6:57                 ` Yuuki Harano
  2021-05-21  8:22                   ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Yuuki Harano @ 2021-05-21  6:57 UTC (permalink / raw)
  To: gnu-emacs; +Cc: 48136


On Thu, 20 May 2021 18:58:13 +0200,
	"Elia Nolz" <gnu-emacs@lycheese.org> wrote:
>>    (pgtk-use-im-context nil)
> With that the keybindings all work. But now I can no longer activate
> fcitx within Emacs…is it possible to get fcitx working another way
> or do I need to switch to ddskk or similar?

It disables GtkIM, so you can't use fcitx from emacs.

> do I need to switch to ddskk or similar?

Yes.

-- 
Yuuki Harano





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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-21  6:57                 ` Yuuki Harano
@ 2021-05-21  8:22                   ` Elia Nolz
  2021-05-21  9:56                     ` Yuuki Harano
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-05-21  8:22 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

On Fri, May 21, 2021, at 08:57, Yuuki Harano wrote:
> > do I need to switch to ddskk or similar?
> 
> Yes.
Ok, I will do that then.

I have documented the configuration needed to get back to Emacs' default behaviour on my side but I have seen quite a few people who use a similar setup to mine struggle with the changes to the behaviour and some drop pgtk altogether.

Will there be a disclaimer or similar when pgtk is merged into master or when that version of Emacs is released? Maybe it would be advisable to make these changes the default since that is how Emacs behaved to date?

[-- Attachment #2: Type: text/html, Size: 900 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-21  8:22                   ` Elia Nolz
@ 2021-05-21  9:56                     ` Yuuki Harano
  2021-06-09  9:21                       ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Yuuki Harano @ 2021-05-21  9:56 UTC (permalink / raw)
  To: gnu-emacs; +Cc: 48136


On Fri, 21 May 2021 10:22:42 +0200,
	"Elia Nolz" <gnu-emacs@lycheese.org> wrote:
> Maybe it would be advisable to make these changes the default since that is how Emacs behaved to date?

Does "these changes" mean this?

>    (pgtk-use-im-context nil)

Previously nil is the default.
But some people couldn't input correctly, so I reverted it to t,
also because I thought t was what the gtk app should be.
See:
https://github.com/masm11/emacs/issues/43

-- 
Yuuki Harano





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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-05-21  9:56                     ` Yuuki Harano
@ 2021-06-09  9:21                       ` Elia Nolz
  2021-06-24  8:52                         ` Elia Nolz
  0 siblings, 1 reply; 14+ messages in thread
From: Elia Nolz @ 2021-06-09  9:21 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

On Fri, May 21, 2021, at 11:56, Yuuki Harano wrote:
> Does "these changes" mean this?
> 
> >    (pgtk-use-im-context nil)

No, I was referring to the new default behaviour of the hyper key and how it changes how Emacs handles ISO_Level5_Shift:

(put 'none 'modifier-value 0)
(setq x-hyper-keysym 'none)


> Previously nil is the default.
> But some people couldn't input correctly, so I reverted it to t,
> also because I thought t was what the gtk app should be.
> See:
> https://github.com/masm11/emacs/issues/43

Regarding the behaviour with input methods, I honestly think that this is a bug that should be fixed since it straight up makes working Emacs setups impossible by disabling fcitx support (I have so far been unable to get ddskk working on NixOS).

[-- Attachment #2: Type: text/html, Size: 1354 bytes --]

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

* bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken
  2021-06-09  9:21                       ` Elia Nolz
@ 2021-06-24  8:52                         ` Elia Nolz
  0 siblings, 0 replies; 14+ messages in thread
From: Elia Nolz @ 2021-06-24  8:52 UTC (permalink / raw)
  To: Yuuki Harano; +Cc: 48136

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

On Wed, Jun 9, 2021, at 11:21, Elia Nolz wrote:
> Regarding the behaviour with input methods, I honestly think that this is a bug that should be fixed since it straight up makes working Emacs setups impossible by disabling fcitx support (I have so far been unable to get ddskk working on NixOS).
After updating Emacs (and without changing my config) both fcitx and the ISO_Level5 and 3 keybindings work now.

emacs-repository-version: c6ada6e9f1f82d36a05ecc49844e9400e0da8fdd

[-- Attachment #2: Type: text/html, Size: 731 bytes --]

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

end of thread, other threads:[~2021-06-24  8:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01  9:34 bug#48136: 28.0.50; [feature/pgtk] ISO_Level5_Shift broken Elia Nolz
2021-05-08 11:50 ` Elia Nolz
2021-05-09 10:17   ` Yuuki Harano
2021-05-09 10:47     ` Elia Nolz
2021-05-20  9:30       ` Elia Nolz
2021-05-20 11:02         ` Yuuki Harano
2021-05-20 13:28           ` Elia Nolz
2021-05-20 16:02             ` Yuuki Harano
2021-05-20 16:58               ` Elia Nolz
2021-05-21  6:57                 ` Yuuki Harano
2021-05-21  8:22                   ` Elia Nolz
2021-05-21  9:56                     ` Yuuki Harano
2021-06-09  9:21                       ` Elia Nolz
2021-06-24  8:52                         ` Elia Nolz

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git