comparison lisp/keymap.el @ 5529:3d1f8f0e690f

Add `function-key-map-parent', for non-console-specific `function-key-map' bindings src/ChangeLog addition: 2011-06-25 Aidan Kehoe <kehoea@parhasard.net> * console.c: * console.c (allocate_console): * console.c (vars_of_console): * console.c (complex_vars_of_console): * lisp.h: Add a new keymap variable, function-key-map-parent; use it as the parent of each console-specific function-key-map. This is appropriate for things like x-compose processing. lisp/ChangeLog addition: 2011-06-25 Aidan Kehoe <kehoea@parhasard.net> * gtk-init.el: * gtk-init.el (make-device-late-gtk-entry-point): * gtk-init.el (gtk-initialize-compose): Removed. * keymap.el: * keymap.el (function-key-map-parent): * x-init.el (x-initialize-compose): Removed. * x-init.el (make-device-late-x-entry-point): Make the bindings for dead-acute and friends in function-key-map-parent, rather than function-key-map; do this in keymap.el rather than in window-system-specific code, since the compose processing is generally useful and not X11-specific. It's probably reasonable to rename x-compose.el to compose.el at this point, but I haven't done that. man/ChangeLog addition: 2011-06-25 Aidan Kehoe <kehoea@parhasard.net> * lispref/os.texi (Translating Input): Document the just-added function-key-map-parent.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 25 Jun 2011 14:00:48 +0100
parents 308d34e9f07d
children 493c487cbc3f
comparison
equal deleted inserted replaced
5528:dc88f282ddc3 5529:3d1f8f0e690f
508 (t 508 (t
509 ;; Illegal event. 509 ;; Illegal event.
510 (error "Event has no character equivalent: %s" event)))) 510 (error "Event has no character equivalent: %s" event))))
511 (vector (intern (concat "" (nreverse list)))))) 511 (vector (intern (concat "" (nreverse list))))))
512 512
513 ;; This looks dirty. The following code should maybe go to another 513 (define-key function-key-map-parent [?\C-x ?@ ?h] 'event-apply-hyper-modifier)
514 ;; file, and `create-console-hook' should maybe default to nil. 514 (define-key function-key-map-parent [?\C-x ?@ ?s] 'event-apply-super-modifier)
515 (add-hook 515 (define-key function-key-map-parent [?\C-x ?@ ?m] 'event-apply-meta-modifier)
516 'create-console-hook 516 (define-key function-key-map-parent [?\C-x ?@ ?S] 'event-apply-shift-modifier)
517 #'(lambda (console) 517 (define-key function-key-map-parent [?\C-x ?@ ?c] 'event-apply-control-modifier)
518 (letf (((selected-console) console)) 518 (define-key function-key-map-parent [?\C-x ?@ ?a] 'event-apply-alt-modifier)
519 (define-key function-key-map [?\C-x ?@ ?h] 'event-apply-hyper-modifier) 519 (define-key function-key-map-parent [?\C-x ?@ ?k] 'synthesize-keysym)
520 (define-key function-key-map [?\C-x ?@ ?s] 'event-apply-super-modifier) 520
521 (define-key function-key-map [?\C-x ?@ ?m] 'event-apply-meta-modifier) 521 ;; The autoloads for the compose map, and their bindings in
522 (define-key function-key-map [?\C-x ?@ ?S] 'event-apply-shift-modifier) 522 ;; function-key-map-parent are used by GTK as well as X11. And Julian
523 (define-key function-key-map [?\C-x ?@ ?c] 'event-apply-control-modifier) 523 ;; Bradfield, at least, uses x-compose on the TTY, it's reasonable to make
524 (define-key function-key-map [?\C-x ?@ ?a] 'event-apply-alt-modifier) 524 ;; them generally available.
525 (define-key function-key-map [?\C-x ?@ ?k] 'synthesize-keysym)))) 525
526 (loop for map in '(compose-acute-map compose-breve-map compose-caron-map
527 compose-cedilla-map compose-circumflex-map
528 compose-diaeresis-map compose-dot-map
529 compose-doubleacute-map compose-grave-map
530 compose-hook-map compose-horn-map compose-macron-map
531 compose-map compose-ogonek-map compose-ring-map
532 compose-stroke-map compose-tilde-map)
533 do (autoload map "x-compose" nil t 'keymap))
534
535 (loop
536 for (key map)
537 ;; The dead keys might really be called just about anything, depending
538 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and
539 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3
540 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
541 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_". Go
542 ;; figure.
543
544 ;; Presumably if someone is running OpenWindows, they won't be using the
545 ;; DEC or HP keysyms, but if they are defined then that is possible, so
546 ;; in that case we accept them all.
547
548 ;; If things seem not to be working, you might want to check your
549 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
550 ;; mixed up view of what these keys should be called.
551
552 ;; Canonical names:
553 in '((acute compose-acute-map)
554 (grave compose-grave-map)
555 (cedilla compose-cedilla-map)
556 (diaeresis compose-diaeresis-map)
557 (circumflex compose-circumflex-map)
558 (tilde compose-tilde-map)
559 (degree compose-ring-map)
560 (multi-key compose-map)
561
562 ;; Sun according to MIT:
563 (SunFA_Acute compose-acute-map)
564 (SunFA_Grave compose-grave-map)
565 (SunFA_Cedilla compose-cedilla-map)
566 (SunFA_Diaeresis compose-diaeresis-map)
567 (SunFA_Circum compose-circumflex-map)
568 (SunFA_Tilde compose-tilde-map)
569
570 ;; Sun according to OpenWindows 2:
571 (Dead_Grave compose-grave-map)
572 (Dead_Circum compose-circumflex-map)
573 (Dead_Tilde compose-tilde-map)
574
575 ;; Sun according to OpenWindows 3:
576 (SunXK_FA_Acute compose-acute-map)
577 (SunXK_FA_Grave compose-grave-map)
578 (SunXK_FA_Cedilla compose-cedilla-map)
579 (SunXK_FA_Diaeresis compose-diaeresis-map)
580 (SunXK_FA_Circum compose-circumflex-map)
581 (SunXK_FA_Tilde compose-tilde-map)
582
583 ;; DEC according to MIT:
584 (Dacute_accent compose-acute-map)
585 (Dgrave_accent compose-grave-map)
586 (Dcedilla_accent compose-cedilla-map)
587 (Dcircumflex_accent compose-circumflex-map)
588 (Dtilde compose-tilde-map)
589 (Dring_accent compose-ring-map)
590
591 ;; DEC according to OpenWindows 3:
592 (DXK_acute_accent compose-acute-map)
593 (DXK_grave_accent compose-grave-map)
594 (DXK_cedilla_accent compose-cedilla-map)
595 (DXK_circumflex_accent compose-circumflex-map)
596 (DXK_tilde compose-tilde-map)
597 (DXK_ring_accent compose-ring-map)
598
599 ;; HP according to MIT:
600 (hpmute_acute compose-acute-map)
601 (hpmute_grave compose-grave-map)
602 (hpmute_diaeresis compose-diaeresis-map)
603 (hpmute_asciicircum compose-circumflex-map)
604 (hpmute_asciitilde compose-tilde-map)
605
606 ;; Empirically discovered on Linux XFree86 MetroX:
607 (usldead_acute compose-acute-map)
608 (usldead_grave compose-grave-map)
609 (usldead_diaeresis compose-diaeresis-map)
610 (usldead_asciicircum compose-circumflex-map)
611 (usldead_asciitilde compose-tilde-map)
612
613 ;; HP according to OpenWindows 3:
614 (hpXK_mute_acute compose-acute-map)
615 (hpXK_mute_grave compose-grave-map)
616 (hpXK_mute_diaeresis compose-diaeresis-map)
617 (hpXK_mute_asciicircum compose-circumflex-map)
618 (hpXK_mute_asciitilde compose-tilde-map)
619
620 ;; HP according to HP-UX 8.0:
621 (XK_mute_acute compose-acute-map)
622 (XK_mute_grave compose-grave-map)
623 (XK_mute_diaeresis compose-diaeresis-map)
624 (XK_mute_asciicircum compose-circumflex-map)
625 (XK_mute_asciitilde compose-tilde-map)
626
627 ;; XFree86 uses lower case and an underscore. XEmacs converts the
628 ;; underscore to a hyphen in x_keysym_to_emacs_keysym because the
629 ;; keysym is in the "Keyboard" character set, which seems a very
630 ;; arbitrary approach.
631 (dead-acute compose-acute-map)
632 (dead-grave compose-grave-map)
633 (dead-cedilla compose-cedilla-map)
634 (dead-diaeresis compose-diaeresis-map)
635 (dead-circum compose-circumflex-map)
636 (dead-circumflex compose-circumflex-map)
637 (dead-tilde compose-tilde-map)
638 (dead-abovering compose-ring-map)
639 (dead-caron compose-caron-map)
640 (dead-macron compose-macron-map)
641 (dead-breve compose-breve-map)
642 (dead-abovedot compose-dot-map)
643 (dead-doubleacute compose-doubleacute-map)
644 (dead-ogonek compose-ogonek-map)
645 (dead-hook compose-hook-map)
646 (dead-horn compose-horn-map)
647 (dead-stroke compose-stroke-map))
648 do (define-key function-key-map-parent (vector key) map))
526 649
527 ;;; keymap.el ends here 650 ;;; keymap.el ends here