unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
@ 2004-01-09 11:46 Richard Stallman
  2004-01-12  2:55 ` Jan D.
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2004-01-09 11:46 UTC (permalink / raw)


Can somebody who knows these issues better than I do please think
about whether this is correct?

X-Authentication-Warning: sfsw51.de.lucent.com: kzeitler set sender to kzeitler@lucent.com using -f
To: rms@gnu.org
Subject: Re: compose key on SUN keyboard creates 2 characters (and beeps)
X-Emacs-Acronym: Every Moron Assumes CCA is Superior
From: Klaus Zeitler <kzeitler@lucent.com>
Date: 08 Jan 2004 10:15:58 +0100
In-Reply-To: <E1Aa5p5-00083M-Ob@fencepost.gnu.org>
X-Spam-Status: No, hits=-2.1 required=5.0
	tests=IN_REP_TO,PATCH_CONTEXT_DIFF,REFERENCES,USER_AGENT_GNUS_UA,
	      X_AUTH_WARNING
	version=2.55
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)

--=-=-=

>>>>> "Richard" == Richard Stallman <rms@gnu.org> writes:
    Richard> 
    Richard> Could you tell me if this change is still needed?
    Richard> If it is, could you send a diff -c so I can be sure to
    Richard> make the change right?

yes, it's still needed. Here's a patch that works for Solaris.
Don't know about other OS.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=compose-key.patch
Content-Description: patch for compose key handling in xterm.c

*** xterm.c	Thu Jan  8 09:31:58 2004
--- xterm.c.~1.823.~	Thu Jan  8 09:31:00 2004
***************
*** 6305,6316 ****
                                    &compose_status);
  #endif
  
- 	  /* Check if we're processing a composed key. In this case we need
- 	     3 key presses till the key is complete. */
- 	  if ((compose_status.chars_matched == 1) ||
- 	      (compose_status.chars_matched == 2))
- 	    goto OTHER;
- 
            orig_keysym = keysym;
  
            if (numchars > 1)
--- 6305,6310 ----

--=-=-=


as I said in my original post instead of these lines it also works if one
checks nbytes instead, i.e.
--- snip ---
	  if (nbytes <= 0)
	    goto OTHER;
--- snip ---
should also work.

Since you asked if this is still needed I'm guessing that the compose key
works for other operating systems, e.g. GNU/Linux. Is that so?

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Early to rise, and early to bed / Makes a man healthy but socially dead
--=-=-=--

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-09 11:46 [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)] Richard Stallman
@ 2004-01-12  2:55 ` Jan D.
  2004-01-12  9:33   ` Klaus Zeitler
  0 siblings, 1 reply; 9+ messages in thread
From: Jan D. @ 2004-01-12  2:55 UTC (permalink / raw)
  Cc: emacs-devel


> Can somebody who knows these issues better than I do please think
> about whether this is correct?
>
>

I'm assuming these lines are to be added rather than subtracted since 
they
are not in xterm.c 1.823.

The internals of XComposeStatus is intended to be hidden, i.e. can
change at any time, so looking inside it might be unportable.  But a
check for > 0 (no need to limit ourselves to 1 or 2) can be done.  But
we should do break instead of goto OTHER.

Checking for nbytes <= 0 is not an option as we would then miss several
keys that returns 0 (function keys, the <menu> key, keypad keys ...).

	Jan D.


> *** xterm.c	Thu Jan  8 09:31:58 2004
> --- xterm.c.~1.823.~	Thu Jan  8 09:31:00 2004
> ***************
> *** 6305,6316 ****
>                                     &compose_status);
>   #endif
>
> - 	  /* Check if we're processing a composed key. In this case we need
> - 	     3 key presses till the key is complete. */
> - 	  if ((compose_status.chars_matched == 1) ||
> - 	      (compose_status.chars_matched == 2))
> - 	    goto OTHER;
> -
>             orig_keysym = keysym;
>
>             if (numchars > 1)
> --- 6305,6310 ----
>
> --=-=-=
>
>
> as I said in my original post instead of these lines it also works if 
> one
> checks nbytes instead, i.e.
> --- snip ---
> 	  if (nbytes <= 0)
> 	    goto OTHER;
> --- snip ---
> should also work.
>
> Since you asked if this is still needed I'm guessing that the compose 
> key
> works for other operating systems, e.g. GNU/Linux. Is that so?
>
> Klaus
>
> -- 
>  ------------------------------------------
> |  Klaus Zeitler      Lucent Technologies  |
> |  Email:             kzeitler@lucent.com  |
>  ------------------------------------------
> ---
> Early to rise, and early to bed / Makes a man healthy but socially dead
> --=-=-=--
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-12  2:55 ` Jan D.
@ 2004-01-12  9:33   ` Klaus Zeitler
  2004-01-12 11:48     ` Jan D.
  0 siblings, 1 reply; 9+ messages in thread
From: Klaus Zeitler @ 2004-01-12  9:33 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "Jan" == Jan D <jan.h.d@swipnet.se> writes:
    Jan> 
    Jan> I'm assuming these lines are to be added rather than subtracted since
    Jan> they are not in xterm.c 1.823.

looks like I've exchanged old and new file again in my patch, sorry :-)

    Jan> The internals of XComposeStatus is intended to be hidden, i.e. can
    Jan> change at any time, so looking inside it might be unportable.  But a

yes I agree. Since emacs looks at every single event, there must be a way to
tell emacs to ignore these events until the key is complete. I couldn't find
a better way.

    Jan> check for > 0 (no need to limit ourselves to 1 or 2) can be done.  But

are you sure, this would amaze me? I thought when chars_matched is 3, emacs
needs to handle the char, and as long as we're composing a character, we need
to ignore it.

    Jan> we should do break instead of goto OTHER.

I don't know when/how these 3 events that compose one char need to be
dispatched.

    Jan> Checking for nbytes <= 0 is not an option as we would then miss
    Jan> several keys that returns 0 (function keys, the <menu> key, keypad
    Jan> keys ...).

yes, you're right. Sorry, that wasn't a good idea, I have to admit :-(.

Does the compose key work the way it's implemented now e.g. under GNU/Linux?

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
It's odd, and a little unsettling, to reflect upon the fact
that English is the only major language in which "I" is
capitalized; in many other languages "You" is capitalized
and the "i" is lower case.              -- Sydney J. Harris

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-12  9:33   ` Klaus Zeitler
@ 2004-01-12 11:48     ` Jan D.
  2004-01-12 14:25       ` Klaus Zeitler
  0 siblings, 1 reply; 9+ messages in thread
From: Jan D. @ 2004-01-12 11:48 UTC (permalink / raw)
  Cc: rms, emacs-devel

>     Jan> check for > 0 (no need to limit ourselves to 1 or 2) can be 
> done.  But
>
> are you sure, this would amaze me? I thought when chars_matched is 3, 
> emacs
> needs to handle the char, and as long as we're composing a character, 
> we need
> to ignore it.

I would expect chars_matched to be set to 0 when a complete character
has been composed.  But this may not be so, it all depends on what Sun
has done.

> Does the compose key work the way it's implemented now e.g. under 
> GNU/Linux?

Compose processing works with XIM/XIC, so XLookupString is never called.
But if you turn XIM off (emacs --xrm '*useXIM: false') it does not work.
Nor can it be made to work in Emacs, since the code in XLookupString
that did compose processing has been conditionalized out in XFree86.
The compose_status parameter is never modifyed by XLookupString by
XFree86.  It sounds as if Sun is doing something else, I'll try to
figure out what when I can get my hand on a Solaris machine.

But is there a reason why XIM is not enabled for you?

	Jan D.

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-12 11:48     ` Jan D.
@ 2004-01-12 14:25       ` Klaus Zeitler
  2004-01-13 16:30         ` Jan D.
  0 siblings, 1 reply; 9+ messages in thread
From: Klaus Zeitler @ 2004-01-12 14:25 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "Jan" == Jan D <jan.h.d@swipnet.se> writes:
    Jan> 
     Jan> I would expect chars_matched to be set to 0 when a complete character
    Jan> has been composed.  But this may not be so, it all depends on what Sun
    Jan> has done.

I checked (on Solaris 5.8) and it is 3 after the 3rd key press.

    Jan> Compose processing works with XIM/XIC, so XLookupString is never
    Jan> called.  But if you turn XIM off (emacs --xrm '*useXIM: false') it
    Jan> does not work.  Nor can it be made to work in Emacs, since the code
    Jan> in XLookupString that did compose processing has been conditionalized
    Jan> out in XFree86.  The compose_status parameter is never modifyed by
    Jan> XLookupString by XFree86.  It sounds as if Sun is doing something
    Jan> else, I'll try to figure out what when I can get my hand on a Solaris
    Jan> machine.
    Jan> But is there a reason why XIM is not enabled for you?

I have no idea. I only know that XIM exists. I just checked config.h and
there's HAVE_XIM and USE_XIM both set to 1. So in theory it should be there.
What should I check?

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
If you don't have the time to do it right, where
are you going to find the time to do it over?

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-12 14:25       ` Klaus Zeitler
@ 2004-01-13 16:30         ` Jan D.
  2004-01-14 10:46           ` Klaus Zeitler
  0 siblings, 1 reply; 9+ messages in thread
From: Jan D. @ 2004-01-13 16:30 UTC (permalink / raw)
  Cc: rms, emacs-devel

>      Jan> I would expect chars_matched to be set to 0 when a complete 
> character
>     Jan> has been composed.  But this may not be so, it all depends on 
> what Sun
>     Jan> has done.
>
> I checked (on Solaris 5.8) and it is 3 after the 3rd key press.

Okay.

>     Jan> But is there a reason why XIM is not enabled for you?
>
> I have no idea. I only know that XIM exists. I just checked config.h 
> and
> there's HAVE_XIM and USE_XIM both set to 1. So in theory it should be 
> there.
> What should I check?

Check if you have HAVE_X_I18N and HAVE_X11R6_XIM defined.
The best way is to step in xterm.c in the debugger and see why
XmbLookupString is not called.  It may be some problem with creating the
XIC or the XIM.

	Jan D.

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-13 16:30         ` Jan D.
@ 2004-01-14 10:46           ` Klaus Zeitler
  2004-01-16 10:25             ` Jan D.
  0 siblings, 1 reply; 9+ messages in thread
From: Klaus Zeitler @ 2004-01-14 10:46 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "Jan" == Jan D <jan.h.d@swipnet.se> writes:
    Jan> 
    Jan> But is there a reason why XIM is not enabled for you?
    >> 
    >> I have no idea. I only know that XIM exists. I just checked config.h
    >> and there's HAVE_XIM and USE_XIM both set to 1. So in theory it should
    >> be there.  What should I check?
    Jan> 
    Jan> Check if you have HAVE_X_I18N and HAVE_X11R6_XIM defined.  The best
    Jan> way is to step in xterm.c in the debugger and see why XmbLookupString
    Jan> is not called.  It may be some problem with creating the XIC or the
    Jan> XIM.

sol2.h defines INHIBIT_X11R6_XIM:

--- snip ---
/* inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
   XIM support.  */

#define INHIBIT_X11R6_XIM
--- snip ---

Thus HAVE_XIM is defined, but HAVE_X11R6_XIM not (see config.h)


just for fun I removed the define for INHIBIT_X11R6_XIM line, but then emacs
crashed in XRegisterIMInstantiateCallback in xim_initialize.


So coming back to the original patch I suggested, maybe we should add it,
but enclosed with e.g. "#ifndef HAVE_X11R6_XIM".

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
One of the lessons of history is that nothing is often a good
thing to do and always a clever thing to say.  -- Will Durant

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-14 10:46           ` Klaus Zeitler
@ 2004-01-16 10:25             ` Jan D.
  2004-01-16 12:57               ` Klaus Zeitler
  0 siblings, 1 reply; 9+ messages in thread
From: Jan D. @ 2004-01-16 10:25 UTC (permalink / raw)
  Cc: rms, emacs-devel

>
> just for fun I removed the define for INHIBIT_X11R6_XIM line, but then 
> emacs
> crashed in XRegisterIMInstantiateCallback in xim_initialize.

Okay, thanks for testing it.

> So coming back to the original patch I suggested, maybe we should add 
> it,
> but enclosed with e.g. "#ifndef HAVE_X11R6_XIM".

I'm still thinking about what should be the correct condition.  After
all, you may have XIM but elected to turn it off.  Anyway, I've checked 
in
a fix.  Can you try it on Solaris?

Thanks,

	Jan D.

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

* Re: [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)]
  2004-01-16 10:25             ` Jan D.
@ 2004-01-16 12:57               ` Klaus Zeitler
  0 siblings, 0 replies; 9+ messages in thread
From: Klaus Zeitler @ 2004-01-16 12:57 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "Jan" == Jan D <jan.h.d@swipnet.se> writes:
    Jan> 
    Jan> I'm still thinking about what should be the correct condition.  After
    Jan> all, you may have XIM but elected to turn it off.  Anyway, I've
    Jan> checked in a fix.  Can you try it on Solaris?

works nicely. Thanks

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
So, what's with this guy Gideon, anyway?
And why can't he ever remember his Bible?

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

end of thread, other threads:[~2004-01-16 12:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-09 11:46 [kzeitler@lucent.com: Re: compose key on SUN keyboard creates 2 characters (and beeps)] Richard Stallman
2004-01-12  2:55 ` Jan D.
2004-01-12  9:33   ` Klaus Zeitler
2004-01-12 11:48     ` Jan D.
2004-01-12 14:25       ` Klaus Zeitler
2004-01-13 16:30         ` Jan D.
2004-01-14 10:46           ` Klaus Zeitler
2004-01-16 10:25             ` Jan D.
2004-01-16 12:57               ` Klaus Zeitler

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).