From xemacs-m  Sun Sep  7 18:31:13 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id SAA28623
	for <xemacs-beta@xemacs.org>; Sun, 7 Sep 1997 18:31:12 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.25]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id QAA28642 for <xemacs-beta@xemacs.org>; Sun, 7 Sep 1997 16:30:42 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id QAA07770; Sun, 7 Sep 1997 16:30:41 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id QAA06207; Sun, 7 Sep 1997 16:30:40 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id QAA23475; Sun, 7 Sep 1997 16:30:38 -0700
Date: Sun, 7 Sep 1997 16:30:38 -0700
Message-Id: <199709072330.QAA23475@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: More changes to Key bindings, x-compose, x-win-*...
X-Mailer: VM 6.33 under 20.3 "Vienna" XEmacs  Lucid (beta14)
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>


I've done more hacking on this, with changes tp be in the next beta.

Complaints have been raised that x-keysym-on-keyboard-p doesn't
consider modifiers when looking for keysyms, e.g.

(x-keysym-on-keyboard-p "dollar")
==> nil

is surprising.

In the next beta, this will change, so that
(x-keysym-on-keyboard-p) will work as expected, e.g. with shifted and
AltGraph'ed characters.

The way (x-keysym-on-keyboard-p) currently works is also useful, and
will be accessible via (x-keysym-on-keyboard-sans-modifiers-p)

(x-keysym-on-keyboard-p "dollar")
==> t
(x-keysym-on-keyboard-sans-modifiers-p "dollar")
==> nil


I've put all the keysyms into a hashtable, so calling
x-keysym-on-keyboard* will be VERY fast.  x11/*.el have been
changed so that calls to x-keysym-on-keyboard-* are no longer avoided
for performance reasons.


I've also changed x-win-xfree86.el to use the new functionality.
I don't actually have a XFree86 implentation around, so please test
when available.  x-win-xfree86.el now uses function-key-map instead of 
global-map.

Here's the code: (I've used `loop' to annoy the Lisp purists)


;; For no obvious reason, shift-F1 is called F13, although Meta-F1 and
;; Control-F1 have normal names.

(loop for (x-key key sane-key) in
  '(("F13" f13 f1)
    ("F14" f14 f2)
    ("F15" f15 f3)
    ("F16" f16 f4)
    ("F17" f17 f5)
    ("F18" f18 f6)
    ("F19" f19 f7)
    ("F20" f20 f8)
    ("F21" f21 f9)
    ("F22" f22 f10)
    ("F23" f23 f11)
    ("F24" f24 f12))
  do
  (when (and (x-keysym-on-keyboard-p x-key)
	     (not (x-keysym-on-keyboard-sans-modifiers-p x-key)))
    ;; define also the control, meta, and meta-control versions.
    (loop for mods in '(() (control) (meta) (meta control)) do
      (define-key function-key-map `[(,@mods ,key)] `[(shift ,@mods ,sane-key)])
     )))


Martin

P.S. I *like* loop.  Sorry.

