changeset 11636:919ac497342e

(set-auto-mode): If buffer has no file, use buffer name.
author Richard M. Stallman <rms@gnu.org>
date Mon, 01 May 1995 15:49:09 +0000
parents b56f6afa16ec
children dfdae6cd817e
files lisp/files.el
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Mon May 01 05:23:49 1995 +0000
+++ b/lisp/files.el	Mon May 01 15:49:09 1995 +0000
@@ -947,7 +947,9 @@
 	   ;; 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)))