annotate lisp/x-win-xfree86.el @ 229:434959a2fba3 r20-5b13

Import from CVS: tag r20-5b13
author cvs
date Mon, 13 Aug 2007 10:13:02 +0200
parents 41ff10fd062f
children 157b30c96d03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1 ;;; x-win-xfree86.el --- runtime initialization for XFree86 servers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
2 ;; Copyright (C) 1995 Sun Microsystems, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Ben Wing.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
4
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
5 ;; Author: Ben Wing
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
6 ;; Author: Martin Buchholz (rewritten to use function-key-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
7 ;; Keywords: terminals
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
8
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
10
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
14 ;; any later version.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
15
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
19 ;; General Public License for more details.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
20
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
25
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
26 ;;; Commentary:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
27
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
28 ;; This file is loaded by x-win.el at run-time when we are sure that XEmacs
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
29 ;; is running on the display of something running XFree86 (Linux,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
30 ;; NetBSD, FreeBSD, and perhaps other Intel Unixen).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
31
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
32 ;;; #### bleck!!! Use key-translation-map!
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
33
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
34 ;;; #### Counter-bleck!! We shouldn't override a user binding for F13.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
35 ;;; So we use function-key-map for now.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
36 ;;; When we've implemented a fallback-style equivalent of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
37 ;;; keyboard-translate-table, we'll use that instead. (mrb)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
38
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
39 ;; For no obvious reason, shift-F1 is called F13, although Meta-F1 and
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
40 ;; Control-F1 have normal names.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
41
229
434959a2fba3 Import from CVS: tag r20-5b13
cvs
parents: 209
diff changeset
42 (defun x-win-init-xfree86 ()
434959a2fba3 Import from CVS: tag r20-5b13
cvs
parents: 209
diff changeset
43
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
44 (loop for (x-key key sane-key) in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
45 '(("F13" f13 f1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
46 ("F14" f14 f2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
47 ("F15" f15 f3)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
48 ("F16" f16 f4)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
49 ("F17" f17 f5)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
50 ("F18" f18 f6)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
51 ("F19" f19 f7)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
52 ("F20" f20 f8)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
53 ("F21" f21 f9)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
54 ("F22" f22 f10)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55 ("F23" f23 f11)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
56 ("F24" f24 f12))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
57 do
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
58 (when (and (x-keysym-on-keyboard-p x-key)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
59 (not (x-keysym-on-keyboard-sans-modifiers-p x-key)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 ;; define also the control, meta, and meta-control versions.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61 (loop for mods in '(() (control) (meta) (meta control)) do
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62 (define-key function-key-map `[(,@mods ,key)] `[(shift ,@mods ,sane-key)])
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 )))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65 ;; (let ((mapping '((f13 . (shift f1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 ;; (f14 . (shift f2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67 ;; (f15 . (shift f3))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 ;; (f16 . (shift f4))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69 ;; (f17 . (shift f5))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 ;; (f18 . (shift f6))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71 ;; (f19 . (shift f7))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 ;; (f20 . (shift f8))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 ;; (f21 . (shift f9))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74 ;; (f22 . (shift f10))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75 ;; (f23 . (shift f11))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 ;; (f24 . (shift f12)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78 ;; ;; now define them and also the control, meta, and meta-control versions.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 ;; (while mapping
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80 ;; (let* ((foo (caar mapping))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81 ;; (bar (cdar mapping))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82 ;; (foo (if (listp foo) foo (list foo)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 ;; (bar (if (listp bar) bar (list bar))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 ;; (let ((mods '(() (control) (meta) (meta control))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85 ;; (while mods
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 ;; (let ((k1 (vector (append (car mods) foo)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87 ;; (k2 (vector (append (car mods) bar))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 ;; (define-key global-map k1 k2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 ;; (setq mods (cdr mods))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90 ;; (setq mapping (cdr mapping)))))
229
434959a2fba3 Import from CVS: tag r20-5b13
cvs
parents: 209
diff changeset
91 )
434959a2fba3 Import from CVS: tag r20-5b13
cvs
parents: 209
diff changeset
92
434959a2fba3 Import from CVS: tag r20-5b13
cvs
parents: 209
diff changeset
93 ;;; x-win-xfree86.el ends here