unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* After compose key cursor or function keys don't work
@ 2005-06-04 10:17 Richard Stallman
  2005-06-06 11:27 ` Jan D.
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2005-06-04 10:17 UTC (permalink / raw)


Would someone please work on this bug?

Date: Thu, 24 Mar 2005 09:09:43 +0100 (MET)
From: Klaus Zeitler <kzeitler@sfsws1.de.lucent.com>
To: emacs-pretest-bug@gnu.org
Subject: After compose key cursor or function keys don't work
Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org
X-Spam-Status: No, hits=0.5 required=5.0
	tests=RCVD_IN_ORBS
	version=2.55
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)

Symptoms:

When I've entered a compose key (e.g. <compose> a '), emacs doesn't respond to
an immediately following function or cursor key. A soon as I've entered a
"normal" key, I can use cursor or function keys again. 


In GNU Emacs 22.0.50.3 (sparc-sun-solaris2.8, Motif Version 2.1.0)
 of 2005-03-21 on sfsws4
Distributor `Sun Microsystems, Inc.', version 11.0.6410
configured using `configure '--with-gcc' '--prefix=/vol/freeware/SunOS-5.8/emacs/cvs' '--sharedstatedir=/vol/freeware/SunOS-5.8/emacs/cvs/share' '--with-x-toolkit=motif' '--x-includes=/usr/openwin/include:/usr/local/gnu/include:/opt/exp/gnu/include:/opt/exp/include:/opt/exp/lib/xpm/include' '--x-libraries=/usr/openwin/lib:/usr/local/gnu/lib:/opt/exp/gnu/lib:/opt/exp/lib:/opt/exp/lib/xpm/lib' '--with-pop' 'CC=gcc''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

Recent input:
=8e1 a <f1> C-g <backspace> <backspace> <help-echo> <help-echo> 
<menu-bar> <help-menu> <report-emacs-bug>

Recent messages:
Loading mwheel...done
(/usr/local/gnu/cvs/head/bin/emacs -q --no-site-file)
Loading tool-bar...done
Loading image...done
Loading tooltip...done
For information about the GNU Project and its goals, type C-h C-p.
Loading emacsbug...done

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

* Re: After compose key cursor or function keys don't work
  2005-06-04 10:17 After compose key cursor or function keys don't work Richard Stallman
@ 2005-06-06 11:27 ` Jan D.
  2005-06-13 12:47   ` Klaus Zeitler
  0 siblings, 1 reply; 5+ messages in thread
From: Jan D. @ 2005-06-06 11:27 UTC (permalink / raw)
  Cc: kzeitler, emacs-devel

Richard Stallman wrote:

>Would someone please work on this bug?
>
>Date: Thu, 24 Mar 2005 09:09:43 +0100 (MET)
>From: Klaus Zeitler <kzeitler@sfsws1.de.lucent.com>
>To: emacs-pretest-bug@gnu.org
>Subject: After compose key cursor or function keys don't work
>Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org
>X-Spam-Status: No, hits=0.5 required=5.0
>	tests=RCVD_IN_ORBS
>	version=2.55
>X-Spam-Level: 
>X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
>
>Symptoms:
>
>When I've entered a compose key (e.g. <compose> a '), emacs doesn't respond to
>an immediately following function or cursor key. A soon as I've entered a
>"normal" key, I can use cursor or function keys again. 
>
>  
>

I only have Solaris 9, and I could not reproduce it there.  I think the 
original reporter has to debug this a bit.  I suspect that for some 
reason compose_status is not right, around line 6276 there is a break 
that in effect ignores key presses.  If you add a printf before that 
line you can see if that is the problem.  Stepping in the code just 
before in that function and checking where it goes wrong may find a 
solution.

    Jan D.

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

* Re: After compose key cursor or function keys don't work
  2005-06-06 11:27 ` Jan D.
@ 2005-06-13 12:47   ` Klaus Zeitler
  2005-06-13 15:47     ` Jan D.
  0 siblings, 1 reply; 5+ messages in thread
From: Klaus Zeitler @ 2005-06-13 12:47 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "Jan" == Jan D <jan.h.d@swipnet.se> writes:
    Jan> 
    Jan> I suspect that for some reason compose_status is not right, around
    Jan> line 6276 there is a break that in effect ignores key presses.

Good guess. It seems as if the data in compose_status wont be changed when
I press e.g. an arrow key. Therefore if I try to press an arrow key right
after finishing a compose sequence compose_status.chars_matched is still set
to 3. Thus the if statement, you pointed me to, will be executed:

          if (compose_status.chars_matched > 0 && nbytes == 0)
            break;

It works, if I reset compose_status, once a compose sequence is complete,
i.e. if I change the line above to (not very nice, I know, since it uses the
internals of compose_status):

            if (compose_status.chars_matched > 0)
            {
              if (nbytes == 0)
                break;
              else if (compose_status.chars_matched == 3)
                compose_status.chars_matched = 0;
            }

HTH

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
When asked by an anthropologist what the Indians called America before
the white men came, an Indian said simply "Ours." -- Vine Deloria, Jr.

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

* Re: After compose key cursor or function keys don't work
  2005-06-13 12:47   ` Klaus Zeitler
@ 2005-06-13 15:47     ` Jan D.
  2005-06-22 14:12       ` Klaus Zeitler
  0 siblings, 1 reply; 5+ messages in thread
From: Jan D. @ 2005-06-13 15:47 UTC (permalink / raw)
  Cc: rms, emacs-devel


>    Jan> 
>    Jan> I suspect that for some reason compose_status is not right, around
>    Jan> line 6276 there is a break that in effect ignores key presses.
>
>Good guess. It seems as if the data in compose_status wont be changed when
>I press e.g. an arrow key. Therefore if I try to press an arrow key right
>after finishing a compose sequence compose_status.chars_matched is still set
>to 3. Thus the if statement, you pointed me to, will be executed:
>
>          if (compose_status.chars_matched > 0 && nbytes == 0)
>            break;
>
>It works, if I reset compose_status, once a compose sequence is complete,
>i.e. if I change the line above to (not very nice, I know, since it uses the
>internals of compose_status):
>

Does this patch work?

Index: xterm.c
*** xterm.c.~1.867.~    2005-06-13 17:46:19.000000000 +0200
--- xterm.c     2005-06-13 17:43:14.000000000 +0200
***************
*** 6281,6286 ****
--- 6281,6287 ----
            if (compose_status.chars_matched > 0 && nbytes == 0)
              break;

+           bzero (&compose_status, sizeof (compose_status));
            orig_keysym = keysym;

          /* Common for all keysym input events.  */

    Jan D.

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

* Re: After compose key cursor or function keys don't work
  2005-06-13 15:47     ` Jan D.
@ 2005-06-22 14:12       ` Klaus Zeitler
  0 siblings, 0 replies; 5+ messages in thread
From: Klaus Zeitler @ 2005-06-22 14:12 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "Jan" == Jan D <jan.h.d@swipnet.se> writes:
    Jan> 
    Jan> Does this patch work?
    Jan> 
    Jan> *** xterm.c.~1.867.~    2005-06-13 17:46:19.000000000 +0200
    Jan> --- xterm.c     2005-06-13 17:43:14.000000000 +0200
    Jan> ***************
    Jan> *** 6281,6286 ****
    Jan> --- 6281,6287 ----
    Jan>             if (compose_status.chars_matched > 0 && nbytes == 0)
    Jan>               break;
    Jan> 
    Jan> +           bzero (&compose_status, sizeof (compose_status));
    Jan>             orig_keysym = keysym;
    Jan> 
    Jan>           /* Common for all keysym input events.  */
    Jan> 

Yes, that looks good. Pressing a cursor or function key right after
a compose sequence works fine now. 
BTW in the middle of a compose sequence these keys are ignored, whereas e.g.
a <RET> will cause an abort of the compose sequence. Don't know if this the
expected behavior. IMHO this will do.

Thanks

Klaus


-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
When the government bureau's remedies don't match your
problem, you modify the problem, not the remedy.

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

end of thread, other threads:[~2005-06-22 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-04 10:17 After compose key cursor or function keys don't work Richard Stallman
2005-06-06 11:27 ` Jan D.
2005-06-13 12:47   ` Klaus Zeitler
2005-06-13 15:47     ` Jan D.
2005-06-22 14:12       ` 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).