Mercurial > emacs
annotate lisp/term/w32-win.el @ 22308:87366acfb1e9
(which-func-ff-hook): If imenu gets error,
clear which-func-mode.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 01 Jun 1998 03:09:43 +0000 |
parents | 93c99b3a57f1 |
children | 45ccce07729d |
rev | line source |
---|---|
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
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 |
13434 | 3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. |
4 | |
5 ;; Author: Kevin Gallo | |
6 ;; Keywords: terminals | |
7 | |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
9 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
10 ;; GNU Emacs is free software; you can redistribute it and/or modify |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
13 ;; any later version. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
14 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
15 ;; 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
|
16 ;; 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
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
18 ;; GNU General Public License for more details. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
19 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
23 ;; Boston, MA 02111-1307, USA. |
13434 | 24 |
25 ;;; Commentary: | |
26 | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
27 ;; 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
|
28 ;; 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
|
29 ;; 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
|
30 ;; W32 display is opened and hooks are set for popping up the initial window. |
13434 | 31 |
32 ;; startup.el will then examine startup files, and eventually call the hooks | |
33 ;; which create the first window (s). | |
34 | |
35 ;;; Code: | |
36 | |
37 | |
38 ;; These are the standard X switches from the Xt Initialize.c file of | |
39 ;; Release 4. | |
40 | |
41 ;; Command line Resource Manager string | |
42 | |
43 ;; +rv *reverseVideo | |
44 ;; +synchronous *synchronous | |
45 ;; -background *background | |
46 ;; -bd *borderColor | |
47 ;; -bg *background | |
48 ;; -bordercolor *borderColor | |
49 ;; -borderwidth .borderWidth | |
50 ;; -bw .borderWidth | |
51 ;; -display .display | |
52 ;; -fg *foreground | |
53 ;; -fn *font | |
54 ;; -font *font | |
55 ;; -foreground *foreground | |
56 ;; -geometry .geometry | |
57 ;; -i .iconType | |
58 ;; -itype .iconType | |
59 ;; -iconic .iconic | |
60 ;; -name .name | |
61 ;; -reverse *reverseVideo | |
62 ;; -rv *reverseVideo | |
63 ;; -selectionTimeout .selectionTimeout | |
64 ;; -synchronous *synchronous | |
65 ;; -xrm | |
66 | |
67 ;; An alist of X options and the function which handles them. See | |
68 ;; ../startup.el. | |
69 | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
70 (if (not (eq window-system 'w32)) |
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
71 (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) |
13434 | 72 |
73 (require 'frame) | |
74 (require 'mouse) | |
75 (require 'scroll-bar) | |
76 (require 'faces) | |
77 (require 'select) | |
78 (require 'menu-bar) | |
79 | |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
80 ;; Because Windows scrollbars look and act quite differently compared |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
81 ;; with the standard X scroll-bars, we don't try to use the normal |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
82 ;; scroll bar routines. |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
83 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
84 (defun w32-handle-scroll-bar-event (event) |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
85 "Handle W32 scroll bar events to do normal Window style scrolling." |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
86 (interactive "e") |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
87 (let ((old-window (selected-window))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
88 (unwind-protect |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
89 (let* ((position (event-start event)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
90 (window (nth 0 position)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
91 (portion-whole (nth 2 position)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
92 (bar-part (nth 4 position))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
93 (save-excursion |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
94 (select-window window) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
95 (cond |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
96 ((eq bar-part 'up) |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
97 (goto-char (window-start window)) |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
98 (scroll-down 1)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
99 ((eq bar-part 'above-handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
100 (scroll-down)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
101 ((eq bar-part 'handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
102 (scroll-bar-maybe-set-window-start event)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
103 ((eq bar-part 'below-handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
104 (scroll-up)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
105 ((eq bar-part 'down) |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
106 (goto-char (window-start window)) |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
107 (scroll-up 1)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
108 ))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
109 (select-window old-window)))) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
110 |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
111 ;; The following definition is used for debugging. |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
112 ;(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
|
113 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
114 (global-set-key [vertical-scroll-bar mouse-1] 'w32-handle-scroll-bar-event) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
115 |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
116 ;; (scroll-bar-mode nil) |
13831
2b90a48bb3db
Disable scrollbars until fully functional.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13434
diff
changeset
|
117 |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
118 (defvar mouse-wheel-scroll-amount 4 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
119 "*Number of lines to scroll per click of the mouse wheel.") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
120 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
121 (defun mouse-wheel-scroll-line (event) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
122 "Scroll the current buffer by `mouse-wheel-scroll-amount'." |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
123 (interactive "e") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
124 (condition-case nil |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
125 (if (< (car (cdr (cdr event))) 0) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
126 (scroll-up mouse-wheel-scroll-amount) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
127 (scroll-down mouse-wheel-scroll-amount)) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
128 (error nil))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
129 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
130 ;; for scroll-in-place.el, this way the -scroll-line and -scroll-screen |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
131 ;; commands won't interact |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
132 (setq scroll-command-groups (list '(mouse-wheel-scroll-line))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
133 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
134 (defun mouse-wheel-scroll-screen (event) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
135 "Scroll the current buffer by `mouse-wheel-scroll-amount'." |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
136 (interactive "e") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
137 (condition-case nil |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
138 (if (< (car (cdr (cdr event))) 0) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
139 (scroll-up) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
140 (scroll-down)) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
141 (error nil))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
142 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
143 ;; Bind the mouse-wheel event: |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
144 (global-set-key [mouse-wheel] 'mouse-wheel-scroll-line) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
145 (global-set-key [C-mouse-wheel] 'mouse-wheel-scroll-screen) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
146 |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
147 (defun w32-drag-n-drop-debug (event) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
148 "Print the drag-n-drop event in a readable form." |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
149 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
150 (princ event)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
151 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
152 (defun w32-drag-n-drop (event) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
153 "Edit the files listed in 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
|
154 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
|
155 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
156 (mapcar 'find-file (car (cdr (cdr event)))) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
157 (raise-frame)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
158 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
159 (defun w32-drag-n-drop-other-frame (event) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
160 "Edit the files listed in the drag-n-drop event, in other frames. |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
161 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
|
162 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
|
163 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
164 (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
|
165 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
166 ;; 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
|
167 (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
|
168 (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
|
169 |
13434 | 170 (defvar x-invocation-args) |
171 | |
172 (defvar x-command-line-resources nil) | |
173 | |
174 (defconst x-option-alist | |
175 '(("-bw" . x-handle-numeric-switch) | |
176 ("-d" . x-handle-display) | |
177 ("-display" . x-handle-display) | |
178 ("-name" . x-handle-name-rn-switch) | |
179 ("-rn" . x-handle-name-rn-switch) | |
180 ("-T" . x-handle-switch) | |
181 ("-r" . x-handle-switch) | |
182 ("-rv" . x-handle-switch) | |
183 ("-reverse" . x-handle-switch) | |
184 ("-fn" . x-handle-switch) | |
185 ("-font" . x-handle-switch) | |
186 ("-ib" . x-handle-numeric-switch) | |
187 ("-g" . x-handle-geometry) | |
188 ("-geometry" . x-handle-geometry) | |
189 ("-fg" . x-handle-switch) | |
190 ("-foreground". x-handle-switch) | |
191 ("-bg" . x-handle-switch) | |
192 ("-background". x-handle-switch) | |
193 ("-ms" . x-handle-switch) | |
194 ("-itype" . x-handle-switch) | |
195 ("-i" . x-handle-switch) | |
196 ("-iconic" . x-handle-iconic) | |
197 ("-xrm" . x-handle-xrm-switch) | |
198 ("-cr" . x-handle-switch) | |
199 ("-vb" . x-handle-switch) | |
200 ("-hb" . x-handle-switch) | |
201 ("-bd" . x-handle-switch))) | |
202 | |
203 (defconst x-long-option-alist | |
204 '(("--border-width" . "-bw") | |
205 ("--display" . "-d") | |
206 ("--name" . "-name") | |
207 ("--title" . "-T") | |
208 ("--reverse-video" . "-reverse") | |
209 ("--font" . "-font") | |
210 ("--internal-border" . "-ib") | |
211 ("--geometry" . "-geometry") | |
212 ("--foreground-color" . "-fg") | |
213 ("--background-color" . "-bg") | |
214 ("--mouse-color" . "-ms") | |
215 ("--icon-type" . "-itype") | |
216 ("--iconic" . "-iconic") | |
217 ("--xrm" . "-xrm") | |
218 ("--cursor-color" . "-cr") | |
219 ("--vertical-scroll-bars" . "-vb") | |
220 ("--border-color" . "-bd"))) | |
221 | |
222 (defconst x-switch-definitions | |
223 '(("-name" name) | |
224 ("-T" name) | |
225 ("-r" reverse t) | |
226 ("-rv" reverse t) | |
227 ("-reverse" reverse t) | |
228 ("-fn" font) | |
229 ("-font" font) | |
230 ("-ib" internal-border-width) | |
231 ("-fg" foreground-color) | |
232 ("-foreground" foreground-color) | |
233 ("-bg" background-color) | |
234 ("-background" background-color) | |
235 ("-ms" mouse-color) | |
236 ("-cr" cursor-color) | |
237 ("-itype" icon-type t) | |
238 ("-i" icon-type t) | |
239 ("-vb" vertical-scroll-bars t) | |
240 ("-hb" horizontal-scroll-bars t) | |
241 ("-bd" border-color) | |
242 ("-bw" border-width))) | |
243 | |
244 ;; Handler for switches of the form "-switch value" or "-switch". | |
245 (defun x-handle-switch (switch) | |
246 (let ((aelt (assoc switch x-switch-definitions))) | |
247 (if aelt | |
248 (if (nth 2 aelt) | |
249 (setq default-frame-alist | |
250 (cons (cons (nth 1 aelt) (nth 2 aelt)) | |
251 default-frame-alist)) | |
252 (setq default-frame-alist | |
253 (cons (cons (nth 1 aelt) | |
254 (car x-invocation-args)) | |
255 default-frame-alist) | |
256 x-invocation-args (cdr x-invocation-args)))))) | |
257 | |
258 ;; Make -iconic apply only to the initial frame! | |
259 (defun x-handle-iconic (switch) | |
260 (setq initial-frame-alist | |
261 (cons '(visibility . icon) initial-frame-alist))) | |
262 | |
263 ;; Handler for switches of the form "-switch n" | |
264 (defun x-handle-numeric-switch (switch) | |
265 (let ((aelt (assoc switch x-switch-definitions))) | |
266 (if aelt | |
267 (setq default-frame-alist | |
268 (cons (cons (nth 1 aelt) | |
269 (string-to-int (car x-invocation-args))) | |
270 default-frame-alist) | |
271 x-invocation-args | |
272 (cdr x-invocation-args))))) | |
273 | |
274 ;; Handle the -xrm option. | |
275 (defun x-handle-xrm-switch (switch) | |
276 (or (consp x-invocation-args) | |
277 (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
278 (setq x-command-line-resources (car x-invocation-args)) | |
279 (setq x-invocation-args (cdr x-invocation-args))) | |
280 | |
281 ;; Handle the geometry option | |
282 (defun x-handle-geometry (switch) | |
283 (let ((geo (x-parse-geometry (car x-invocation-args)))) | |
284 (setq initial-frame-alist | |
285 (append initial-frame-alist | |
286 (if (or (assq 'left geo) (assq 'top geo)) | |
287 '((user-position . t))) | |
288 (if (or (assq 'height geo) (assq 'width geo)) | |
289 '((user-size . t))) | |
290 geo) | |
291 x-invocation-args (cdr x-invocation-args)))) | |
292 | |
293 ;; Handle the -name and -rn options. Set the variable x-resource-name | |
294 ;; to the option's operand; if the switch was `-name', set the name of | |
295 ;; the initial frame, too. | |
296 (defun x-handle-name-rn-switch (switch) | |
297 (or (consp x-invocation-args) | |
298 (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
299 (setq x-resource-name (car x-invocation-args) | |
300 x-invocation-args (cdr x-invocation-args)) | |
301 (if (string= switch "-name") | |
302 (setq initial-frame-alist (cons (cons 'name x-resource-name) | |
303 initial-frame-alist)))) | |
304 | |
305 (defvar x-display-name nil | |
306 "The display name specifying server and frame.") | |
307 | |
308 (defun x-handle-display (switch) | |
309 (setq x-display-name (car x-invocation-args) | |
310 x-invocation-args (cdr x-invocation-args))) | |
311 | |
312 (defvar x-invocation-args nil) | |
313 | |
314 (defun x-handle-args (args) | |
315 "Process the X-related command line options in ARGS. | |
316 This is done before the user's startup file is loaded. They are copied to | |
317 x-invocation args from which the X-related things are extracted, first | |
318 the switch (e.g., \"-fg\") in the following code, and possible values | |
319 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). | |
320 This returns ARGS with the arguments that have been processed removed." | |
321 (message "%s" args) | |
322 (setq x-invocation-args args | |
323 args nil) | |
324 (while x-invocation-args | |
325 (let* ((this-switch (car x-invocation-args)) | |
326 (orig-this-switch this-switch) | |
327 completion argval aelt) | |
328 (setq x-invocation-args (cdr x-invocation-args)) | |
329 ;; Check for long options with attached arguments | |
330 ;; and separate out the attached option argument into argval. | |
331 (if (string-match "^--[^=]*=" this-switch) | |
332 (setq argval (substring this-switch (match-end 0)) | |
333 this-switch (substring this-switch 0 (1- (match-end 0))))) | |
334 (setq completion (try-completion this-switch x-long-option-alist)) | |
335 (if (eq completion t) | |
336 ;; Exact match for long option. | |
337 (setq this-switch (cdr (assoc this-switch x-long-option-alist))) | |
338 (if (stringp completion) | |
339 (let ((elt (assoc completion x-long-option-alist))) | |
340 ;; Check for abbreviated long option. | |
341 (or elt | |
342 (error "Option `%s' is ambiguous" this-switch)) | |
343 (setq this-switch (cdr elt))) | |
344 ;; Check for a short option. | |
345 (setq argval nil this-switch orig-this-switch))) | |
346 (setq aelt (assoc this-switch x-option-alist)) | |
347 (if aelt | |
348 (if argval | |
349 (let ((x-invocation-args | |
350 (cons argval x-invocation-args))) | |
351 (funcall (cdr aelt) this-switch)) | |
352 (funcall (cdr aelt) this-switch)) | |
353 (setq args (cons this-switch args))))) | |
354 (setq args (nreverse args))) | |
355 | |
356 | |
357 | |
358 ;; | |
359 ;; Available colors | |
360 ;; | |
361 | |
362 (defvar x-colors '("aquamarine" | |
363 "Aquamarine" | |
364 "medium aquamarine" | |
365 "MediumAquamarine" | |
366 "black" | |
367 "Black" | |
368 "blue" | |
369 "Blue" | |
370 "cadet blue" | |
371 "CadetBlue" | |
372 "cornflower blue" | |
373 "CornflowerBlue" | |
374 "dark slate blue" | |
375 "DarkSlateBlue" | |
376 "light blue" | |
377 "LightBlue" | |
378 "light steel blue" | |
379 "LightSteelBlue" | |
380 "medium blue" | |
381 "MediumBlue" | |
382 "medium slate blue" | |
383 "MediumSlateBlue" | |
384 "midnight blue" | |
385 "MidnightBlue" | |
386 "navy blue" | |
387 "NavyBlue" | |
388 "navy" | |
389 "Navy" | |
390 "sky blue" | |
391 "SkyBlue" | |
392 "slate blue" | |
393 "SlateBlue" | |
394 "steel blue" | |
395 "SteelBlue" | |
396 "coral" | |
397 "Coral" | |
398 "cyan" | |
399 "Cyan" | |
400 "firebrick" | |
401 "Firebrick" | |
402 "brown" | |
403 "Brown" | |
404 "gold" | |
405 "Gold" | |
406 "goldenrod" | |
407 "Goldenrod" | |
408 "green" | |
409 "Green" | |
410 "dark green" | |
411 "DarkGreen" | |
412 "dark olive green" | |
413 "DarkOliveGreen" | |
414 "forest green" | |
415 "ForestGreen" | |
416 "lime green" | |
417 "LimeGreen" | |
418 "medium sea green" | |
419 "MediumSeaGreen" | |
420 "medium spring green" | |
421 "MediumSpringGreen" | |
422 "pale green" | |
423 "PaleGreen" | |
424 "sea green" | |
425 "SeaGreen" | |
426 "spring green" | |
427 "SpringGreen" | |
428 "yellow green" | |
429 "YellowGreen" | |
430 "dark slate grey" | |
431 "DarkSlateGrey" | |
432 "dark slate gray" | |
433 "DarkSlateGray" | |
434 "dim grey" | |
435 "DimGrey" | |
436 "dim gray" | |
437 "DimGray" | |
438 "light grey" | |
439 "LightGrey" | |
440 "light gray" | |
441 "LightGray" | |
442 "gray" | |
443 "grey" | |
444 "Gray" | |
445 "Grey" | |
446 "khaki" | |
447 "Khaki" | |
448 "magenta" | |
449 "Magenta" | |
450 "maroon" | |
451 "Maroon" | |
452 "orange" | |
453 "Orange" | |
454 "orchid" | |
455 "Orchid" | |
456 "dark orchid" | |
457 "DarkOrchid" | |
458 "medium orchid" | |
459 "MediumOrchid" | |
460 "pink" | |
461 "Pink" | |
462 "plum" | |
463 "Plum" | |
464 "red" | |
465 "Red" | |
466 "indian red" | |
467 "IndianRed" | |
468 "medium violet red" | |
469 "MediumVioletRed" | |
470 "orange red" | |
471 "OrangeRed" | |
472 "violet red" | |
473 "VioletRed" | |
474 "salmon" | |
475 "Salmon" | |
476 "sienna" | |
477 "Sienna" | |
478 "tan" | |
479 "Tan" | |
480 "thistle" | |
481 "Thistle" | |
482 "turquoise" | |
483 "Turquoise" | |
484 "dark turquoise" | |
485 "DarkTurquoise" | |
486 "medium turquoise" | |
487 "MediumTurquoise" | |
488 "violet" | |
489 "Violet" | |
490 "blue violet" | |
491 "BlueViolet" | |
492 "wheat" | |
493 "Wheat" | |
494 "white" | |
495 "White" | |
496 "yellow" | |
497 "Yellow" | |
498 "green yellow" | |
499 "GreenYellow") | |
500 "The full list of X colors from the `rgb.text' file.") | |
501 | |
502 (defun x-defined-colors (&optional frame) | |
503 "Return a list of colors supported for a particular frame. | |
504 The argument FRAME specifies which frame to try. | |
505 The value may be different for frames on different X displays." | |
506 (or frame (setq frame (selected-frame))) | |
16596
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
507 (let* ((color-map-colors (mapcar (lambda (clr) (car clr)) w32-color-map)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
508 (all-colors (or color-map-colors x-colors)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
509 (this-color nil) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
510 (defined-colors nil)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
511 (message "Defining colors...") |
13434 | 512 (while all-colors |
513 (setq this-color (car all-colors) | |
514 all-colors (cdr all-colors)) | |
515 (and (face-color-supported-p frame this-color t) | |
516 (setq defined-colors (cons this-color defined-colors)))) | |
517 defined-colors)) | |
518 | |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
519 |
13434 | 520 ;;;; Function keys |
521 | |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
522 ;;; make f10 activate the real menubar rather than the mini-buffer menu |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
523 ;;; navigation feature. |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
524 (global-set-key [f10] (lambda () |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
525 (interactive) (w32-send-sys-command ?\xf100))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
526 |
13434 | 527 (defun iconify-or-deiconify-frame () |
528 "Iconify the selected frame, or deiconify if it's currently an icon." | |
529 (interactive) | |
530 (if (eq (cdr (assq 'visibility (frame-parameters))) t) | |
531 (iconify-frame) | |
532 (make-frame-visible))) | |
533 | |
534 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame | |
535 global-map) | |
536 | |
537 | |
538 ;;;; Selections and cut buffers | |
539 | |
540 ;;; We keep track of the last text selected here, so we can check the | |
541 ;;; current selection against it, and avoid passing back our own text | |
542 ;;; from x-cut-buffer-or-selection-value. | |
543 (defvar x-last-selected-text nil) | |
544 | |
545 ;;; It is said that overlarge strings are slow to put into the cut buffer. | |
546 ;;; Note this value is overridden below. | |
547 (defvar x-cut-buffer-max 20000 | |
548 "Max number of characters to put in the cut buffer.") | |
549 | |
550 (defvar x-select-enable-clipboard t | |
551 "Non-nil means cutting and pasting uses the clipboard. | |
552 This is in addition to the primary selection.") | |
553 | |
554 (defun x-select-text (text &optional push) | |
555 (if x-select-enable-clipboard | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
556 (w32-set-clipboard-data text)) |
15048
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
557 (setq x-last-selected-text text)) |
13434 | 558 |
559 ;;; Return the value of the current selection. | |
560 ;;; Consult the selection, then the cut buffer. Treat empty strings | |
561 ;;; as if they were unset. | |
562 (defun x-get-selection-value () | |
563 (if x-select-enable-clipboard | |
564 (let (text) | |
565 ;; Don't die if x-get-selection signals an error. | |
566 (condition-case c | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
567 (setq text (w32-get-clipboard-data)) |
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
568 (error (message "w32-get-clipboard-data:%s" c))) |
13434 | 569 (if (string= text "") (setq text nil)) |
15048
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
570 (cond |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
571 ((not text) nil) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
572 ((eq text x-last-selected-text) nil) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
573 ((string= text x-last-selected-text) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
574 ;; Record the newer string, so subsequent calls can use the 'eq' test. |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
575 (setq x-last-selected-text text) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
576 nil) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
577 (t |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
578 (setq x-last-selected-text text)))))) |
13434 | 579 |
580 ;;; Do the actual Windows setup here; the above code just defines | |
581 ;;; functions and variables that we use now. | |
582 | |
583 (setq command-line-args (x-handle-args command-line-args)) | |
584 | |
585 ;;; Make sure we have a valid resource name. | |
586 (or (stringp x-resource-name) | |
587 (let (i) | |
588 (setq x-resource-name (invocation-name)) | |
589 | |
590 ;; Change any . or * characters in x-resource-name to hyphens, | |
591 ;; so as not to choke when we use it in X resource queries. | |
592 (while (setq i (string-match "[.*]" x-resource-name)) | |
593 (aset x-resource-name i ?-)))) | |
594 | |
595 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing | |
596 ;; the same lisp directory, don't pass the third argument unless we seem | |
597 ;; to have the multi-display support. | |
598 (if (fboundp 'x-close-connection) | |
599 (x-open-connection "" | |
600 x-command-line-resources | |
601 ;; Exit Emacs with fatal error if this fails. | |
602 t) | |
603 (x-open-connection "" | |
604 x-command-line-resources)) | |
605 | |
606 (setq frame-creation-function 'x-create-frame-with-faces) | |
607 | |
608 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) | |
609 x-cut-buffer-max)) | |
610 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
611 ;; W32 expects the menu bar cut and paste commands to use the clipboard. |
13434 | 612 ;; This has ,? to match both on Sunos and on Solaris. |
613 (menu-bar-enable-clipboard) | |
614 | |
615 ;; Apply a geometry resource to the initial frame. Put it at the end | |
616 ;; of the alist, so that anything specified on the command line takes | |
617 ;; precedence. | |
618 (let* ((res-geometry (x-get-resource "geometry" "Geometry")) | |
619 parsed) | |
620 (if res-geometry | |
621 (progn | |
622 (setq parsed (x-parse-geometry res-geometry)) | |
623 ;; If the resource specifies a position, | |
624 ;; call the position and size "user-specified". | |
625 (if (or (assq 'top parsed) (assq 'left parsed)) | |
626 (setq parsed (cons '(user-position . t) | |
627 (cons '(user-size . t) parsed)))) | |
628 ;; All geometry parms apply to the initial frame. | |
629 (setq initial-frame-alist (append initial-frame-alist parsed)) | |
630 ;; The size parms apply to all frames. | |
631 (if (assq 'height parsed) | |
632 (setq default-frame-alist | |
633 (cons (cons 'height (cdr (assq 'height parsed))) | |
634 default-frame-alist))) | |
635 (if (assq 'width parsed) | |
636 (setq default-frame-alist | |
637 (cons (cons 'width (cdr (assq 'width parsed))) | |
638 default-frame-alist)))))) | |
639 | |
640 ;; Check the reverseVideo resource. | |
641 (let ((case-fold-search t)) | |
642 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) | |
643 (if (and rv | |
644 (string-match "^\\(true\\|yes\\|on\\)$" rv)) | |
645 (setq default-frame-alist | |
646 (cons '(reverse . t) default-frame-alist))))) | |
647 | |
648 ;; Set x-selection-timeout, measured in milliseconds. | |
649 (let ((res-selection-timeout | |
650 (x-get-resource "selectionTimeout" "SelectionTimeout"))) | |
651 (setq x-selection-timeout 20000) | |
652 (if res-selection-timeout | |
653 (setq x-selection-timeout (string-to-number res-selection-timeout)))) | |
654 | |
655 (defun x-win-suspend-error () | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
656 (error "Suspending an emacs running under W32 makes no sense")) |
13434 | 657 (add-hook 'suspend-hook 'x-win-suspend-error) |
658 | |
659 ;;; Arrange for the kill and yank functions to set and check the clipboard. | |
660 (setq interprogram-cut-function 'x-select-text) | |
661 (setq interprogram-paste-function 'x-get-selection-value) | |
662 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
663 ;;; Turn off window-splitting optimization; w32 is usually fast enough |
13434 | 664 ;;; that this is only annoying. |
665 (setq split-window-keep-point t) | |
666 | |
667 ;; Don't show the frame name; that's redundant. | |
19167
337f5643498e
Set mode-line-frame-identification
Geoff Voelker <voelker@cs.washington.edu>
parents:
16889
diff
changeset
|
668 (setq-default mode-line-frame-identification " ") |
13434 | 669 |
670 ;;; Set to a system sound if you want a fancy bell. | |
671 (set-message-beep 'ok) | |
672 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
673 ;; Remap some functions to call w32 common dialogs |
13434 | 674 |
675 (defun internal-face-interactive (what &optional bool) | |
676 (let* ((fn (intern (concat "face-" what))) | |
677 (prompt (concat "Set " what " of face")) | |
678 (face (read-face-name (concat prompt ": "))) | |
679 (default (if (fboundp fn) | |
680 (or (funcall fn face (selected-frame)) | |
681 (funcall fn 'default (selected-frame))))) | |
682 (fn-win (intern (concat (symbol-name window-system) "-select-" what))) | |
683 (value | |
684 (if (fboundp fn-win) | |
685 (funcall fn-win) | |
686 (if bool | |
687 (y-or-n-p (concat "Should face " (symbol-name face) | |
688 " be " bool "? ")) | |
689 (read-string (concat prompt " " (symbol-name face) " to: ") | |
690 default))))) | |
691 (list face (if (equal value "") nil value)))) | |
692 | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
693 ;; Redefine the font selection to use the standard W32 dialog |
13434 | 694 |
695 (defun mouse-set-font (&rest fonts) | |
696 (interactive) | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
697 (set-default-font (w32-select-font))) |
13434 | 698 |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
699 ;;; w32-win.el ends here |