annotate lisp/gtk-init.el @ 462:0784d089fdc9 r21-2-46

Import from CVS: tag r21-2-46
author cvs
date Mon, 13 Aug 2007 11:44:37 +0200
parents
children 54fa1a5c2d12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 ;;; gtk-init.el --- initialization code for mswindows
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 ;; Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Board of Trustees, University of Illinois.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995, 1996 Ben Wing.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 ;; Author: various
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 ;; Rewritten for Gtk by: William Perry
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 ;; any later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 ;; General Public License for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26 (defvar gtk-win-initted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
27 (defvar gtk-pre-win-initted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28 (defvar gtk-post-win-initted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30 (defvar gtk-command-switch-alist
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31 '(
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32 ;; GNOME Options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 ("--disable-sound" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34 ("--enable-sound" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
35 ("--espeaker" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
36
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 ;; GTK Options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 ("--gdk-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 ("--gdk-no-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 ("--display" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 ("--sync" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 ("--no-xshm" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 ("--name" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 ("--class" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 ("--gxid_host" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 ("--gxid_port" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 ("--xim-preedit" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 ("--xim-status" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 ("--gtk-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 ("--gtk-no-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 ("--gtk-module" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 ;; Glib options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 ("--g-fatal-warnings" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 ;; Session management options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 ("--sm-client-id" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 ("--sm-config-prefix" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 ("--sm-disable" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 "An assoc list of command line arguments that should in gtk-initial-argv-list.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 This is necessary because GTK and GNOME consider it a fatal error if they receive
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 unknown command line arguments (perfectly reasonable). But this means that if
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 the user specifies a file name on the command line they will be unable to start.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 So we filter the command line and allow only items in this list in.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 The CDR of the assoc list is whether it accepts an argument. All options are in
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 GNU long form though.")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 (defun init-pre-gtk-win ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 "Initialize Gtk GUI at startup (pre). Don't call this."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 (when (not gtk-pre-win-initted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 (setq initial-frame-plist (if initial-frame-unmapped-p
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 '(initially-unmapped t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77 gtk-pre-win-initted t)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 (defun gtk-init-handle-geometry (arg)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 "Set up initial geometry info for GTK devices."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 (setq gtk-initial-geometry (pop command-line-args-left)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 (defun gtk-filter-arguments ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 (let ((accepted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 (rejected nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86 (todo nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 (setq todo (mapcar (lambda (argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 (if (cdr argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89 ;; Need to look for --foo=bar
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 (concat "^" (car argdesc) "=")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 ;; Just a simple arg
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 (concat "^" (regexp-quote (car argdesc)) "$")))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 gtk-command-switch-alist))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 (while command-line-args-left
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 (if (catch 'found
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 (mapc (lambda (r)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 (if (string-match r (car command-line-args-left))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 (throw 'found t))) todo)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 (mapc (lambda (argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 (if (cdr argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 ;; This time we only care about argument items
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 ;; that take an argument. We'll check to see if
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 ;; someone used --foo bar instead of --foo=bar
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 (if (string-match (concat "^" (car argdesc) "$") (car command-line-args-left))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 ;; Yup! Need to push
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 (progn
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 (push (pop command-line-args-left) accepted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 (throw 'found t)))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 gtk-command-switch-alist)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 (push (pop command-line-args-left) accepted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 (push (pop command-line-args-left) rejected)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 (setq command-line-args-left (nreverse rejected))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 (nreverse accepted)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 (defun init-gtk-win ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 "Initialize Gtk GUI at startup. Don't call this."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 (unless gtk-win-initted
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 (init-pre-gtk-win)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 (setq gtk-initial-argv-list (cons (car command-line-args) (gtk-filter-arguments))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 gtk-initial-geometry (nth 1 (member "-geometry" command-line-args-left)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 (make-gtk-device)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 (init-post-gtk-win)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 (setq gtk-win-initted t)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 (defun init-post-gtk-win ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 (unless gtk-post-win-initted
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 (if (and (not (featurep 'infodock)) (featurep 'toolbar))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 (init-x-toolbar))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 (if (and (featurep 'infodock) (featurep 'toolbar))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132 (require 'id-x-toolbar))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 (when (featurep 'mule)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135 (define-specifier-tag 'mule-fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136 (lambda (device) (eq 'gtk (device-type device))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 (set-face-font
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138 'default
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 '("-*-fixed-medium-r-*--16-*-iso8859-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 "-*-fixed-medium-r-*--*-iso8859-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 "-*-fixed-medium-r-*--*-iso8859-2"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 "-*-fixed-medium-r-*--*-iso8859-3"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 "-*-fixed-medium-r-*--*-iso8859-4"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144 "-*-fixed-medium-r-*--*-iso8859-7"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 "-*-fixed-medium-r-*--*-iso8859-8"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 "-*-fixed-medium-r-*--*-iso8859-5"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147 "-*-fixed-medium-r-*--*-iso8859-9"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 ;; Following 3 fonts proposed by Teruhiko.Kurosaka@Japan.eng.sun
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150 "-sun-gothic-medium-r-normal--14-120-75-75-c-60-jisx0201.1976-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151 "-sun-gothic-medium-r-normal--14-120-75-75-c-120-jisx0208.1983-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 "-wadalab-gothic-medium-r-normal--14-120-75-75-c-120-jisx0212.1990-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153 ;; Other Japanese fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 "-*-fixed-medium-r-*--*-jisx0201.1976-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 "-*-fixed-medium-r-*--*-jisx0208.1983-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
156 "-*-fixed-medium-r-*--*-jisx0212*-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
157
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 ;; Chinese fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159 "-*-*-medium-r-*--*-gb2312.1980-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 ;; Use One font specification for CNS chinese
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 ;; Too many variations in font naming
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163 "-*-fixed-medium-r-*--*-cns11643*-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164 ;; "-*-fixed-medium-r-*--*-cns11643*2"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 ;; "-*-fixed-medium-r-*--*-cns11643*3"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 ;; "-*-fixed-medium-r-*--*-cns11643*4"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 ;; "-*-fixed-medium-r-*--*-cns11643.5-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 ;; "-*-fixed-medium-r-*--*-cns11643.6-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169 ;; "-*-fixed-medium-r-*--*-cns11643.7-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 "-*-fixed-medium-r-*--*-big5*-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172 "-*-fixed-medium-r-*--*-sisheng_cwnn-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 ;; Other fonts
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 ;; "-*-fixed-medium-r-*--*-viscii1.1-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 ;; "-*-fixed-medium-r-*--*-mulearabic-0"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179 ;; "-*-fixed-medium-r-*--*-mulearabic-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 ;; "-*-fixed-medium-r-*--*-mulearabic-2"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 ;; "-*-fixed-medium-r-*--*-muleipa-1"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183 ;; "-*-fixed-medium-r-*--*-ethio-*"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185 "-*-mincho-medium-r-*--*-ksc5601.1987-*" ; Korean
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 "-*-fixed-medium-r-*--*-tis620.2529-1" ; Thai
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 'global '(mule-fonts) 'append))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
189
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
190 (add-hook 'zmacs-deactivate-region-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
191 (lambda ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 (if (console-on-window-system-p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193 (disown-selection))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
194 (add-hook 'zmacs-activate-region-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195 (lambda ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196 (if (console-on-window-system-p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 (activate-region-as-selection))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
198 (add-hook 'zmacs-update-region-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
199 (lambda ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 (if (console-on-window-system-p)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201 (activate-region-as-selection))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203 (define-key global-map 'menu 'popup-mode-menu)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 (setq gtk-post-win-initted t)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206 (push '("-geometry" . gtk-init-handle-geometry) command-switch-alist)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 ;;; Stuff to get compose keys working on GTK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209 (eval-when-compile
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 (defmacro gtk-define-dead-key (key map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211 `(when (gtk-keysym-on-keyboard-p ',key)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 (define-key function-key-map [,key] ',map))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214 (defun gtk-initialize-compose ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
215 "Enable compose processing"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
216 (autoload 'compose-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217 (autoload 'compose-acute-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 (autoload 'compose-grave-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
219 (autoload 'compose-cedilla-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
220 (autoload 'compose-diaeresis-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221 (autoload 'compose-circumflex-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
222 (autoload 'compose-tilde-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
223
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
224 (when (gtk-keysym-on-keyboard-p 'multi-key)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225 (define-key function-key-map [multi-key] 'compose-map))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
227 ;; The dead keys might really be called just about anything, depending
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
230 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_".
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 ;; Go figure.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234 ;; Presumably if someone is running OpenWindows, they won't be using
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 ;; the DEC or HP keysyms, but if they are defined then that is possible,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236 ;; so in that case we accept them all.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
238 ;; If things seem not to be working, you might want to check your
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
239 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240 ;; mixed up view of what these keys should be called.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
242 ;; Canonical names:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
243 (gtk-define-dead-key acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
244 (gtk-define-dead-key grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
245 (gtk-define-dead-key cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
246 (gtk-define-dead-key diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
247 (gtk-define-dead-key circumflex compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
248 (gtk-define-dead-key tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
249 (gtk-define-dead-key degree compose-ring-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
250
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
251 ;; Sun according to MIT:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
252 (gtk-define-dead-key SunFA_Acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253 (gtk-define-dead-key SunFA_Grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254 (gtk-define-dead-key SunFA_Cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
255 (gtk-define-dead-key SunFA_Diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
256 (gtk-define-dead-key SunFA_Circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
257 (gtk-define-dead-key SunFA_Tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
258
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
259 ;; Sun according to OpenWindows 2:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
260 (gtk-define-dead-key Dead_Grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
261 (gtk-define-dead-key Dead_Circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
262 (gtk-define-dead-key Dead_Tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
263
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
264 ;; Sun according to OpenWindows 3:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
265 (gtk-define-dead-key SunXK_FA_Acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
266 (gtk-define-dead-key SunXK_FA_Grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
267 (gtk-define-dead-key SunXK_FA_Cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
268 (gtk-define-dead-key SunXK_FA_Diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
269 (gtk-define-dead-key SunXK_FA_Circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
270 (gtk-define-dead-key SunXK_FA_Tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
271
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
272 ;; DEC according to MIT:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
273 (gtk-define-dead-key Dacute_accent compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
274 (gtk-define-dead-key Dgrave_accent compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
275 (gtk-define-dead-key Dcedilla_accent compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
276 (gtk-define-dead-key Dcircumflex_accent compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
277 (gtk-define-dead-key Dtilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
278 (gtk-define-dead-key Dring_accent compose-ring-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
279
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
280 ;; DEC according to OpenWindows 3:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
281 (gtk-define-dead-key DXK_acute_accent compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
282 (gtk-define-dead-key DXK_grave_accent compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
283 (gtk-define-dead-key DXK_cedilla_accent compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
284 (gtk-define-dead-key DXK_circumflex_accent compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
285 (gtk-define-dead-key DXK_tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
286 (gtk-define-dead-key DXK_ring_accent compose-ring-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
287
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
288 ;; HP according to MIT:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
289 (gtk-define-dead-key hpmute_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
290 (gtk-define-dead-key hpmute_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
291 (gtk-define-dead-key hpmute_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
292 (gtk-define-dead-key hpmute_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
293 (gtk-define-dead-key hpmute_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
294
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
295 ;; Empirically discovered on Linux XFree86 MetroX:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
296 (gtk-define-dead-key usldead_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
297 (gtk-define-dead-key usldead_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
298 (gtk-define-dead-key usldead_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
299 (gtk-define-dead-key usldead_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
300 (gtk-define-dead-key usldead_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
301
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
302 ;; HP according to OpenWindows 3:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
303 (gtk-define-dead-key hpXK_mute_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
304 (gtk-define-dead-key hpXK_mute_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
305 (gtk-define-dead-key hpXK_mute_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
306 (gtk-define-dead-key hpXK_mute_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
307 (gtk-define-dead-key hpXK_mute_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
308
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
309 ;; HP according to HP-UX 8.0:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
310 (gtk-define-dead-key XK_mute_acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
311 (gtk-define-dead-key XK_mute_grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
312 (gtk-define-dead-key XK_mute_diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
313 (gtk-define-dead-key XK_mute_asciicircum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
314 (gtk-define-dead-key XK_mute_asciitilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
315
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
316 ;; Xfree86 seems to use lower case and a hyphen
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
317 (gtk-define-dead-key dead-acute compose-acute-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
318 (gtk-define-dead-key dead-grave compose-grave-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
319 (gtk-define-dead-key dead-cedilla compose-cedilla-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
320 (gtk-define-dead-key dead-diaeresis compose-diaeresis-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
321 (gtk-define-dead-key dead-circum compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
322 (gtk-define-dead-key dead-circumflex compose-circumflex-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
323 (gtk-define-dead-key dead-tilde compose-tilde-map)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
324 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
325
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
326 (when (featurep 'gtk)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
327 (add-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
328 'create-console-hook
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
329 (lambda (console)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
330 (letf (((selected-console) console))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
331 (when (eq 'gtk (console-type console))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
332 (gtk-initialize-compose))))))