Mercurial > emacs
annotate lisp/w32-fns.el @ 15420:877d4b6fd768
(term-terminal-menu): Don't make a self-recursive keymap.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 12 Jun 1996 21:45:45 +0000 |
parents | a8bd6f986389 |
children | 0ebdc7e05bfd |
rev | line source |
---|---|
15003 | 1 ;;; winnt.el --- Lisp routines for Windows NT. |
14169 | 2 |
9803 | 3 ;; Copyright (C) 1994 Free Software Foundation, Inc. |
4 | |
5 ;; Author: Geoff Voelker (voelker@cs.washington.edu) | |
6 | |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
14169 | 20 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
9803 | 23 |
24 ;;; Commentary: | |
25 | |
26 ;; (August 12, 1993) | |
11399 | 27 ;; Created. |
9803 | 28 |
11399 | 29 ;; (November 21, 1994) |
30 ;; [C-M-backspace] defined. | |
31 ;; mode-line-format defined to show buffer file type. | |
32 ;; audio bell initialized. | |
9803 | 33 |
34 ;;; Code: | |
35 | |
36 ;; Map delete and backspace | |
37 (define-key function-key-map [backspace] "\177") | |
38 (define-key function-key-map [delete] "\C-d") | |
39 (define-key function-key-map [M-backspace] [?\M-\177]) | |
11399 | 40 (define-key function-key-map [C-M-backspace] [\C-\M-delete]) |
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 | 59 ;; Ignore case on file-name completion |
60 (setq completion-ignore-case t) | |
61 | |
62 ;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch | |
63 ;; for executing its command line argument (from simple.el). | |
64 (setq shell-command-switch "/c") | |
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) |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
153 "Read and write all files assuming that they are on a drive attached |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
154 to a remote Unix file system. No CR/LF translation is done on any files |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
155 in this case. This behavior is activated when FLAG is t and deactived |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
156 when FLAG is any other value." |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
157 (if flag |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
158 (progn |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
159 (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
|
160 (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
|
161 (progn |
25dbb4494147
Hold previous change until after the release.
Karl Heuer <kwzh@gnu.org>
parents:
15252
diff
changeset
|
162 (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
|
163 (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
|
164 |
15135
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
165 ;;; Avoid creating auto-save file names containing illegal characters |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
166 ;;; (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
|
167 (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
|
168 (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
|
169 |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
170 (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
|
171 "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
|
172 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
|
173 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
|
174 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
|
175 (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
|
176 (start 0)) |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
177 ;; 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
|
178 (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
|
179 (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
|
180 (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
|
181 name)) |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
182 |
9803 | 183 ;;; 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
|
184 (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
|
185 (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
|
186 (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
|
187 |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
188 (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
|
189 (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
|
190 (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
|
191 |
9803 | 192 (fmakunbound 'font-menu-add-default) |
193 (global-unset-key [C-down-mouse-1]) | |
194 (global-unset-key [C-down-mouse-2]) | |
195 (global-unset-key [C-down-mouse-3]) | |
196 | |
11399 | 197 ;;; Set to a system sound if you want a fancy bell. |
198 (set-message-beep nil) | |
199 | |
9803 | 200 ;;; winnt.el ends here |