emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this fixed?


From: Kenichi Handa
Subject: Re: Is this fixed?
Date: Sat, 21 Oct 2006 11:10:20 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> writes:

> [I sent this message two weeks ago but did not get a response.]
> I think you may have fixed this, but since you didn't answer my previous
> message, I am not sure.  What is the status of this?

Sorry for the late response.  I've just installed a partial
fix.  It seems that the reason why XIM sometimes doesn't
work with Emacs is that Emacs fails to create an X's fontset
depending on user's locale and font being used.  As far as I
read the manual of XCreateFontSet, it seems that Emacs' code
is not wrong, but, actually XCreateFontSet (bug of X?).  I
couldn't figure out what pattern of fontsetname causes that
failure, but found a workaround and installed it.  At least
it works with XFree85 4.3.

Could people try "Test Case One/Two/Three/Four" with the
latest code?

---
Kenichi Handa
address@hidden

> The Problem:
> =================
> 
> Chinese users often find themselves unable to activate Chinese input
> methods in Emacs when running with GNOME 2 (>= 2.12) together. The
> problem typically appears when the following conditions are met:
> 
> * GNOME 2 (>= 2.12)
> * UTF-8 locale
> 
> The problem was first considered a conflict with
> gnome-settings-daemon, as Test Case One demonstrates (see test cases
> below). However, many users' reports also indicate a connection with
> font settings as Test Case Two/Three/Four will show.
> 
> To clarify things a bit, we want to stress here that, even though the
> hotkey to activate Chinese input method (i.e. 'Ctrl-Space') conflicts
> with one of the two key bindings to set marks in Emacs, this appears
> to be rather irrelevant. Bind the keys to something else in Emacs and
> the test cases should work just the same.
> 
> 
> Software
> =====================
> 
> To reproduce the problem, you need the following software installed:
> 
> * A Recent version of XFree86 or Xorg
> * A Recent version of GNOME 2 (>= 2.12 should be fine)
> * A XIM-capable Chinese input method, here we use SCIM as an example.
> * Emacs 21/22/23(Unicode branch)
> * WenQuanYi CJK bitmap fonts (needed by Test Case Three only)
> 
> On Debian GNU/Linux systems (Etch or Sid) you could simply run
> 'apt-get install scim scim-pinyin' as root to install the SCIM
> platform and the default PinYin Chinese input method in
> SCIM. Otherwise go get them at http://scim-im.org. To install
> WenQuanYi Chinese bitmap fonts, run 'apt-get install xfonts-wqy' on
> Debian GNU/Linux systems (Etch or Sid), or download a tarball from
> http://wqy.sourceforge.net/cgi-bin/enindex.cgi (use the pcf version
> please).
> 
> 
> Preparations:
> ====================
> 
> 1. Setup your locale as en_US.UTF-8 (other UTF-8 locales should be
> fine, but here we goes with en_US.UTF-8 since most people can read
> English anyway):
> 
> $ export LC_ALL=en_US.UTF-8
> 
> 2. Assert the following lines into your .xinitrc, right before where
> you start you wm or desktop environment, so that SCIM will start with
> X:
> 
> #--------- Cut Start -------------
> export address@hidden
> export XIM=SCIM
> export XIM_PROGRAM=/usr/bin/scim  # specify your path to scim
> export GTK_IM_MODULE=xim
> scim -d
> #--------- Cut End   -------------
> twm  # or whatever wm
> 
> 3. It's better if you move your .emacs aside before the tests, just in
> case something in your configuration would interfere with the test
> cases. Also move aside .Xdefaults too, if you've specified Emacs font
> settings in it before.
> 
> 4. Start X:
> 
> $ xinit
> 
> 5. To verify that SCIM is up, open a virtual terminal like xterm, then
> press Ctrl-Space. If a panel showes up on the bottom-right corner of
> your screen, go ahead and type "haha"; normally you could notice that
> the keys you hit got intercepted by another panel and not sending to
> xterm, which means SCIM is working. Just hit Enter and what you just
> typed would be sent to xterm; or press Space to send the Chinese
> characters to xterm that SCIM generated from your input. Press
> Ctrl-Space again to deactivate SCIM and continue with your normal
> typing.
> 
> 
> Test Case One:
> =================
> 
> Rationale:
> ----------
> 
> This test case demonstrates the fundamental problem: after
> gnome-settings-daemon is started, Chinese input method stops working
> with Emacs.
> 
> Steps:
> -----------
> 
> 1. Launch emacs, and press Ctrl-Space. Normally like with any other
> XIM-aware program, this brings up the SCIM panel. Now exits emacs.
> 
> 2. Launch xterm and run gnome-settings-daemon:
> 
> $ gnome-settings-daemon
> 
> 3. Launch emacs, and try hit Ctrl-Space in the Emacs window again. Now
> the SCIM panel won't show up and you will see a "Mark Set" message in
> mini-buffer.
> 
> 4. Exits emacs. Go back to xterm and hit Ctrl-c to end
> gnome-settings-daemon.
> 
> 5. Start emacs again and hit Ctrl-Space, the panel won't show up and
> SCIM is not working any more.
> 
> 
> Test Case Two:
> =================
> 
> Rationale:
> ----------
> 
> Designating a font that contains Han characters in command line
> sometimes make the problem goes away.
> 
> NB: The following test doesn't work with Unicode branch, and we have
> no idea why.
> 
> 
> Steps:
> ----------
> 
> 1. Start gnome-settings-daemon.
> 
> $ gnome-settings-daemon
> 
> 2. Start emacs with a designated Japanese font, which normally
>    contains a number of Han characters.
> 
> $ emacs -fn '-misc-fixed-medium-r-normal-ja-13-*-*-*-*-*-iso10646-1'
> 
> Sidenote: Start emacs by 'emacs -fn fontset-standard' seems to be of
> the same effect as well.
> 
> 3. Try hit Ctrl-Space in the emacs window, and you should see that
>    this brings up the SCIM panel, even if gnome-settings-daemon is
>    running.
> 
> 
> Test Case Three:
> ==================
> 
> Rationale: 
> ---------- 
> 
> After what we did in Test Case Two, we find it strange that even the
> font size we specify in command line can make a difference sometimes,
> mostly even numbers (12, 16, etc.) work but not odd numbers (13, 15,
> etc.).
> 
> Steps:
> ----------
> 
> 1. Make sure that you have WenQuanYi fonts installed.
> 
> $ xlsfonts | grep wenquanyi
> 
> You should see a list of wenquanyi fonts, including four sizes: 12,
> 13, 15 and 16. If this is not the case for you, go back and check
> installation document in the WenQuanYi fonts package.
> 
> 2. Start gnome-settings-daemon.
> 
> $ gnome-settings-daemon
> 
> 3. Start emacs with the following command:
> 
> $ emacs -fn '-wenquanyi-wenquanyi bitmap 
> song-medium-r-normal-*-16-*-*-*-*-*-iso10646-1'
> 
> 4. Try hit Ctrl-Space in the emacs window, and you should see that
>    this brings up the SCIM panel, even with gnome-settings-daemon
>    running. Now exits emacs.
> 
> 5. Start emacs with the following command, note that only the size of
>    the font is changed:
> 
> $ emacs -fn '-wenquanyi-wenquanyi bitmap 
> song-medium-r-normal-*-15-*-*-*-*-*-iso10646-1'
> 
> 6. Try hit Ctrl-Space in the emacs window, and this time you won't see
> the SCIM panel: the problem is back!
> 
> 
> Test Case Four:
> =================
> 
> Rationale:
> ----------
> 
> Recently, a user came up with a strange solution to this problem when
> he was playing with Xft support in Unicode branch, trying to setup
> Chinese fonts correctly; His report showes that deleting all CJK fonts
> in X base fonts (the Debian xbase-fonts package) would effectively
> make the problem goes away. 
> 
> Steps:
> ------------
> 
> 1. Save the following Python script as rmfonts.py, and run 'python
> rmfonts.py' as root. The script removes all CJK fonts from X's base
> fonts (actually all fonts that specifies encodings that not started
> with 'iso', like 'gb2312', see the script below for details).
> 
> *WARNING: BACKUP THE FONTPATH DIRECTORY BEFORE YOU GO!*
> 
> 
> #!/usr/bin/env python
> 
> import os
> 
> FONTPATH = '/usr/share/fonts/X11/misc' # Change this if your font path differ
> 
> def process(line):
>     tokens = line.split(' -')
>     if len(tokens) > 1:
>         parts = tokens[1].split('-')   
>       if len(parts) > 1 and not parts[-2].startswith('iso'):
>             return os.path.join(FONTPATH, tokens[0])
> 
> fontlist = [process(line) for line in open(os.path.join(FONTPATH, 
> 'fonts.dir'))]
> fontlist = filter(None, fontlist)
> for font in fontlist:
>     os.unlink(font)
> os.system('mkfontdir %s' % FONTPATH)
> 
> 2. Restart X.
> 
> 3. Start gnome-settings-daemon.
> 
> $ gnome-settings-daemon
> 
> 4. Start emacs, and try hit Ctrl-Space in the emacs window. You should
>    see that this brings up the SCIM panel, even if
>    gnome-settings-daemon is running.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]