# HG changeset patch # User Jim Blandy # Date 737791384 0 # Node ID 6aa7bdef44fc7167390d2f06cc7b72c77ea2f306 # Parent 1ed91566882a30dff0f805f5959fcdb91b47d817 * files.el (set-auto-mode): If the buffer's file name is nil, don't try to compare it against the entries in auto-mode-alist. diff -r 1ed91566882a -r 6aa7bdef44fc lisp/files.el --- a/lisp/files.el Wed May 19 06:01:21 1993 +0000 +++ b/lisp/files.el Wed May 19 06:03:04 1993 +0000 @@ -798,16 +798,17 @@ (setq mode (buffer-substring beg (point)))))) (setq mode (buffer-substring beg end))))) (setq mode (intern (concat (downcase mode) "-mode"))) - (let ((alist auto-mode-alist) - (name buffer-file-name)) - (let ((case-fold-search (eq system-type 'vax-vms))) - ;; Remove backup-suffixes from file name. - (setq name (file-name-sans-versions name)) - ;; Find first matching alist entry. - (while (and (not mode) alist) - (if (string-match (car (car alist)) name) - (setq mode (cdr (car alist)))) - (setq alist (cdr alist))))))) + (if buffer-file-name + (let ((alist auto-mode-alist) + (name buffer-file-name)) + (let ((case-fold-search (eq system-type 'vax-vms))) + ;; Remove backup-suffixes from file name. + (setq name (file-name-sans-versions name)) + ;; Find first matching alist entry. + (while (and (not mode) alist) + (if (string-match (car (car alist)) name) + (setq mode (cdr (car alist)))) + (setq alist (cdr alist)))))))) (if mode (funcall mode)))) (defun hack-local-variables-prop-line ()