annotate lisp/prim/winnt.el @ 171:929b76928fce r20-3b12

Import from CVS: tag r20-3b12
author cvs
date Mon, 13 Aug 2007 09:47:52 +0200
parents 7d55a9ba150c
children 41ff10fd062f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
1 ;;; winnt.el --- Lisp routines for Windows NT.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
2
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
4
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
5 ;; Author: Geoff Voelker (voelker@cs.washington.edu)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
6
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
8
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
12 ;; any later version.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
13
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
18
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
23
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
24 ;;; Commentary:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
25
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
26 ;; (August 12, 1993)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
27 ;; Created.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
28
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
29 ;; (November 21, 1994)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
30 ;; [C-M-backspace] defined.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
31 ;; mode-line-format defined to show buffer file type.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
32 ;; audio bell initialized.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
33 ;;
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
34 ;; (March 18, 1997)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
35 ;; Ported to XEmacs by Marc Paquette <marcpa@cam.org>
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
36 ;;
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
37
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
38 ;;; Code:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
39
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
40 ;; Map delete and backspace
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
41 ;; Not sure this is really needed in XEmacs... --marcpa
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
42 (define-key global-map [(backspace)] 'backward-delete-char)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
43 (define-key global-map [(delete)] 'delete-char)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
44 (define-key global-map [(meta backspace)] 'backward-kill-word)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
45 (define-key global-map [(control meta backspace)] 'backward-kill-sexp)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
46
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
47 ;; Show file type (text or binary) on modeline
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
48 (setq-default mode-line-format
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
49 (list (purecopy "")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
50 'mode-line-modified
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
51 'mode-line-buffer-identification
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
52 (purecopy " ")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
53 'global-mode-string
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
54 (purecopy " %[(")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
55 (purecopy "%t:")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
56 'mode-name 'mode-line-process 'minor-mode-alist
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
57 (purecopy "%n")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
58 (purecopy ")%]--")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
59 (purecopy '(line-number-mode "L%l--"))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
60 (purecopy '(column-number-mode "C%c--"))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
61 (purecopy '(-3 . "%p"))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
62 (purecopy "-%-")))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
63
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
64 ;; Ignore case on file-name completion
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
65 (setq completion-ignore-case t)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
66
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
67 ;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
68 ;; for executing its command line argument (from simple.el).
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
69 (setq shell-command-switch "/c")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
70
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
71 ;; For appending suffixes to directories and files in shell completions.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
72 (add-hook 'shell-mode-hook
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
73 '(lambda () (setq comint-completion-addsuffix '("\\" . " "))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
74
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
75 ;; Use ";" instead of ":" as a path separator (from files.el).
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
76 (setq path-separator ";")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
77
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
78 ;; Set the null device (for compile.el).
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
79 (setq grep-null-device "NUL")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
80
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
81 ;; Set the grep regexp to match entries with drive letters.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
82 (setq grep-regexp-alist
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
83 '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
84
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
85 ;; Taken from dos-fn.el ... don't want all that's in the file, maybe
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
86 ;; separate it out someday.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
87
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
88 (defvar file-name-buffer-file-type-alist
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
89 '(
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
90 ("[:/].*config.sys$" . nil) ; config.sys text
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
91 ("\\.elc$" . t) ; emacs stuff
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
92 ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|chk\\|out\\|bin\\|ico\\|pif\\)$" . t)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
93 ; MS-Dos stuff
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
94 ("\\.\\(arc\\|zip\\|pak\\|lzh\\|zoo\\)$" . t)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
95 ; Packers
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
96 ("\\.\\(a\\|o\\|tar\\|z\\|gz\\|taz\\)$" . t)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
97 ; Unix stuff
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
98 ("\\.tp[ulpw]$" . t)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
99 ; Borland Pascal stuff
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
100 )
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
101 "*Alist for distinguishing text files from binary files.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
102 Each element has the form (REGEXP . TYPE), where REGEXP is matched
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
103 against the file name, and TYPE is nil for text, t for binary.")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
104
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
105 (defun find-buffer-file-type (filename)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
106 (let ((alist file-name-buffer-file-type-alist)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
107 (found nil)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
108 (code nil))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
109 (let ((case-fold-search t))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
110 (setq filename (file-name-sans-versions filename))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
111 (while (and (not found) alist)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
112 (if (string-match (car (car alist)) filename)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
113 (setq code (cdr (car alist))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
114 found t))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
115 (setq alist (cdr alist))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
116 (if found
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
117 (cond((memq code '(nil t)) code)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
118 ((and (symbolp code) (fboundp code))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
119 (funcall code filename)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
120 default-buffer-file-type)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
121
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
122 (defun find-file-binary (filename)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
123 "Visit file FILENAME and treat it as binary."
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
124 (interactive "FFind file binary: ")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
125 (let ((file-name-buffer-file-type-alist '(("" . t))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
126 (find-file filename)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
127
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
128 (defun find-file-text (filename)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
129 "Visit file FILENAME and treat it as a text file."
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
130 (interactive "FFind file text: ")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
131 (let ((file-name-buffer-file-type-alist '(("" . nil))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
132 (find-file filename)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
133
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
134 (defun find-file-not-found-set-buffer-file-type ()
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
135 (save-excursion
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
136 (set-buffer (current-buffer))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
137 (setq buffer-file-type (find-buffer-file-type (buffer-file-name))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
138 nil)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
139
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
140 ;;; To set the default file type on new files.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
141 (add-hook 'find-file-not-found-hooks 'find-file-not-found-set-buffer-file-type)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
142
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
143 ;;; For using attached Unix filesystems.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
144 (defun save-to-unix-hook ()
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
145 (save-excursion
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
146 (setq buffer-file-type t))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
147 nil)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
148
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
149 (defun revert-from-unix-hook ()
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
150 (save-excursion
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
151 (setq buffer-file-type (find-buffer-file-type (buffer-file-name))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
152 nil)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
153
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
154 ;; Really should provide this capability at the drive letter granularity.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
155 (defun using-unix-filesystems (flag)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
156 "Read and write files without CR/LF translation, if FLAG is non-nil.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
157 This is in effect assuming the files are on a remote Unix file system.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
158 If FLAG is nil, resume using CR/LF translation as usual."
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
159 (if flag
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
160 (progn
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
161 (add-hook 'write-file-hooks 'save-to-unix-hook)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
162 (add-hook 'after-save-hook 'revert-from-unix-hook))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
163 (progn
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
164 (remove-hook 'write-file-hooks 'save-to-unix-hook)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
165 (remove-hook 'after-save-hook 'revert-from-unix-hook))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
166
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
167 ;;; Avoid creating auto-save file names containing invalid characters
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
168 ;;; (primarily "*", eg. for the *mail* buffer).
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
169 (fset 'original-make-auto-save-file-name
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
170 (symbol-function 'make-auto-save-file-name))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
171
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
172 (defun make-auto-save-file-name ()
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
173 "Return file name to use for auto-saves of current buffer.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
174 Does not consider `auto-save-visited-file-name' as that variable is checked
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
175 before calling this function. You can redefine this for customization.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
176 See also `auto-save-file-name-p'."
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
177 (let ((name (original-make-auto-save-file-name))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
178 (start 0))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
179 ;; destructively replace occurences of * or ? with $
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
180 (while (string-match "[?*]" name start)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
181 (aset name (match-beginning 0) ?$)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
182 (setq start (1+ (match-end 0))))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
183 name))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
184
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
185 ;; ### FIX ME: need to look at XEmacs xmouse.el versus FSF mouse.el
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
186 ;; and adjust accordingly: I think 'x-selections is an FSFism.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
187 ;; --marcpa
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
188 ;;; Fix interface to (X-specific) mouse.el
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
189 (defun x-set-selection (type data)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
190 (or type (setq type 'PRIMARY))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
191 (put 'x-selections type data))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
192
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
193 (defun x-get-selection (&optional type data-type)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
194 (or type (setq type 'PRIMARY))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
195 (get 'x-selections type))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
196
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
197 ;; FSFisms
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
198 ;(fmakunbound 'font-menu-add-default)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
199 ;(global-unset-key [C-down-mouse-1])
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
200 ;(global-unset-key [C-down-mouse-2])
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
201 ;(global-unset-key [C-down-mouse-3])
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
202
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
203 ;;; Set to a system sound if you want a fancy bell.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
204 ;(set-message-beep nil)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
205
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents:
diff changeset
206 ;;; winnt.el ends here