From: Chong Yidong Date: Mon, 17 Aug 2009 23:40:19 +0000 (+0000) Subject: * files.el (hack-one-local-variable): If the mode function is for X-Git-Tag: emacs-pretest-23.1.90~1819 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=645b9326771220c10a7e33e18704f5668bece100;p=emacs.git * files.el (hack-one-local-variable): If the mode function is for a minor mode, pass it an argument (Bug#4148). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24e5fa9eae3..814370a6570 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-08-17 Chong Yidong + + * files.el (hack-one-local-variable): If the mode function is for + a minor mode, pass it an argument (Bug#4148). + 2009-08-17 Michael Albinus * net/tramp.el (tramp-register-completion-file-name-handler): diff --git a/lisp/files.el b/lisp/files.el index 6f8ff69caef..825ff250449 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3191,7 +3191,12 @@ already the major mode." "-mode")))) (unless (eq (indirect-function mode) (indirect-function major-mode)) - (funcall mode)))) + (if (memq mode minor-mode-list) + ;; A minor mode must be passed an argument. + ;; Otherwise, if the user enables the minor mode in a + ;; major mode hook, this would toggle it off. + (funcall mode 1) + (funcall mode))))) ((eq var 'eval) (save-excursion (eval val))) (t