This commit was generated by cvs2svn to compensate for changes in r5670,
[chise/xemacs-chise.git.1] / lisp / files.el
index f59d54f..186043f 100644 (file)
@@ -1157,7 +1157,6 @@ run `normal-mode' explicitly."
     ("\\.m\\(?:[mes]\\|an\\)\\'" . nroff-mode)
     ("\\.icn\\'" . icon-mode)
     ("\\.\\(?:[ckz]?sh\\|shar\\)\\'" . sh-mode)
-    ("\\.pro\\'" . idlwave-mode)
     ;; #### Unix-specific!
     ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode)
     ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode)
@@ -1222,9 +1221,7 @@ REGEXP and search the list again for another match.")
     ("python" . python-mode)
     ("awk\\b" . awk-mode)
     ("rexx"   . rexx-mode)
-    ("scm\\|guile" . scheme-mode)
-    ("emacs" . emacs-lisp-mode)
-    ("make" . makefile-mode)
+    ("scm"    . scheme-mode)
     ("^:"     . sh-mode))
   "Alist mapping interpreter names to major modes.
 This alist is used to guess the major mode of a file based on the
@@ -1273,7 +1270,7 @@ When checking `inhibit-first-line-modes-regexps', we first discard
 from the end of the file name anything that matches one of these regexps.")
 
 (defvar user-init-file
-  nil ; set by command-line
+  "" ; set by command-line
   "File name including directory of user's initialization file.")
 
 (defun set-auto-mode (&optional just-from-file-name)
@@ -2214,21 +2211,19 @@ After saving the buffer, run `after-save-hook'."
              (error "Save not confirmed"))
          (save-restriction
            (widen)
-
-           ;; Add final newline if required.  See `require-final-newline'.
-           (when (and (not (eq (char-before (point-max)) ?\n)) ; common case
-                      (char-before (point-max))                ; empty buffer?
-                      (not (and (eq selective-display t)
-                                (eq (char-before (point-max)) ?\r)))
-                      (or (eq require-final-newline t)
-                          (and require-final-newline
-                               (y-or-n-p
-                                (format "Buffer %s does not end in newline.  Add one? "
-                                        (buffer-name))))))
-             (save-excursion
-               (goto-char (point-max))
-               (insert ?\n)))
-
+           (and (> (point-max) 1)
+                (/= (char-after (1- (point-max))) ?\n)
+                (not (and (eq selective-display t)
+                          (= (char-after (1- (point-max))) ?\r)))
+                (or (eq require-final-newline t)
+                    (and require-final-newline
+                         (y-or-n-p
+                          (format "Buffer %s does not end in newline.  Add one? "
+                                  (buffer-name)))))
+                (save-excursion
+                  (goto-char (point-max))
+                  (insert ?\n)))
+           ;;
            ;; Run the write-file-hooks until one returns non-null.
            ;; Bind after-save-hook to nil while running the
            ;; write-file-hooks so that if this function is called
@@ -2756,12 +2751,11 @@ non-nil, it is called instead of rereading visited file contents."
                 (not (file-exists-p file-name)))
               (error "Auto-save file %s not current" file-name))
              ((save-window-excursion
-                (if (not (eq system-type 'windows-nt))
-                    (with-output-to-temp-buffer "*Directory*"
-                      (buffer-disable-undo standard-output)
-                      (call-process "ls" nil standard-output nil
-                                    (if (file-symlink-p file) "-lL" "-l")
-                                    file file-name)))
+                (with-output-to-temp-buffer "*Directory*"
+                  (buffer-disable-undo standard-output)
+                  (call-process "ls" nil standard-output nil
+                                (if (file-symlink-p file) "-lL" "-l")
+                                file file-name))
                 (yes-or-no-p (format "Recover auto save file %s? " file-name)))
               (switch-to-buffer (find-file-noselect file t))
               (let ((buffer-read-only nil))