diff options
| author | Karl Heuer | 1996-05-17 22:30:36 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-05-17 22:30:36 +0000 |
| commit | d77f86d08d61fb1a8d2b6a0aced90ffc5760990f (patch) | |
| tree | a982fdf43bbacb1b4d29206f6306919932bd49a1 | |
| parent | fa823be38a371b253198cad960b3be2fd5d9343e (diff) | |
| download | emacs-d77f86d08d61fb1a8d2b6a0aced90ffc5760990f.tar.gz emacs-d77f86d08d61fb1a8d2b6a0aced90ffc5760990f.zip | |
(save-to-unix-hook, revert-from-unix-hook, using-unix-filesystems):
Functions removed.
| -rw-r--r-- | lisp/w32-fns.el | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 9b6046b4f13..39eb75c09fe 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el | |||
| @@ -39,23 +39,6 @@ | |||
| 39 | (define-key function-key-map [M-backspace] [?\M-\177]) | 39 | (define-key function-key-map [M-backspace] [?\M-\177]) |
| 40 | (define-key function-key-map [C-M-backspace] [\C-\M-delete]) | 40 | (define-key function-key-map [C-M-backspace] [\C-\M-delete]) |
| 41 | 41 | ||
| 42 | ;; Show file type (text or binary) on modeline | ||
| 43 | (setq-default mode-line-format | ||
| 44 | (list (purecopy "") | ||
| 45 | 'mode-line-modified | ||
| 46 | 'mode-line-buffer-identification | ||
| 47 | (purecopy " ") | ||
| 48 | 'global-mode-string | ||
| 49 | (purecopy " %[(") | ||
| 50 | (purecopy "%t:") | ||
| 51 | 'mode-name 'mode-line-process 'minor-mode-alist | ||
| 52 | (purecopy "%n") | ||
| 53 | (purecopy ")%]--") | ||
| 54 | (purecopy '(line-number-mode "L%l--")) | ||
| 55 | (purecopy '(column-number-mode "C%c--")) | ||
| 56 | (purecopy '(-3 . "%p")) | ||
| 57 | (purecopy "-%-"))) | ||
| 58 | |||
| 59 | ;; Ignore case on file-name completion | 42 | ;; Ignore case on file-name completion |
| 60 | (setq completion-ignore-case t) | 43 | (setq completion-ignore-case t) |
| 61 | 44 | ||
| @@ -63,101 +46,6 @@ | |||
| 63 | ;; for executing its command line argument (from simple.el). | 46 | ;; for executing its command line argument (from simple.el). |
| 64 | (setq shell-command-switch "/c") | 47 | (setq shell-command-switch "/c") |
| 65 | 48 | ||
| 66 | ;; Use ";" instead of ":" as a path separator (from files.el). | ||
| 67 | (setq path-separator ";") | ||
| 68 | |||
| 69 | ;; Set the null device (for compile.el). | ||
| 70 | (setq grep-null-device "NUL") | ||
| 71 | |||
| 72 | ;; Set the grep regexp to match entries with drive letters. | ||
| 73 | (setq grep-regexp-alist | ||
| 74 | '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3))) | ||
| 75 | |||
| 76 | ;; Taken from dos-fn.el ... don't want all that's in the file, maybe | ||
| 77 | ;; separate it out someday. | ||
| 78 | |||
| 79 | (defvar file-name-buffer-file-type-alist | ||
| 80 | '( | ||
| 81 | ("[:/].*config.sys$" . nil) ; config.sys text | ||
| 82 | ("\\.elc$" . t) ; emacs stuff | ||
| 83 | ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|chk\\|out\\|bin\\|ico\\|pif\\)$" . t) | ||
| 84 | ; MS-Dos stuff | ||
| 85 | ("\\.\\(arc\\|zip\\|pak\\|lzh\\|zoo\\)$" . t) | ||
| 86 | ; Packers | ||
| 87 | ("\\.\\(a\\|o\\|tar\\|z\\|gz\\|taz\\)$" . t) | ||
| 88 | ; Unix stuff | ||
| 89 | ("\\.tp[ulpw]$" . t) | ||
| 90 | ; Borland Pascal stuff | ||
| 91 | ("[:/]tags$" . t) | ||
| 92 | ; Emacs TAGS file | ||
| 93 | ) | ||
| 94 | "*Alist for distinguishing text files from binary files. | ||
| 95 | Each element has the form (REGEXP . TYPE), where REGEXP is matched | ||
| 96 | against the file name, and TYPE is nil for text, t for binary.") | ||
| 97 | |||
| 98 | (defun find-buffer-file-type (filename) | ||
| 99 | (let ((alist file-name-buffer-file-type-alist) | ||
| 100 | (found nil) | ||
| 101 | (code nil)) | ||
| 102 | (let ((case-fold-search t)) | ||
| 103 | (setq filename (file-name-sans-versions filename)) | ||
| 104 | (while (and (not found) alist) | ||
| 105 | (if (string-match (car (car alist)) filename) | ||
| 106 | (setq code (cdr (car alist)) | ||
| 107 | found t)) | ||
| 108 | (setq alist (cdr alist)))) | ||
| 109 | (if found | ||
| 110 | (cond((memq code '(nil t)) code) | ||
| 111 | ((and (symbolp code) (fboundp code)) | ||
| 112 | (funcall code filename))) | ||
| 113 | default-buffer-file-type))) | ||
| 114 | |||
| 115 | (defun find-file-binary (filename) | ||
| 116 | "Visit file FILENAME and treat it as binary." | ||
| 117 | (interactive "FFind file binary: ") | ||
| 118 | (let ((file-name-buffer-file-type-alist '(("" . t)))) | ||
| 119 | (find-file filename))) | ||
| 120 | |||
| 121 | (defun find-file-text (filename) | ||
| 122 | "Visit file FILENAME and treat it as a text file." | ||
| 123 | (interactive "FFind file text: ") | ||
| 124 | (let ((file-name-buffer-file-type-alist '(("" . nil)))) | ||
| 125 | (find-file filename))) | ||
| 126 | |||
| 127 | (defun find-file-not-found-set-buffer-file-type () | ||
| 128 | (save-excursion | ||
| 129 | (set-buffer (current-buffer)) | ||
| 130 | (setq buffer-file-type (find-buffer-file-type (buffer-file-name)))) | ||
| 131 | nil) | ||
| 132 | |||
| 133 | ;;; To set the default file type on new files. | ||
| 134 | (add-hook 'find-file-not-found-hooks 'find-file-not-found-set-buffer-file-type) | ||
| 135 | |||
| 136 | ;;; For using attached Unix filesystems. | ||
| 137 | (defun save-to-unix-hook () | ||
| 138 | (save-excursion | ||
| 139 | (setq buffer-file-type t)) | ||
| 140 | nil) | ||
| 141 | |||
| 142 | (defun revert-from-unix-hook () | ||
| 143 | (save-excursion | ||
| 144 | (setq buffer-file-type (find-buffer-file-type (buffer-file-name)))) | ||
| 145 | nil) | ||
| 146 | |||
| 147 | ;; Really should provide this capability at the drive letter granularity. | ||
| 148 | (defun using-unix-filesystems (flag) | ||
| 149 | "Read and write all files assuming that they are on a drive attached | ||
| 150 | to a remote Unix file system. No CR/LF translation is done on any files | ||
| 151 | in this case. This behavior is activated when FLAG is t and deactived | ||
| 152 | when FLAG is any other value." | ||
| 153 | (if flag | ||
| 154 | (progn | ||
| 155 | (add-hook 'write-file-hooks 'save-to-unix-hook) | ||
| 156 | (add-hook 'after-save-hook 'revert-from-unix-hook)) | ||
| 157 | (progn | ||
| 158 | (remove-hook 'write-file-hooks 'save-to-unix-hook) | ||
| 159 | (remove-hook 'after-save-hook 'revert-from-unix-hook)))) | ||
| 160 | |||
| 161 | ;;; Avoid creating auto-save file names containing illegal characters | 49 | ;;; Avoid creating auto-save file names containing illegal characters |
| 162 | ;;; (primarily "*", eg. for the *mail* buffer). | 50 | ;;; (primarily "*", eg. for the *mail* buffer). |
| 163 | (fset 'original-make-auto-save-file-name | 51 | (fset 'original-make-auto-save-file-name |