annotate lisp/winnt.el @ 408:501cfd01ee6d r21-2-34

Import from CVS: tag r21-2-34
author cvs
date Mon, 13 Aug 2007 11:18:11 +0200
parents 2f8bb876ab1d
children 697ef44129c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
404
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents: 398
diff changeset
1 ;;; winnt.el --- Lisp routines for MS Windows.
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
2
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
4
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
5 ;; Maintainer: XEmacs Development Team
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
6 ;; Keywords: mouse, dumped
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
7
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
8 ;; This file is part of XEmacs.
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
9
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
11 ;; under the terms of the GNU General Public License as published by
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
13 ;; any later version.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
14
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
18 ;; General Public License for more details.
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
19
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
22 ;; Free Software Foundation, 59 Temple Place - Suite 330,
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
24
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
25 ;;; Synched up with: Not synched with FSF. Almost completely divergent.
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
26
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
27 ;;; Commentary:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
28
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
29 ;; This file is dumped with XEmacs for MS Windows (without cygwin).
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
30
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
31 ;; Based on NT Emacs version by Geoff Voelker (voelker@cs.washington.edu)
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
32 ;; Ported to XEmacs by Marc Paquette <marcpa@cam.org>
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
33 ;; Largely modified by Kirill M. Katsnelson <kkm@kis.ru>
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
34
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
35 ;;; Code:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
36
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
37 ;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
38 ;; for executing its command line argument (from simple.el).
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
39 ;; #### Oh if we had an alist of shells and their command switches.
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
40 (setq shell-command-switch "/c")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
41
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
42 ;; For appending suffixes to directories and files in shell
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
43 ;; completions. This screws up cygwin users so we leave it out for
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
44 ;; now. Uncomment this if you only ever want to use cmd.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
45
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
46 ;(defun nt-shell-mode-hook ()
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
47 ; (setq comint-completion-addsuffix '("\\" . " ")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
48 ; comint-process-echoes t))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
49 ;(add-hook 'shell-mode-hook 'nt-shell-mode-hook)
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 367
diff changeset
50
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
51 ;; Use ";" instead of ":" as a path separator (from files.el).
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
52 (setq path-separator ";")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
53
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
54 ;; Set the null device (for compile.el).
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
55 ;; #### There should be such a global thingy as null-device - kkm
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
56 (setq grep-null-device "NUL")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
57
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
58 ;; Set the grep regexp to match entries with drive letters.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
59 (setq grep-regexp-alist
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
60 '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
61
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
62 ;;----------------------------------------------------------------------
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
63 ;; Autosave hack
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
64 ;;--------------------
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
65
286
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
66 ;; Avoid creating auto-save file names containing invalid characters
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
67 ;; (primarily "*", eg. for the *mail* buffer).
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
68 ;; Avoid "doc lost for function" warning
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
69 (defun original-make-auto-save-file-name (&optional junk)
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
70 "You do not want to call this."
57709be46d1b Import from CVS: tag r21-0b41
cvs
parents: 265
diff changeset
71 )
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
72 (fset 'original-make-auto-save-file-name
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
73 (symbol-function 'make-auto-save-file-name))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
74
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
75 (defun make-auto-save-file-name ()
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
76 "Return file name to use for auto-saves of current buffer.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
77 Does not consider `auto-save-visited-file-name' as that variable is checked
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
78 before calling this function. You can redefine this for customization.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
79 See also `auto-save-file-name-p'."
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
80 (let ((name (original-make-auto-save-file-name))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
81 (start 0))
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
82 ;; destructively replace occurrences of * or ? with $
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
83 (while (string-match "[?*]" name start)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
84 (aset name (match-beginning 0) ?$)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
85 (setq start (1+ (match-end 0))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
86 name))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
87
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
88 ;;; winnt.el ends here