Bug 242012 - editors/emacs: Cannot use fcitx with Emacs when built with GTK3
Summary: editors/emacs: Cannot use fcitx with Emacs when built with GTK3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: emacs@FreeBSD.org (Nobody)
URL: https://build.opensuse.org/package/vi...
Keywords: needs-qa
Depends on:
Reported: 2019-11-16 21:13 UTC by David Gao
Modified: 2020-02-18 23:07 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (emacs)
koobs: merge-quarterly?


Note You need to log in before you can comment on or make changes to this bug.
Description David Gao 2019-11-16 21:13:41 UTC
I can't use fcitx with Emacs when I build with GTK3.

I found a solution from OpenSUSE https://build.opensuse.org/package/view_file/home:AndreasSchwab:emacs:26/emacs/emacs-24.4-xim.patch?expand=1.

Could we add this patch as an option in configure.
Because I understand a lot of people may use C-<SPC> as set-mark-command even C-@ works as same.
Comment 1 Joseph Mingrone freebsd_committer 2019-11-18 12:21:22 UTC
Could you provide more information?  Based on the patch location, it seems the problem is not specific to FreeBSD/gtk3.  Is that correct?  Searching [1,2], I see recent discussions that suggest fcitx can work with some tinkering.  Have you tried these?

I am not necessary opposed to patching the FreeBSD port, but this is a topic that I am not familiar with and would like to understand the problem better.

[1] https://www.reddit.com/r/emacs/comments/bndaif/chinese_input/en4o53e/
[2] https://wiki.archlinux.org/index.php/Fcitx#Emacs
Comment 2 David Gao 2019-11-18 23:12:50 UTC
(In reply to Joseph Mingrone from comment #1)
I saw your references. And I have tried it. Yes, it can solve it. 

And I know Emacs has its own input method of CJK, it can work great. But we are working under en_US.UTF-8 and IBus can work without the changing LC_TYPES. I don't know why this could happen, because I think both IBus and fcitx implement the XIM protocol, but they have different behaviors.

So I think this patch can be included as an option in configure. So I don't have to write a script to warp the Emacs.
Comment 3 Joseph Mingrone freebsd_committer 2020-02-16 21:41:33 UTC
Hello.  Sorry for the delay.  Could you confirm that the patch you linked to works with the current version of Emacs, 26.3?  So, just adding an option like FCITX_PATCH that applies this patch is all you require?  If so, I will work on this in the next day, since it's a holiday, so I'll have a bit of time.
Comment 4 David Gao 2020-02-16 23:57:24 UTC
(In reply to Joseph Mingrone from comment #3)
Hi Joseph

I patch this problem by modifying the source of emacs as the patch. And it works on Emacs 26.3. 
But I don't sure about the origin file of this patch can be patched with Emacs 26.3.

Thanks & Regards.
Comment 5 Joseph Mingrone freebsd_committer 2020-02-17 03:01:56 UTC
Could you please test https://reviews.freebsd.org/D23725 to confirm it works for you?
Comment 6 David Gao 2020-02-17 03:31:41 UTC
(In reply to Joseph Mingrone from comment #5)
Hi Joseph 
I will test it and feed back the result.

Thanks & Regards.
Comment 7 David Gao 2020-02-18 01:18:59 UTC
(In reply to Joseph Mingrone from comment #5)
Hi Joseph 

It works very good. Thank you very much.

Thanks & Regards.
Comment 8 commit-hook freebsd_committer 2020-02-18 22:57:42 UTC
A commit references this bug:

Author: jrm
Date: Tue Feb 18 22:57:13 UTC 2020
New revision: 526478
URL: https://svnweb.freebsd.org/changeset/ports/526478

  editors/emacs: Add optional workaround for Fcitx input method

  PR:		242012
  Reported by:	david.alpha.fox@gmail.com
  Approved by:	emacs (ashish)
  Tested by:	david.alpha.fox@gmail.com
  Differential Revision:	https://reviews.freebsd.org/D23725

Comment 9 Joseph Mingrone freebsd_committer 2020-02-18 23:07:16 UTC
Committed. Thanks for reporting.