diff options
| author | Richard M. Stallman | 1994-01-06 04:30:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-01-06 04:30:52 +0000 |
| commit | bb157910027b3439e85912d44a98e96c8c0c6aba (patch) | |
| tree | 826daa8568b141bc766f1054fa46100a3f410e69 | |
| parent | a0dbb378530f82a65a9f26a1ca566d69a07f036a (diff) | |
| download | emacs-bb157910027b3439e85912d44a98e96c8c0c6aba.tar.gz emacs-bb157910027b3439e85912d44a98e96c8c0c6aba.zip | |
[ms-dos] (make-backup-file-name, backup-file-name-p):
Use "*.bak" as backup file name.
(user-init-file): new variable.
| -rw-r--r-- | lisp/files.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 3179f38041a..7629a2c1419 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -786,6 +786,7 @@ run `normal-mode' explicitly." | |||
| 786 | ;;; so more common ones above are found faster. | 786 | ;;; so more common ones above are found faster. |
| 787 | ("\\.s\\'" . asm-mode) | 787 | ("\\.s\\'" . asm-mode) |
| 788 | ("ChangeLog\\'" . change-log-mode) | 788 | ("ChangeLog\\'" . change-log-mode) |
| 789 | ("change.log\\'" . change-log-mode) | ||
| 789 | ("ChangeLog.[0-9]+\\'" . change-log-mode) | 790 | ("ChangeLog.[0-9]+\\'" . change-log-mode) |
| 790 | ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) | 791 | ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) |
| 791 | ;; The following should come after the ChangeLog pattern | 792 | ;; The following should come after the ChangeLog pattern |
| @@ -819,6 +820,9 @@ run `normal-mode' explicitly." | |||
| 819 | ;; .emacs following a directory delimiter | 820 | ;; .emacs following a directory delimiter |
| 820 | ;; in either Unix or VMS syntax. | 821 | ;; in either Unix or VMS syntax. |
| 821 | ("[]>:/]\\..*emacs\\'" . emacs-lisp-mode) | 822 | ("[]>:/]\\..*emacs\\'" . emacs-lisp-mode) |
| 823 | ;; _emacs following a directory delimiter | ||
| 824 | ;; in MsDos syntax | ||
| 825 | ("[:/]_emacs\\'" . emacs-lisp-mode) | ||
| 822 | ("\\.ml\\'" . lisp-mode))) | 826 | ("\\.ml\\'" . lisp-mode))) |
| 823 | "\ | 827 | "\ |
| 824 | Alist of filename patterns vs corresponding major mode functions. | 828 | Alist of filename patterns vs corresponding major mode functions. |
| @@ -828,6 +832,10 @@ Visiting a file whose name matches REGEXP causes FUNCTION to be called.") | |||
| 828 | (defconst inhibit-local-variables-regexps '("\\.tar$") | 832 | (defconst inhibit-local-variables-regexps '("\\.tar$") |
| 829 | "List of regexps; if one matches a file name, don't look for local vars.") | 833 | "List of regexps; if one matches a file name, don't look for local vars.") |
| 830 | 834 | ||
| 835 | (defvar user-init-file | ||
| 836 | "" ; set by command-line | ||
| 837 | "File name including directory of user's initialization file.") | ||
| 838 | |||
| 831 | (defun set-auto-mode () | 839 | (defun set-auto-mode () |
| 832 | "Select major mode appropriate for current buffer. | 840 | "Select major mode appropriate for current buffer. |
| 833 | This checks for a -*- mode tag in the buffer's text, or | 841 | This checks for a -*- mode tag in the buffer's text, or |
| @@ -1279,13 +1287,21 @@ we do not remove backup version numbers, only true file version numbers." | |||
| 1279 | (defun make-backup-file-name (file) | 1287 | (defun make-backup-file-name (file) |
| 1280 | "Create the non-numeric backup file name for FILE. | 1288 | "Create the non-numeric backup file name for FILE. |
| 1281 | This is a separate function so you can redefine it for customization." | 1289 | This is a separate function so you can redefine it for customization." |
| 1282 | (concat file "~")) | 1290 | (if (eq system-type 'ms-dos) |
| 1291 | (let ((fn (file-name-nondirectory file))) | ||
| 1292 | (concat (file-name-directory file) | ||
| 1293 | (if (string-match "\\([^.]*\\)\\(\\..*\\)?" fn) | ||
| 1294 | (substring fn 0 (match-end 1))) | ||
| 1295 | ".bak")) | ||
| 1296 | (concat file "~"))) | ||
| 1283 | 1297 | ||
| 1284 | (defun backup-file-name-p (file) | 1298 | (defun backup-file-name-p (file) |
| 1285 | "Return non-nil if FILE is a backup file name (numeric or not). | 1299 | "Return non-nil if FILE is a backup file name (numeric or not). |
| 1286 | This is a separate function so you can redefine it for customization. | 1300 | This is a separate function so you can redefine it for customization. |
| 1287 | You may need to redefine `file-name-sans-versions' as well." | 1301 | You may need to redefine `file-name-sans-versions' as well." |
| 1288 | (string-match "~$" file)) | 1302 | (if (eq system-type 'ms-dos) |
| 1303 | (string-match "\\.bak$" file) | ||
| 1304 | (string-match "~$" file))) | ||
| 1289 | 1305 | ||
| 1290 | ;; This is used in various files. | 1306 | ;; This is used in various files. |
| 1291 | ;; The usage of bv-length is not very clean, | 1307 | ;; The usage of bv-length is not very clean, |