annotate lisp/term/w32-win.el @ 95119:f4fdf58a1cea

files.el (project-find-settings-file): Change concat to expand-file-name.
author Michael Olson <mwolson@gnu.org>
date Tue, 20 May 2008 03:15:16 +0000
parents 92723dccd995
children ea2762d2d847
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38431
853c3674f20a Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38241
diff changeset
1 ;;; w32-win.el --- parse switches controlling interface with W32 window system
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
2
74509
f7702c5f335d Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 73490
diff changeset
3 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
79718
f1713f61ee49 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79361
diff changeset
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
5
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6 ;; Author: Kevin Gallo
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7 ;; Keywords: terminals
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
8
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
9 ;; This file is part of GNU Emacs.
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
10
94671
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91507
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94671
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91507
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91507
diff changeset
14 ;; (at your option) any later version.
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
15
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
19 ;; GNU General Public License for more details.
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
20
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 13831
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94671
f3ab0c2464f5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 91507
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
23
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
24 ;;; Commentary:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
25
16889
8de32e992e4d Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16596
diff changeset
26 ;; w32-win.el: this file is loaded from ../lisp/startup.el when it recognizes
8de32e992e4d Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16596
diff changeset
27 ;; that W32 windows are to be used. Command line switches are parsed and those
8de32e992e4d Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16596
diff changeset
28 ;; pertaining to W32 are processed and removed from the command line. The
8de32e992e4d Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16596
diff changeset
29 ;; W32 display is opened and hooks are set for popping up the initial window.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
30
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
31 ;; startup.el will then examine startup files, and eventually call the hooks
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
32 ;; which create the first window (s).
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
33
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
34 ;;; Code:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
35
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
36
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
37 ;; These are the standard X switches from the Xt Initialize.c file of
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
38 ;; Release 4.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
39
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
40 ;; Command line Resource Manager string
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
41
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
42 ;; +rv *reverseVideo
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
43 ;; +synchronous *synchronous
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
44 ;; -background *background
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
45 ;; -bd *borderColor
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
46 ;; -bg *background
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
47 ;; -bordercolor *borderColor
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
48 ;; -borderwidth .borderWidth
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
49 ;; -bw .borderWidth
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
50 ;; -display .display
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
51 ;; -fg *foreground
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
52 ;; -fn *font
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
53 ;; -font *font
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
54 ;; -foreground *foreground
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
55 ;; -geometry .geometry
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
56 ;; -i .iconType
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
57 ;; -itype .iconType
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
58 ;; -iconic .iconic
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
59 ;; -name .name
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
60 ;; -reverse *reverseVideo
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
61 ;; -rv *reverseVideo
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
62 ;; -selectionTimeout .selectionTimeout
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
63 ;; -synchronous *synchronous
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
64 ;; -xrm
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
65
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
66 ;; An alist of X options and the function which handles them. See
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
67 ;; ../startup.el.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
68
83587
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
69 ;; (if (not (eq window-system 'w32))
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
70 ;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
49599
5ade352e8d1c Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49290
diff changeset
71
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
72 (require 'frame)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
73 (require 'mouse)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
74 (require 'scroll-bar)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
75 (require 'faces)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
76 (require 'select)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
77 (require 'menu-bar)
61477
5d9760bd65eb * term/w32-win.el (dnd): Require dnd
Jan Djärv <jan.h.d@swipnet.se>
parents: 59704
diff changeset
78 (require 'dnd)
85500
0dcd1f3c9909 * textmodes/reftex.el: Move require easymenu before first use.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84795
diff changeset
79 (require 'w32-vars)
55467
5410afb1fc03 Require code-pages.
Jason Rumney <jasonr@gnu.org>
parents: 55288
diff changeset
80
84633
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
81 ;; Keep an obsolete alias for w32-focus-frame in case it is used by code
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
82 ;; outside Emacs.
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
83 (define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1")
55467
5410afb1fc03 Require code-pages.
Jason Rumney <jasonr@gnu.org>
parents: 55288
diff changeset
84
65258
c50250830b62 (xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64701
diff changeset
85 (defvar xlfd-regexp-registry-subnum)
85500
0dcd1f3c9909 * textmodes/reftex.el: Move require easymenu before first use.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84795
diff changeset
86 (defvar w32-color-map) ;; defined in w32fns.c
65258
c50250830b62 (xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64701
diff changeset
87
86289
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86277
diff changeset
88 (declare-function w32-send-sys-command "w32fns.c")
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86277
diff changeset
89 (declare-function w32-select-font "w32fns.c")
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86277
diff changeset
90 (declare-function set-message-beep "w32console.c")
65258
c50250830b62 (xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64701
diff changeset
91
42812
c9282c43bb5a Add comments to avoid future deletion of conditionals that seem
Jason Rumney <jasonr@gnu.org>
parents: 42810
diff changeset
92 ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
42810
e0a03741d896 Only require fontset when new-fontset is bound.
Jason Rumney <jasonr@gnu.org>
parents: 42542
diff changeset
93 (if (fboundp 'new-fontset)
e0a03741d896 Only require fontset when new-fontset is bound.
Jason Rumney <jasonr@gnu.org>
parents: 42542
diff changeset
94 (require 'fontset))
15136
6a1b4fcbb216 (win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15048
diff changeset
95
42542
691ca802270d Require fontset unconditionally.
Jason Rumney <jasonr@gnu.org>
parents: 42286
diff changeset
96 ;; The following definition is used for debugging scroll bar events.
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15265
diff changeset
97 ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event))
15136
6a1b4fcbb216 (win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15048
diff changeset
98
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
99 (defun w32-drag-n-drop-debug (event)
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
100 "Print the drag-n-drop EVENT in a readable form."
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
101 (interactive "e")
21883
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
102 (princ event))
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
103
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
104 (defun w32-drag-n-drop (event)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
105 "Edit the files listed in the drag-n-drop EVENT.
21883
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
106 Switch to a buffer editing the last file dropped."
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
107 (interactive "e")
24664
ce51d492b1ab (w32-drag-n-drop): Select file in window where
Andrew Innes <andrewi@gnu.org>
parents: 24246
diff changeset
108 (save-excursion
26573
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
109 ;; Make sure the drop target has positive co-ords
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
110 ;; before setting the selected frame - otherwise it
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
111 ;; won't work. <skx@tardis.ed.ac.uk>
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
112 (let* ((window (posn-window (event-start event)))
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
113 (coords (posn-x-y (event-start event)))
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
114 (x (car coords))
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
115 (y (cdr coords)))
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
116 (if (and (> x 0) (> y 0))
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
117 (set-frame-selected-window nil window))
84795
6aed7b3522e4 * term/w32-win.el (w32-drag-n-drop): Use mapc instead of mapcar.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84633
diff changeset
118 (mapc (lambda (file-name)
70764
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
119 (let ((f (subst-char-in-string ?\\ ?/ file-name))
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
120 (coding (or file-name-coding-system
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
121 default-file-name-coding-system)))
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
122 (setq file-name
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
123 (mapconcat 'url-hexify-string
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
124 (split-string (encode-coding-string f coding)
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
125 "/")
0cfc01cbdd73 (w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 69546
diff changeset
126 "/")))
64701
34bd8e434dd7 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64084
diff changeset
127 (dnd-handle-one-url window 'private
61477
5d9760bd65eb * term/w32-win.el (dnd): Require dnd
Jan Djärv <jan.h.d@swipnet.se>
parents: 59704
diff changeset
128 (concat "file:" file-name)))
55288
e304cb532417 (w32-drag-n-drop): Use x-dnd.el functions.
Jason Rumney <jasonr@gnu.org>
parents: 52401
diff changeset
129 (car (cdr (cdr event)))))
26573
e219195abf40 (w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents: 24964
diff changeset
130 (raise-frame)))
21883
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
131
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
132 (defun w32-drag-n-drop-other-frame (event)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
133 "Edit the files listed in the drag-n-drop EVENT, in other frames.
21883
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
134 May create new frames, or reuse existing ones. The frame editing
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
135 the last file dropped is selected."
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
136 (interactive "e")
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
137 (mapcar 'find-file-other-frame (car (cdr (cdr event)))))
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
138
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
139 ;; Bind the drag-n-drop event.
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
140 (global-set-key [drag-n-drop] 'w32-drag-n-drop)
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
141 (global-set-key [C-drag-n-drop] 'w32-drag-n-drop-other-frame)
93c99b3a57f1 (w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents: 19691
diff changeset
142
23675
8dcfae475b98 ([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents: 23636
diff changeset
143 ;; Keyboard layout/language change events
8dcfae475b98 ([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents: 23636
diff changeset
144 ;; For now ignore language-change events; in the future
8dcfae475b98 ([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents: 23636
diff changeset
145 ;; we should switch the Emacs Input Method to match the
8dcfae475b98 ([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents: 23636
diff changeset
146 ;; new layout/language selected by the user.
8dcfae475b98 ([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents: 23636
diff changeset
147 (global-set-key [language-change] 'ignore)
8dcfae475b98 ([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents: 23636
diff changeset
148
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
149 (defvar x-invocation-args)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
150
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
151 (defvar x-command-line-resources nil)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
152
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
153 (defun x-handle-switch (switch)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
154 "Handle SWITCH of the form \"-switch value\" or \"-switch\"."
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
155 (let ((aelt (assoc switch command-line-x-option-alist)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
156 (if aelt
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
157 (push (cons (nth 3 aelt) (or (nth 4 aelt) (pop x-invocation-args)))
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
158 default-frame-alist))))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
159
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
160 (defun x-handle-numeric-switch (switch)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
161 "Handle SWITCH of the form \"-switch n\"."
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
162 (let ((aelt (assoc switch command-line-x-option-alist)))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
163 (if aelt
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62249
diff changeset
164 (push (cons (nth 3 aelt) (string-to-number (pop x-invocation-args)))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
165 default-frame-alist))))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
166
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
167 ;; Handle options that apply to initial frame only
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
168 (defun x-handle-initial-switch (switch)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
169 (let ((aelt (assoc switch command-line-x-option-alist)))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
170 (if aelt
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
171 (push (cons (nth 3 aelt) (or (nth 4 aelt) (pop x-invocation-args)))
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
172 initial-frame-alist))))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
173
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
174 (defun x-handle-iconic (switch)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
175 "Make \"-iconic\" SWITCH apply only to the initial frame."
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
176 (push '(visibility . icon) initial-frame-alist))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
177
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
178 (defun x-handle-xrm-switch (switch)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
179 "Handle the \"-xrm\" SWITCH."
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
180 (or (consp x-invocation-args)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
181 (error "%s: missing argument to `%s' option" (invocation-name) switch))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
182 (setq x-command-line-resources
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
183 (if (null x-command-line-resources)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
184 (car x-invocation-args)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
185 (concat x-command-line-resources "\n" (car x-invocation-args))))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
186 (setq x-invocation-args (cdr x-invocation-args)))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
187
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
188 (defun x-handle-geometry (switch)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
189 "Handle the \"-geometry\" SWITCH."
42286
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
190 (let* ((geo (x-parse-geometry (car x-invocation-args)))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
191 (left (assq 'left geo))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
192 (top (assq 'top geo))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
193 (height (assq 'height geo))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
194 (width (assq 'width geo)))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
195 (if (or height width)
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
196 (setq default-frame-alist
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
197 (append default-frame-alist
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
198 '((user-size . t))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
199 (if height (list height))
50028
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
200 (if width (list width)))
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
201 initial-frame-alist
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
202 (append initial-frame-alist
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
203 '((user-size . t))
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
204 (if height (list height))
42286
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
205 (if width (list width)))))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
206 (if (or left top)
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
207 (setq initial-frame-alist
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
208 (append initial-frame-alist
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
209 '((user-position . t))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
210 (if left (list left))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
211 (if top (list top)))))
ce0c926022b3 (x-handle-geometry): Put height and width on default-frame-alist,
Richard M. Stallman <rms@gnu.org>
parents: 40151
diff changeset
212 (setq x-invocation-args (cdr x-invocation-args))))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
213
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
214 (defun x-handle-name-switch (switch)
73490
aedc3ce99a17 (x-handle-name-switch): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 70764
diff changeset
215 "Handle the \"-name\" SWITCH."
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
216 ;; Handle the -name option. Set the variable x-resource-name
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
217 ;; to the option's operand; set the name of the initial frame, too.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
218 (or (consp x-invocation-args)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
219 (error "%s: missing argument to `%s' option" (invocation-name) switch))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
220 (setq x-resource-name (pop x-invocation-args))
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
221 (push (cons 'name x-resource-name) initial-frame-alist))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
222
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
223 (defvar x-display-name nil
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
224 "The display name specifying server and frame.")
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
225
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
226 (defun x-handle-display (switch)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
227 "Handle the \"-display\" SWITCH."
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
228 (setq x-display-name (pop x-invocation-args)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
229
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
230 (defun x-handle-args (args)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
231 "Process the X-related command line options in ARGS.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
232 This is done before the user's startup file is loaded. They are copied to
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
233 `x-invocation args' from which the X-related things are extracted, first
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
234 the switch (e.g., \"-fg\") in the following code, and possible values
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
235 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
236 This returns ARGS with the arguments that have been processed removed."
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
237 ;; We use ARGS to accumulate the args that we don't handle here, to return.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
238 (setq x-invocation-args args
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
239 args nil)
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
240 (while (and x-invocation-args
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
241 (not (equal (car x-invocation-args) "--")))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
242 (let* ((this-switch (car x-invocation-args))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
243 (orig-this-switch this-switch)
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
244 completion argval aelt handler)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
245 (setq x-invocation-args (cdr x-invocation-args))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
246 ;; Check for long options with attached arguments
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
247 ;; and separate out the attached option argument into argval.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
248 (if (string-match "^--[^=]*=" this-switch)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
249 (setq argval (substring this-switch (match-end 0))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
250 this-switch (substring this-switch 0 (1- (match-end 0)))))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
251 ;; Complete names of long options.
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
252 (if (string-match "^--" this-switch)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
253 (progn
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
254 (setq completion (try-completion this-switch command-line-x-option-alist))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
255 (if (eq completion t)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
256 ;; Exact match for long option.
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
257 nil
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
258 (if (stringp completion)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
259 (let ((elt (assoc completion command-line-x-option-alist)))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
260 ;; Check for abbreviated long option.
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
261 (or elt
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
262 (error "Option `%s' is ambiguous" this-switch))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
263 (setq this-switch completion))))))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
264 (setq aelt (assoc this-switch command-line-x-option-alist))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
265 (if aelt (setq handler (nth 2 aelt)))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
266 (if handler
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
267 (if argval
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
268 (let ((x-invocation-args
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
269 (cons argval x-invocation-args)))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
270 (funcall handler this-switch))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
271 (funcall handler this-switch))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
272 (push orig-this-switch args))))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
273 (nconc (nreverse args) x-invocation-args))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
274
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
275 ;;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
276 ;; Available colors
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
277 ;;
94849
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
278 ;; The ordering of the colors is chosen for the user's convenience in
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
279 ;; `list-colors-display', which displays the reverse of this list.
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
280 ;; Roughly speaking, `list-colors-display' orders by (i) named shades
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
281 ;; of grey with hue 0.0, sorted by value (ii) named colors with
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
282 ;; saturation 1.0, sorted by hue, (iii) named non-white colors with
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
283 ;; saturation less than 1.0, sorted by hue, (iv) other named shades of
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
284 ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
285 ;; of grey.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
286
94849
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
287 (defvar x-colors
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
288 '("gray100" "gray99" "gray98" "gray97" "gray96" "gray95" "gray94" "gray93" "gray92"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
289 "gray91" "gray90" "gray89" "gray88" "gray87" "gray86" "gray85" "gray84" "gray83"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
290 "gray82" "gray81" "gray80" "gray79" "gray78" "gray77" "gray76" "gray75" "gray74"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
291 "gray73" "gray72" "gray71" "gray70" "gray69" "gray68" "gray67" "gray66" "gray65"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
292 "gray64" "gray63" "gray62" "gray61" "gray60" "gray59" "gray58" "gray57" "gray56"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
293 "gray55" "gray54" "gray53" "gray52" "gray51" "gray50" "gray49" "gray48" "gray47"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
294 "gray46" "gray45" "gray44" "gray43" "gray42" "gray41" "gray40" "gray39" "gray38"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
295 "gray37" "gray36" "gray35" "gray34" "gray33" "gray32" "gray31" "gray30" "gray29"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
296 "gray28" "gray27" "gray26" "gray25" "gray24" "gray23" "gray22" "gray21" "gray20"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
297 "gray19" "gray18" "gray17" "gray16" "gray15" "gray14" "gray13" "gray12" "gray11"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
298 "gray10" "gray9" "gray8" "gray7" "gray6" "gray5" "gray4" "gray3" "gray2" "gray1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
299 "gray0" "LightPink1" "LightPink2" "LightPink3" "LightPink4" "pink1" "pink2" "pink3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
300 "pink4" "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
301 "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" "VioletRed1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
302 "VioletRed2" "VioletRed3" "VioletRed4" "HotPink1" "HotPink2" "HotPink3" "HotPink4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
303 "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" "maroon1" "maroon2" "maroon3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
304 "maroon4" "orchid1" "orchid2" "orchid3" "orchid4" "plum1" "plum2" "plum3" "plum4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
305 "thistle1" "thistle2" "thistle3" "thistle4" "MediumOrchid1" "MediumOrchid2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
306 "MediumOrchid3" "MediumOrchid4" "DarkOrchid1" "DarkOrchid2" "DarkOrchid3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
307 "DarkOrchid4" "purple1" "purple2" "purple3" "purple4" "MediumPurple1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
308 "MediumPurple2" "MediumPurple3" "MediumPurple4" "SlateBlue1" "SlateBlue2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
309 "SlateBlue3" "SlateBlue4" "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
310 "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" "SlateGray1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
311 "SlateGray2" "SlateGray3" "SlateGray4" "DodgerBlue1" "DodgerBlue2" "DodgerBlue3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
312 "DodgerBlue4" "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" "SkyBlue1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
313 "SkyBlue2" "SkyBlue3" "SkyBlue4" "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
314 "LightSkyBlue4" "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" "CadetBlue1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
315 "CadetBlue2" "CadetBlue3" "CadetBlue4" "azure1" "azure2" "azure3" "azure4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
316 "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" "PaleTurquoise1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
317 "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" "DarkSlateGray1" "DarkSlateGray2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
318 "DarkSlateGray3" "DarkSlateGray4" "aquamarine1" "aquamarine2" "aquamarine3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
319 "aquamarine4" "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" "honeydew1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
320 "honeydew2" "honeydew3" "honeydew4" "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
321 "DarkSeaGreen4" "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
322 "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" "OliveDrab1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
323 "OliveDrab2" "OliveDrab3" "OliveDrab4" "ivory1" "ivory2" "ivory3" "ivory4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
324 "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" "khaki1" "khaki2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
325 "khaki3" "khaki4" "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
326 "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" "cornsilk1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
327 "cornsilk2" "cornsilk3" "cornsilk4" "goldenrod1" "goldenrod2" "goldenrod3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
328 "goldenrod4" "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
329 "wheat1" "wheat2" "wheat3" "wheat4" "NavajoWhite1" "NavajoWhite2" "NavajoWhite3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
330 "NavajoWhite4" "burlywood1" "burlywood2" "burlywood3" "burlywood4" "AntiqueWhite1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
331 "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" "bisque1" "bisque2" "bisque3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
332 "bisque4" "tan1" "tan2" "tan3" "tan4" "PeachPuff1" "PeachPuff2" "PeachPuff3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
333 "PeachPuff4" "seashell1" "seashell2" "seashell3" "seashell4" "chocolate1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
334 "chocolate2" "chocolate3" "chocolate4" "sienna1" "sienna2" "sienna3" "sienna4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
335 "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" "salmon1" "salmon2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
336 "salmon3" "salmon4" "coral1" "coral2" "coral3" "coral4" "tomato1" "tomato2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
337 "tomato3" "tomato4" "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" "snow1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
338 "snow2" "snow3" "snow4" "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
339 "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" "firebrick1" "firebrick2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
340 "firebrick3" "firebrick4" "brown1" "brown2" "brown3" "brown4" "magenta1" "magenta2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
341 "magenta3" "magenta4" "blue1" "blue2" "blue3" "blue4" "DeepSkyBlue1" "DeepSkyBlue2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
342 "DeepSkyBlue3" "DeepSkyBlue4" "turquoise1" "turquoise2" "turquoise3" "turquoise4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
343 "cyan1" "cyan2" "cyan3" "cyan4" "SpringGreen1" "SpringGreen2" "SpringGreen3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
344 "SpringGreen4" "green1" "green2" "green3" "green4" "chartreuse1" "chartreuse2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
345 "chartreuse3" "chartreuse4" "yellow1" "yellow2" "yellow3" "yellow4" "gold1" "gold2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
346 "gold3" "gold4" "orange1" "orange2" "orange3" "orange4" "DarkOrange1" "DarkOrange2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
347 "DarkOrange3" "DarkOrange4" "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
348 "red1" "red2" "red3" "red4" "lavender blush" "ghost white" "lavender" "alice blue"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
349 "azure" "light cyan" "mint cream" "honeydew" "ivory" "light goldenrod yellow"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
350 "light yellow" "beige" "floral white" "old lace" "blanched almond" "moccasin"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
351 "papaya whip" "bisque" "antique white" "linen" "peach puff" "seashell" "misty rose"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
352 "snow" "light pink" "pink" "hot pink" "deep pink" "maroon" "pale violet red"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
353 "violet red" "medium violet red" "violet" "plum" "thistle" "orchid" "medium orchid"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
354 "dark orchid" "purple" "blue violet" "medium purple" "light slate blue"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
355 "medium slate blue" "slate blue" "dark slate blue" "midnight blue" "navy"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
356 "dark blue" "light steel blue" "cornflower blue" "dodger blue" "royal blue"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
357 "light slate gray" "slate gray" "dark slate gray" "steel blue" "cadet blue"
94852
92723dccd995 Tweak last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 94849
diff changeset
358 "light sky blue" "sky blue" "light blue" "powder blue" "pale turquoise" "turquoise"
94849
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
359 "medium turquoise" "dark cyan" "aquamarine" "medium aquamarine" "light sea green"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
360 "medium sea green" "sea green" "dark sea green" "pale green" "lime green"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
361 "forest green" "light green" "green yellow" "yellow green" "olive drab"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
362 "dark olive green" "lemon chiffon" "khaki" "dark khaki" "cornsilk"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
363 "pale goldenrod" "light goldenrod" "goldenrod" "dark goldenrod" "wheat"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
364 "navajo white" "tan" "burlywood" "sandy brown" "peru" "chocolate" "saddle brown"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
365 "sienna" "rosy brown" "dark salmon" "coral" "tomato" "light salmon" "salmon"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
366 "light coral" "indian red" "firebrick" "brown" "dark red" "magenta"
94852
92723dccd995 Tweak last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 94849
diff changeset
367 "dark magenta" "dark violet" "medium blue" "blue" "deep sky blue"
94849
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
368 "cyan" "medium spring green" "spring green" "green" "lawn green" "chartreuse"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
369 "yellow" "gold" "orange" "dark orange" "orange red" "red" "white" "white smoke"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
370 "gainsboro" "light grey" "gray" "dark grey" "dim gray" "black" )
38241
c3737c213380 (x-colors): Add colors from the recent rgb.txt file.
Eli Zaretskii <eliz@gnu.org>
parents: 35770
diff changeset
371 "The list of X colors from the `rgb.txt' file.
c3737c213380 (x-colors): Add colors from the recent rgb.txt file.
Eli Zaretskii <eliz@gnu.org>
parents: 35770
diff changeset
372 XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
373
26736
a0674327c167 Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26573
diff changeset
374 (defun xw-defined-colors (&optional frame)
a0674327c167 Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26573
diff changeset
375 "Internal function called by `defined-colors', which see."
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
376 (or frame (setq frame (selected-frame)))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
377 (let ((defined-colors nil))
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
378 (dolist (this-color (or (mapcar 'car w32-color-map) x-colors))
27101
a5791b2ee668 (xw-defined-colors): Call color-supported-p,
Eli Zaretskii <eliz@gnu.org>
parents: 26736
diff changeset
379 (and (color-supported-p this-color frame t)
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
380 (push this-color defined-colors)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
381 defined-colors))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
382
19691
a96c6fa10e92 (w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents: 19167
diff changeset
383
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
384 ;;;; Function keys
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
385
83644
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
386 ;;; make f10 activate the real menubar rather than the mini-buffer menu
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
387 ;;; navigation feature.
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
388 (defun menu-bar-open (&optional frame)
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
389 "Start key navigation of the menu bar in FRAME.
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
390
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
391 This initially activates the first menu-bar item, and you can then navigate
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
392 with the arrow keys, select a menu entry with the Return key or cancel with
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
393 the Escape key. If FRAME has no menu bar, this function does nothing.
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
394
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
395 If FRAME is nil or not given, use the selected frame."
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
396 (interactive "i")
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
397 (w32-send-sys-command ?\xf100 frame))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
398
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
399
23636
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
400 ;; W32 systems have different fonts than commonly found on X, so
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
401 ;; we define our own standard fontset here.
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
402 (defvar w32-standard-fontset-spec
24212
36652d90b38f (w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents: 24142
diff changeset
403 "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard"
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
404 "String of fontset spec of the standard fontset.
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
405 This defines a fontset consisting of the Courier New variations for
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
406 European languages which are distributed with Windows as
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
407 \"Multilanguage Support\".
23636
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
408
73490
aedc3ce99a17 (x-handle-name-switch): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 70764
diff changeset
409 See the documentation of `create-fontset-from-fontset-spec' for the format.")
23636
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
410
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
411 (defun x-win-suspend-error ()
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
412 "Report an error when a suspend is attempted."
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
413 (error "Suspending an Emacs running under W32 makes no sense"))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
414
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
415
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
416 (defun mouse-set-font (&rest fonts)
69545
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
417 "Select an Emacs font from a list of known good fonts and fontsets.
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
418
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
419 If `w32-use-w32-font-dialog' is non-nil (the default), use the Windows
69546
fa6cedf25a5b Fix last change.
Eli Zaretskii <eliz@gnu.org>
parents: 69545
diff changeset
420 font dialog to display the list of possible fonts. Otherwise use a
69545
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
421 pop-up menu (like Emacs does on other platforms) initialized with
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
422 the fonts in `w32-fixed-font-alist'.
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
423 If `w32-list-proportional-fonts' is non-nil, add proportional fonts
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
424 to the list in the font selection dialog (the fonts listed by the
c051e02e3174 (mouse-set-font): Mention w32-list-proportional-fonts in the doc string.
Eli Zaretskii <eliz@gnu.org>
parents: 68357
diff changeset
425 pop-up menu are unaffected by `w32-list-proportional-fonts')."
23560
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
426 (interactive
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
427 (if w32-use-w32-font-dialog
42848
4313f287da4d Move user variables to w32-vars.el and make them defcustoms.
Jason Rumney <jasonr@gnu.org>
parents: 42812
diff changeset
428 (let ((chosen-font (w32-select-font (selected-frame)
4313f287da4d Move user variables to w32-vars.el and make them defcustoms.
Jason Rumney <jasonr@gnu.org>
parents: 42812
diff changeset
429 w32-list-proportional-fonts)))
24964
22d526660026 (mouse-set-font): If user uses w32 dialog but
Karl Heuer <kwzh@gnu.org>
parents: 24686
diff changeset
430 (and chosen-font (list chosen-font)))
23560
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
431 (x-popup-menu
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
432 last-nonmenu-event
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
433 ;; Append list of fontsets currently defined.
42812
c9282c43bb5a Add comments to avoid future deletion of conditionals that seem
Jason Rumney <jasonr@gnu.org>
parents: 42810
diff changeset
434 ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
23636
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
435 (if (fboundp 'new-fontset)
91046
35069180a991 Fix up multi-tty merge
Miles Bader <miles@gnu.org>
parents: 91041
diff changeset
436 (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
23560
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
437 (if fonts
27887
a9f19a6bfb69 (mouse-set-font): Do not build fontset from chosen font.
Jason Rumney <jasonr@gnu.org>
parents: 27832
diff changeset
438 (let (font)
23560
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
439 (while fonts
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
440 (condition-case nil
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
441 (progn
24212
36652d90b38f (w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents: 24142
diff changeset
442 (setq font (car fonts))
27887
a9f19a6bfb69 (mouse-set-font): Do not build fontset from chosen font.
Jason Rumney <jasonr@gnu.org>
parents: 27832
diff changeset
443 (set-default-font font)
24212
36652d90b38f (w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents: 24142
diff changeset
444 (setq fonts nil))
36652d90b38f (w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents: 24142
diff changeset
445 (error (setq fonts (cdr fonts)))))
23560
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
446 (if (null font)
6414b7085648 (w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents: 22539
diff changeset
447 (error "Font not found")))))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
448
56107
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
449 ;;; Set default known names for image libraries
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
450 (setq image-library-alist
79970
e4615708e4e3 (image-library-alist): Prefer libxpm.dll.
Jason Rumney <jasonr@gnu.org>
parents: 79718
diff changeset
451 '((xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll")
79990
4c9e3f8637a0 (image-library-alist): Prefer libpng12 to libpng13, because
Juanma Barranquero <lekktu@gmail.com>
parents: 79970
diff changeset
452 (png "libpng12d.dll" "libpng12.dll" "libpng.dll"
4c9e3f8637a0 (image-library-alist): Prefer libpng12 to libpng13, because
Juanma Barranquero <lekktu@gmail.com>
parents: 79970
diff changeset
453 ;; these are libpng 1.2.8 from GTK+
4c9e3f8637a0 (image-library-alist): Prefer libpng12 to libpng13, because
Juanma Barranquero <lekktu@gmail.com>
parents: 79970
diff changeset
454 "libpng13d.dll" "libpng13.dll")
56107
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
455 (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll")
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
456 (tiff "libtiff3.dll" "libtiff.dll")
84633
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
457 (gif "giflib4.dll" "libungif4.dll" "libungif.dll")
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
458 (svg "librsvg-2-2.dll")
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
459 (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
74f243cb2274 (w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
460 (glib "libglib-2.0-0.dll")))
56107
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
461
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
462 ;;; multi-tty support
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
463 (defvar w32-initialized nil
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
464 "Non-nil if the w32 window system has been initialized.")
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
465
83587
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
466 (defun w32-initialize-window-system ()
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
467 "Initialize Emacs for W32 GUI frames."
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
468
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
469 ;; Do the actual Windows setup here; the above code just defines
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
470 ;; functions and variables that we use now.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
471
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
472 (setq command-line-args (x-handle-args command-line-args))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
473
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
474 ;; Make sure we have a valid resource name.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
475 (or (stringp x-resource-name)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
476 (setq x-resource-name
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
477 ;; Change any . or * characters in x-resource-name to hyphens,
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
478 ;; so as not to choke when we use it in X resource queries.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
479 (replace-regexp-in-string "[.*]" "-" (invocation-name))))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
480
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
481 (x-open-connection "" x-command-line-resources
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
482 ;; Exit with a fatal error if this fails and we
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
483 ;; are the initial display
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
484 (eq initial-window-system 'w32))
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
485
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
486 ;; Setup the default fontset.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
487 (setup-default-fontset)
86000
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
488
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
489 ;; Enable Japanese fonts on Windows to be used by default.
91095
988512d3a552 (w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
490 (set-fontset-font t (make-char 'katakana-jisx0201)
86000
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
491 '("*" . "JISX0208-SJIS"))
91095
988512d3a552 (w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
492 (set-fontset-font t (make-char 'latin-jisx0201)
86000
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
493 '("*" . "JISX0208-SJIS"))
91095
988512d3a552 (w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
494 (set-fontset-font t (make-char 'japanese-jisx0208)
86000
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
495 '("*" . "JISX0208-SJIS"))
91095
988512d3a552 (w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
496 (set-fontset-font t (make-char 'japanese-jisx0208-1978)
86000
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
497 '("*" . "JISX0208-SJIS"))
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
498
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
499 ;; Create the standard fontset.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
500 (create-fontset-from-fontset-spec w32-standard-fontset-spec t)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
501 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...).
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
502 (create-fontset-from-x-resource)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
503
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
504 ;; Apply a geometry resource to the initial frame. Put it at the end
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
505 ;; of the alist, so that anything specified on the command line takes
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
506 ;; precedence.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
507 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
508 parsed)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
509 (if res-geometry
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
510 (progn
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
511 (setq parsed (x-parse-geometry res-geometry))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
512 ;; If the resource specifies a position,
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
513 ;; call the position and size "user-specified".
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
514 (if (or (assq 'top parsed) (assq 'left parsed))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
515 (setq parsed (cons '(user-position . t)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
516 (cons '(user-size . t) parsed))))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
517 ;; All geometry parms apply to the initial frame.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
518 (setq initial-frame-alist (append initial-frame-alist parsed))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
519 ;; The size parms apply to all frames.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
520 (if (assq 'height parsed)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
521 (push (cons 'height (cdr (assq 'height parsed)))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
522 default-frame-alist))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
523 (if (assq 'width parsed)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
524 (push (cons 'width (cdr (assq 'width parsed)))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
525 default-frame-alist)))))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
526
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
527 ;; Check the reverseVideo resource.
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
528 (let ((case-fold-search t))
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
529 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
530 (if (and rv (string-match "^\\(true\\|yes\\|on\\)$" rv))
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
531 (push '(reverse . t) default-frame-alist))))
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
532
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
533 ;; Don't let Emacs suspend under w32 gui
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
534 (add-hook 'suspend-hook 'x-win-suspend-error)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
535
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
536 ;; Turn off window-splitting optimization; w32 is usually fast enough
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
537 ;; that this is only annoying.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
538 (setq split-window-keep-point t)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
539
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
540 ;; Turn on support for mouse wheels
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
541 (mouse-wheel-mode 1)
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
542
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
543 ;; W32 expects the menu bar cut and paste commands to use the clipboard.
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
544 (menu-bar-enable-clipboard)
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
545
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
546 ;; Don't show the frame name; that's redundant.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
547 (setq-default mode-line-frame-identification " ")
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
548
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
549 ;; Set to a system sound if you want a fancy bell.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
550 (set-message-beep 'ok)
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
551 (setq w32-initialized t))
83587
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
552
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
553 (add-to-list 'handle-args-function-alist '(w32 . x-handle-args))
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
554 (add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces))
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
555 (add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system))
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
556
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
557 (provide 'w32-win)
56107
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
558
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
559 ;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166
16889
8de32e992e4d Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16596
diff changeset
560 ;;; w32-win.el ends here