]> code.delx.au - gnu-emacs/blobdiff - lisp/files.el
Minor fixes for text of help-echo in some options.
[gnu-emacs] / lisp / files.el
index 977da75e4a9bd27caa9194c82fd69db7546d08e0..bdd5604417d17551c981e865ff21506892450ea3 100644 (file)
@@ -1468,7 +1468,7 @@ in that case, this function acts as if `enable-local-variables' were t."
      ;; The following should come after the ChangeLog pattern
      ;; for the sake of ChangeLog.1, etc.
      ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too.
-     ("\\.[12345678]\\'" . nroff-mode)
+     ("\\.[1-9]\\'" . nroff-mode)
      ("\\.g\\'" . antlr-mode)))
   "Alist of filename patterns vs corresponding major mode functions.
 Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
@@ -3264,7 +3264,12 @@ See also `auto-save-file-name-p'."
 
        (if (and (eq system-type 'ms-dos)
                 (not (msdos-long-file-names)))
-           (let ((fn (file-name-nondirectory buffer-file-name)))
+           ;; We truncate the file name to DOS 8+3 limits before
+           ;; doing anything else, because the regexp passed to
+           ;; string-match below cannot handle extensions longer than
+           ;; 3 characters, multiple dots, and other atrocities.
+           (let ((fn (dos-8+3-filename
+                      (file-name-nondirectory buffer-file-name))))
              (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn)
              (concat (file-name-directory buffer-file-name)
                      "#" (match-string 1 fn)