]> code.delx.au - gnu-emacs/commitdiff
(set-auto-mode): If buffer has no file, use buffer name.
authorRichard M. Stallman <rms@gnu.org>
Mon, 1 May 1995 15:49:09 +0000 (15:49 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 1 May 1995 15:49:09 +0000 (15:49 +0000)
lisp/files.el

index 6a46ab0b762a87d7f0c8a206ed31a8ad46a898b8..630480bd0641f6b7d624c46d19ca3b7a498fe390 100644 (file)
@@ -947,7 +947,9 @@ If `enable-local-variables' is nil, this function does not check for a
           ;; Don't look for -*- if this file name matches any
           ;; of the regexps in inhibit-first-line-modes-regexps.
           (let ((temp inhibit-first-line-modes-regexps)
-                (name (file-name-sans-versions buffer-file-name)))
+                (name (if buffer-file-name
+                          (file-name-sans-versions buffer-file-name)
+                        (buffer-name))))
             (while (let ((sufs inhibit-first-line-modes-suffixes))
                      (while (and sufs (not (string-match (car sufs) name)))
                        (setq sufs (cdr sufs)))