Mercurial > hg > xemacs-beta
comparison lisp/files.el @ 424:11054d720c21 r21-2-20
Import from CVS: tag r21-2-20
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:26:11 +0200 |
parents | 95016f13131a |
children |
comparison
equal
deleted
inserted
replaced
423:28d9c139be4c | 424:11054d720c21 |
---|---|
1270 "List of regexps for what to ignore, for `inhibit-first-line-modes-regexps'. | 1270 "List of regexps for what to ignore, for `inhibit-first-line-modes-regexps'. |
1271 When checking `inhibit-first-line-modes-regexps', we first discard | 1271 When checking `inhibit-first-line-modes-regexps', we first discard |
1272 from the end of the file name anything that matches one of these regexps.") | 1272 from the end of the file name anything that matches one of these regexps.") |
1273 | 1273 |
1274 (defvar user-init-file | 1274 (defvar user-init-file |
1275 "" ; set by command-line | 1275 nil ; set by command-line |
1276 "File name including directory of user's initialization file.") | 1276 "File name including directory of user's initialization file.") |
1277 | 1277 |
1278 (defun set-auto-mode (&optional just-from-file-name) | 1278 (defun set-auto-mode (&optional just-from-file-name) |
1279 "Select major mode appropriate for current buffer. | 1279 "Select major mode appropriate for current buffer. |
1280 This checks for a -*- mode tag in the buffer's text, | 1280 This checks for a -*- mode tag in the buffer's text, |
2751 (cond ((if (file-exists-p file) | 2751 (cond ((if (file-exists-p file) |
2752 (not (file-newer-than-file-p file-name file)) | 2752 (not (file-newer-than-file-p file-name file)) |
2753 (not (file-exists-p file-name))) | 2753 (not (file-exists-p file-name))) |
2754 (error "Auto-save file %s not current" file-name)) | 2754 (error "Auto-save file %s not current" file-name)) |
2755 ((save-window-excursion | 2755 ((save-window-excursion |
2756 (with-output-to-temp-buffer "*Directory*" | 2756 (if (not (eq system-type 'windows-nt)) |
2757 (buffer-disable-undo standard-output) | 2757 (with-output-to-temp-buffer "*Directory*" |
2758 (call-process "ls" nil standard-output nil | 2758 (buffer-disable-undo standard-output) |
2759 (if (file-symlink-p file) "-lL" "-l") | 2759 (call-process "ls" nil standard-output nil |
2760 file file-name)) | 2760 (if (file-symlink-p file) "-lL" "-l") |
2761 file file-name))) | |
2761 (yes-or-no-p (format "Recover auto save file %s? " file-name))) | 2762 (yes-or-no-p (format "Recover auto save file %s? " file-name))) |
2762 (switch-to-buffer (find-file-noselect file t)) | 2763 (switch-to-buffer (find-file-noselect file t)) |
2763 (let ((buffer-read-only nil)) | 2764 (let ((buffer-read-only nil)) |
2764 (erase-buffer) | 2765 (erase-buffer) |
2765 (insert-file-contents file-name nil)) | 2766 (insert-file-contents file-name nil)) |