Mercurial > hg > xemacs-beta
diff lisp/files.el @ 5203:733f067a73ce
Check that MODENAME-mode is fboundp before calling it, files.el
2010-04-15 Aidan Kehoe <kehoea@parhasard.net>
* files.el (hack-local-variables-prop-line)
(hack-one-local-variable):
Only attempt to call MODENAME-mode on encountering a
-*-MODENAME-*- line if the corresponding symbol has a function
binding, avoiding an error if, for example, opening a log file
with XLFDs and wild cards. Thanks for the bug report, Henrique
Martins!
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 15 Apr 2010 17:01:08 +0100 |
parents | e29fcfd8df5f |
children | cdca98f2d36f |
line wrap: on
line diff
--- a/lisp/files.el Mon Apr 12 01:41:38 2010 -0500 +++ b/lisp/files.el Thu Apr 15 17:01:08 2010 +0100 @@ -2044,7 +2044,7 @@ ;; Without this guard, `normal-mode' would potentially run ;; the major mode function twice: once via `set-auto-mode' ;; and once via `hack-local-variables'. - (if (not (eq mode major-mode)) + (if (and (not (eq mode major-mode)) (fboundp mode)) (funcall mode)) )) (set-any-p @@ -2091,8 +2091,9 @@ "\"Set\" one variable in a local variables spec. A few variable names are treated specially." (cond ((eq var 'mode) - (funcall (intern (concat (downcase (symbol-name val)) - "-mode")))) + (and (fboundp (setq val (intern (concat (downcase (symbol-name val)) + "-mode")))) + (funcall val))) ((eq var 'coding) ;; We have already handled coding: tag in set-auto-coding. nil)