all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* system-wide input methods and unmodified keys
@ 2014-06-26 16:08 Eric Abrahamsen
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Abrahamsen @ 2014-06-26 16:08 UTC (permalink / raw)
  To: help-gnu-emacs

I'm using the FCITX system-wide input method (for Chinese) as I like
having the same input method in all applications. I'm using Emacs trunk,
and this IM works well with the usual env variables set:

export GTK_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=fcitx

and emacs started as "LC_CTYPE=zh_CN.UTF-8 /usr/local/bin/emacs"

I'm using StumpWM on plain X, no window manager.

The only problem when using emacs is that any unmodified key stroke goes
to the IM, not to emacs. Fine when you're typing, but highly annoying in
special modes like Dired where unmodified keys call commands other than
`self-insert-command', or in key-prefix combos like "C-x o", where emacs
gets the "C-x" and the IM gets the "o".

Ideally, the IM would only ever handle keypresses that would eventually
call `self-insert-command' in emacs. I have no idea how this works,
however -- I don't know which application "comes first" in receiving
keypresses, and whether emacs could conceivably intercept these
unmodified keys and prevent the IM from reading them. I imagine if the
IM comes first, then there's no hope.

Does anyone know more about the interaction between emacs and system
IMs? Is there any chance of getting what I want?

Thanks!
Eric




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

* Re: system-wide input methods and unmodified keys
       [not found] <mailman.4359.1403798925.1147.help-gnu-emacs@gnu.org>
@ 2014-06-26 17:05 ` Stefan Monnier
  2014-06-26 17:28   ` Eric Abrahamsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2014-06-26 17:05 UTC (permalink / raw)
  To: help-gnu-emacs

> Ideally, the IM would only ever handle keypresses that would eventually
> call `self-insert-command' in emacs. I have no idea how this works,
> however -- I don't know which application "comes first" in receiving
> keypresses, and whether emacs could conceivably intercept these
> unmodified keys and prevent the IM from reading them. I imagine if the
> IM comes first, then there's no hope.

The IM comes first, indeed, hence the problems.  Maybe there's a way for
Emacs to temporarily suspend the external IM processing.  IF so, someone
will have to implement support for it :-(

But if/when such support is installed, we could maybe automatically
disable IM processing after C-x or in windows displaying
special-mode buffers.  That would be really welcome.


        Stefan


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

* Re: system-wide input methods and unmodified keys
  2014-06-26 17:05 ` Stefan Monnier
@ 2014-06-26 17:28   ` Eric Abrahamsen
  2014-06-27  2:24     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2014-06-26 17:28 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Ideally, the IM would only ever handle keypresses that would eventually
>> call `self-insert-command' in emacs. I have no idea how this works,
>> however -- I don't know which application "comes first" in receiving
>> keypresses, and whether emacs could conceivably intercept these
>> unmodified keys and prevent the IM from reading them. I imagine if the
>> IM comes first, then there's no hope.
>
> The IM comes first, indeed, hence the problems.  Maybe there's a way for
> Emacs to temporarily suspend the external IM processing.  IF so, someone
> will have to implement support for it :-(
>
> But if/when such support is installed, we could maybe automatically
> disable IM processing after C-x or in windows displaying
> special-mode buffers.  That would be really welcome.

Bad news, but not a surprise. I would have no idea how to start
implementing that. Something tells me we'll all be using Wayland before
anyone gets to it :)




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

* Re: system-wide input methods and unmodified keys
  2014-06-26 17:28   ` Eric Abrahamsen
@ 2014-06-27  2:24     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2014-06-27  2:24 UTC (permalink / raw)
  To: help-gnu-emacs

> implementing that. Something tells me we'll all be using Wayland before
> anyone gets to it :)

Probably won't make much of a difference in this respect (this guess is
based on the fact that AFAIK the same problem plagues OSX and W32 users).


        Stefan




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

end of thread, other threads:[~2014-06-27  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26 16:08 system-wide input methods and unmodified keys Eric Abrahamsen
     [not found] <mailman.4359.1403798925.1147.help-gnu-emacs@gnu.org>
2014-06-26 17:05 ` Stefan Monnier
2014-06-26 17:28   ` Eric Abrahamsen
2014-06-27  2:24     ` Stefan Monnier

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.