annotate lisp/w32-fns.el @ 15701:5db02009315e libc-1-93 libc-960716 libc-960717 libc-960718 libc-960719 libc-960720 libc-960721 libc-960722 libc-960723 libc-960724 libc-960725 libc-960726 libc-960727 libc-960728 libc-960729 libc-960730 libc-960731 libc-960801 libc-960802 libc-960803 libc-960804 libc-960805 libc-960806 libc-960807 libc-960808 libc-960809 libc-960810 libc-960811 libc-960812 libc-960813 libc-960814 libc-960815 libc-960816 libc-960817 libc-960818 libc-960819 libc-960820 libc-960821 libc-960822 libc-960823 libc-960824 libc-960825 libc-960826 libc-960827 libc-960828 libc-960829 libc-960830 libc-960831 libc-960901 libc-960902 libc-960903 libc-960904 libc-960905 libc-960906 libc-960907 libc-960908 libc-960909 libc-960910 libc-960911 libc-960912 release-0-0 release-0-1

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