annotate lisp/term/w32-win.el @ 96215:ad9760e68890

(Todo): Update.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 24 Jun 2008 03:24:38 +0000
parents bb82cfdc467f
children 0b232de63205
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
95892
bb82cfdc467f (mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
81 ;; Keep an obsolete alias for w32-focus-frame and w32-select-font in case
bb82cfdc467f (mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
82 ;; they are used by code outside Emacs.
84633
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")
95892
bb82cfdc467f (mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
84 (define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1")
55467
5410afb1fc03 Require code-pages.
Jason Rumney <jasonr@gnu.org>
parents: 55288
diff changeset
85
65258
c50250830b62 (xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64701
diff changeset
86 (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
87 (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
88
86289
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86277
diff changeset
89 (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
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
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
188 (declare-function x-parse-geometry "frame.c" (string))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
189
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
190 (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
191 "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
192 (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
193 (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
194 (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
195 (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
196 (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
197 (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
198 (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
199 (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
200 '((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
201 (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
202 (if width (list width)))
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
203 initial-frame-alist
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
204 (append initial-frame-alist
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
205 '((user-size . t))
601653a63afc (x-handle-geometry): Put sizes on `initial-frame-alist' too.
Juanma Barranquero <lekktu@gmail.com>
parents: 49882
diff changeset
206 (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
207 (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
208 (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
209 (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
210 (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
211 '((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
212 (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
213 (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
214 (setq x-invocation-args (cdr x-invocation-args))))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
215
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
216 (defvar x-resource-name)
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
217
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
218 (defun x-handle-name-switch (switch)
73490
aedc3ce99a17 (x-handle-name-switch): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 70764
diff changeset
219 "Handle the \"-name\" SWITCH."
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
220 ;; 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
221 ;; 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
222 (or (consp x-invocation-args)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
223 (error "%s: missing argument to `%s' option" (invocation-name) switch))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
224 (setq x-resource-name (pop x-invocation-args))
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
225 (push (cons 'name x-resource-name) initial-frame-alist))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
226
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
227 (defvar x-display-name nil
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
228 "The display name specifying server and frame.")
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-display (switch)
29322
16e1a87707b5 Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 27887
diff changeset
231 "Handle the \"-display\" SWITCH."
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
232 (setq x-display-name (pop x-invocation-args)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
233
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
234 (defun x-handle-args (args)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
235 "Process the X-related command line options in ARGS.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
236 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
237 `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
238 the switch (e.g., \"-fg\") in the following code, and possible values
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
239 \(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
240 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
241 ;; 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
242 (setq x-invocation-args args
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
243 args nil)
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
244 (while (and x-invocation-args
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
245 (not (equal (car x-invocation-args) "--")))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
246 (let* ((this-switch (car x-invocation-args))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
247 (orig-this-switch this-switch)
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
248 completion argval aelt handler)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
249 (setq x-invocation-args (cdr x-invocation-args))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
250 ;; Check for long options with attached arguments
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
251 ;; and separate out the attached option argument into argval.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
252 (if (string-match "^--[^=]*=" this-switch)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
253 (setq argval (substring this-switch (match-end 0))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
254 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
255 ;; Complete names of long options.
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
256 (if (string-match "^--" this-switch)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
257 (progn
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
258 (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
259 (if (eq completion t)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
260 ;; Exact match for long option.
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
261 nil
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
262 (if (stringp completion)
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
263 (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
264 ;; Check for abbreviated long option.
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
265 (or elt
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
266 (error "Option `%s' is ambiguous" this-switch))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
267 (setq this-switch completion))))))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
268 (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
269 (if aelt (setq handler (nth 2 aelt)))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
270 (if handler
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
271 (if argval
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
272 (let ((x-invocation-args
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
273 (cons argval x-invocation-args)))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
274 (funcall handler this-switch))
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
275 (funcall handler this-switch))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
276 (push orig-this-switch args))))
43394
bf151fa5d915 (x-option-alist, x-long-option-alist)
Jason Rumney <jasonr@gnu.org>
parents: 42848
diff changeset
277 (nconc (nreverse args) x-invocation-args))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
278
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
279 ;;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
280 ;; Available colors
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
281 ;;
94849
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
282 ;; 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
283 ;; `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
284 ;; 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
285 ;; 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
286 ;; 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
287 ;; 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
288 ;; 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
289 ;; of grey.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
290
94849
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
291 (defvar x-colors
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
292 '("gray100" "gray99" "gray98" "gray97" "gray96" "gray95" "gray94" "gray93" "gray92"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
293 "gray91" "gray90" "gray89" "gray88" "gray87" "gray86" "gray85" "gray84" "gray83"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
294 "gray82" "gray81" "gray80" "gray79" "gray78" "gray77" "gray76" "gray75" "gray74"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
295 "gray73" "gray72" "gray71" "gray70" "gray69" "gray68" "gray67" "gray66" "gray65"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
296 "gray64" "gray63" "gray62" "gray61" "gray60" "gray59" "gray58" "gray57" "gray56"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
297 "gray55" "gray54" "gray53" "gray52" "gray51" "gray50" "gray49" "gray48" "gray47"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
298 "gray46" "gray45" "gray44" "gray43" "gray42" "gray41" "gray40" "gray39" "gray38"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
299 "gray37" "gray36" "gray35" "gray34" "gray33" "gray32" "gray31" "gray30" "gray29"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
300 "gray28" "gray27" "gray26" "gray25" "gray24" "gray23" "gray22" "gray21" "gray20"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
301 "gray19" "gray18" "gray17" "gray16" "gray15" "gray14" "gray13" "gray12" "gray11"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
302 "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
303 "gray0" "LightPink1" "LightPink2" "LightPink3" "LightPink4" "pink1" "pink2" "pink3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
304 "pink4" "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
305 "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" "VioletRed1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
306 "VioletRed2" "VioletRed3" "VioletRed4" "HotPink1" "HotPink2" "HotPink3" "HotPink4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
307 "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" "maroon1" "maroon2" "maroon3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
308 "maroon4" "orchid1" "orchid2" "orchid3" "orchid4" "plum1" "plum2" "plum3" "plum4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
309 "thistle1" "thistle2" "thistle3" "thistle4" "MediumOrchid1" "MediumOrchid2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
310 "MediumOrchid3" "MediumOrchid4" "DarkOrchid1" "DarkOrchid2" "DarkOrchid3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
311 "DarkOrchid4" "purple1" "purple2" "purple3" "purple4" "MediumPurple1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
312 "MediumPurple2" "MediumPurple3" "MediumPurple4" "SlateBlue1" "SlateBlue2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
313 "SlateBlue3" "SlateBlue4" "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
314 "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" "SlateGray1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
315 "SlateGray2" "SlateGray3" "SlateGray4" "DodgerBlue1" "DodgerBlue2" "DodgerBlue3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
316 "DodgerBlue4" "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" "SkyBlue1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
317 "SkyBlue2" "SkyBlue3" "SkyBlue4" "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
318 "LightSkyBlue4" "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" "CadetBlue1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
319 "CadetBlue2" "CadetBlue3" "CadetBlue4" "azure1" "azure2" "azure3" "azure4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
320 "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" "PaleTurquoise1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
321 "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" "DarkSlateGray1" "DarkSlateGray2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
322 "DarkSlateGray3" "DarkSlateGray4" "aquamarine1" "aquamarine2" "aquamarine3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
323 "aquamarine4" "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" "honeydew1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
324 "honeydew2" "honeydew3" "honeydew4" "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
325 "DarkSeaGreen4" "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
326 "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" "OliveDrab1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
327 "OliveDrab2" "OliveDrab3" "OliveDrab4" "ivory1" "ivory2" "ivory3" "ivory4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
328 "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" "khaki1" "khaki2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
329 "khaki3" "khaki4" "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
330 "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" "cornsilk1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
331 "cornsilk2" "cornsilk3" "cornsilk4" "goldenrod1" "goldenrod2" "goldenrod3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
332 "goldenrod4" "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
333 "wheat1" "wheat2" "wheat3" "wheat4" "NavajoWhite1" "NavajoWhite2" "NavajoWhite3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
334 "NavajoWhite4" "burlywood1" "burlywood2" "burlywood3" "burlywood4" "AntiqueWhite1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
335 "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" "bisque1" "bisque2" "bisque3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
336 "bisque4" "tan1" "tan2" "tan3" "tan4" "PeachPuff1" "PeachPuff2" "PeachPuff3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
337 "PeachPuff4" "seashell1" "seashell2" "seashell3" "seashell4" "chocolate1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
338 "chocolate2" "chocolate3" "chocolate4" "sienna1" "sienna2" "sienna3" "sienna4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
339 "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" "salmon1" "salmon2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
340 "salmon3" "salmon4" "coral1" "coral2" "coral3" "coral4" "tomato1" "tomato2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
341 "tomato3" "tomato4" "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" "snow1"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
342 "snow2" "snow3" "snow4" "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
343 "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" "firebrick1" "firebrick2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
344 "firebrick3" "firebrick4" "brown1" "brown2" "brown3" "brown4" "magenta1" "magenta2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
345 "magenta3" "magenta4" "blue1" "blue2" "blue3" "blue4" "DeepSkyBlue1" "DeepSkyBlue2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
346 "DeepSkyBlue3" "DeepSkyBlue4" "turquoise1" "turquoise2" "turquoise3" "turquoise4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
347 "cyan1" "cyan2" "cyan3" "cyan4" "SpringGreen1" "SpringGreen2" "SpringGreen3"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
348 "SpringGreen4" "green1" "green2" "green3" "green4" "chartreuse1" "chartreuse2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
349 "chartreuse3" "chartreuse4" "yellow1" "yellow2" "yellow3" "yellow4" "gold1" "gold2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
350 "gold3" "gold4" "orange1" "orange2" "orange3" "orange4" "DarkOrange1" "DarkOrange2"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
351 "DarkOrange3" "DarkOrange4" "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
352 "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
353 "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
354 "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
355 "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
356 "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
357 "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
358 "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
359 "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
360 "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
361 "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
362 "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
363 "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
364 "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
365 "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
366 "dark olive green" "lemon chiffon" "khaki" "dark khaki" "cornsilk"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
367 "pale goldenrod" "light goldenrod" "goldenrod" "dark goldenrod" "wheat"
53bd8df0faed (x-colors): Re-order colors.
Chong Yidong <cyd@stupidchicken.com>
parents: 94671
diff changeset
368 "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
369 "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
370 "light coral" "indian red" "firebrick" "brown" "dark red" "magenta"
94852
92723dccd995 Tweak last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 94849
diff changeset
371 "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
372 "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
373 "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
374 "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
375 "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
376 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
377
26736
a0674327c167 Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26573
diff changeset
378 (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
379 "Internal function called by `defined-colors', which see."
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
380 (or frame (setq frame (selected-frame)))
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
381 (let ((defined-colors nil))
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
382 (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
383 (and (color-supported-p this-color frame t)
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
384 (push this-color defined-colors)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
385 defined-colors))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
386
19691
a96c6fa10e92 (w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents: 19167
diff changeset
387
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
388 ;;;; Function keys
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
389
83644
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
390 ;;; 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
391 ;;; navigation feature.
95804
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
392 (defun w32-menu-bar-open (&optional frame)
83644
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
393 "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
394
95804
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
395 This initially activates the first menu-bar item, and you can then navigate
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
396 with the arrow keys, select a menu entry with the Return key or cancel with
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
397 the Escape key. If FRAME has no menu bar, this function does nothing.
83644
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
398
95804
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
399 If FRAME is nil or not given, use the selected frame.
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
400 If FRAME does not have the menu bar enabled, display a text menu using
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
401 `tmm-menubar'."
83644
0ece58f6e0aa Merge from emacs--devo--0
Miles Bader <miles@gnu.org>
parents: 83614 78078
diff changeset
402 (interactive "i")
95804
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
403 (if menu-bar-mode
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
404 (w32-send-sys-command ?\xf100 frame)
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
405 (with-selected-frame (or frame (selected-frame))
ea2762d2d847 * term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents: 94852
diff changeset
406 (tmm-menubar))))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
407
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
408
23636
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
409 ;; 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
410 ;; we define our own standard fontset here.
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
411 (defvar w32-standard-fontset-spec
24212
36652d90b38f (w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents: 24142
diff changeset
412 "-*-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
413 "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
414 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
415 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
416 \"Multilanguage Support\".
23636
3246160c5469 (x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents: 23625
diff changeset
417
73490
aedc3ce99a17 (x-handle-name-switch): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 70764
diff changeset
418 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
419
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
420 (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
421 "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
422 (error "Suspending an Emacs running under W32 makes no sense"))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
423
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
424 (defvar image-library-alist)
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
425
56107
a5bfa1a26af3 (image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents: 55467
diff changeset
426 ;;; 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
427 (setq image-library-alist
79970
e4615708e4e3 (image-library-alist): Prefer libxpm.dll.
Jason Rumney <jasonr@gnu.org>
parents: 79718
diff changeset
428 '((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
429 (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
430 ;; 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
431 "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
432 (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
433 (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
434 (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
435 (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
436 (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
437 (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
438
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
439 ;;; multi-tty support
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
440 (defvar w32-initialized nil
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
441 "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
442
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
443 (declare-function x-open-connection "w32fns.c"
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
444 (display &optional xrm-string must-succeed))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
445
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
446 (declare-function setup-default-fontset "fontset" ())
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
447 (declare-function set-fontset-font "fontset.c"
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
448 (name target font-spec &optional frame add))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
449 (declare-function setup-default-fontset "fontset" ())
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
450 (declare-function create-fontset-from-fontset-spec "fontset"
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
451 (fontset-spec &optional style-variant noerror))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
452 (declare-function create-fontset-from-x-resource "fontset" ())
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
453 (declare-function x-get-resource "frame.c"
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
454 (attribute class &optional component subclass))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 95804
diff changeset
455
83587
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
456 (defun w32-initialize-window-system ()
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
457 "Initialize Emacs for W32 GUI frames."
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
458
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
459 ;; 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
460 ;; functions and variables that we use now.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
461
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
462 (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
463
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
464 ;; Make sure we have a valid resource name.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
465 (or (stringp x-resource-name)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
466 (setq x-resource-name
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
467 ;; 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
468 ;; 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
469 (replace-regexp-in-string "[.*]" "-" (invocation-name))))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
470
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
471 (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
472 ;; 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
473 ;; are the initial display
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
474 (eq initial-window-system 'w32))
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
475
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
476 ;; Setup the default fontset.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
477 (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
478
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
479 ;; 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
480 (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
481 '("*" . "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
482 (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
483 '("*" . "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
484 (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
485 '("*" . "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
486 (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
487 '("*" . "JISX0208-SJIS"))
9ffd7a9238e9 (w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents: 85500
diff changeset
488
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
489 ;; Create the standard fontset.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
490 (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
491 ;; 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
492 (create-fontset-from-x-resource)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
493
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
494 ;; 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
495 ;; 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
496 ;; precedence.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
497 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
498 parsed)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
499 (if res-geometry
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
500 (progn
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
501 (setq parsed (x-parse-geometry res-geometry))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
502 ;; If the resource specifies a position,
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
503 ;; call the position and size "user-specified".
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
504 (if (or (assq 'top parsed) (assq 'left parsed))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
505 (setq parsed (cons '(user-position . t)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
506 (cons '(user-size . t) parsed))))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
507 ;; All geometry parms apply to the initial frame.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
508 (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
509 ;; The size parms apply to all frames.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
510 (if (assq 'height parsed)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
511 (push (cons 'height (cdr (assq 'height parsed)))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
512 default-frame-alist))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
513 (if (assq 'width parsed)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
514 (push (cons 'width (cdr (assq 'width parsed)))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
515 default-frame-alist)))))
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
516
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
517 ;; Check the reverseVideo resource.
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
518 (let ((case-fold-search t))
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
519 (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
520 (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
521 (push '(reverse . t) default-frame-alist))))
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
522
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
523 ;; 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
524 (add-hook 'suspend-hook 'x-win-suspend-error)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
525
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
526 ;; 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
527 ;; that this is only annoying.
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
528 (setq split-window-keep-point t)
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
529
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
530 ;; Turn on support for mouse wheels
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
531 (mouse-wheel-mode 1)
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 ;; 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
534 (menu-bar-enable-clipboard)
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
535
83598
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
536 ;; 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
537 (setq-default mode-line-frame-identification " ")
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
538
9ebefb43d02d (x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents: 83587
diff changeset
539 ;; 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
540 (set-message-beep 'ok)
83605
117c33233c18 Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents: 83598
diff changeset
541 (setq w32-initialized t))
83587
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
542
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
543 (add-to-list 'handle-args-function-alist '(w32 . x-handle-args))
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
544 (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
545 (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
546
6046e2e69b86 Provide w32-win.
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
547 (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
548
59704
a53730244ba3 Simplify code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 59691
diff changeset
549 ;; 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
550 ;;; w32-win.el ends here