# HG changeset patch # User Chong Yidong # Date 1250552419 0 # Node ID af13b0630b54cf2b4ecf4ebefc093035086726e6 # Parent bb8ce3c842e71ed7e6236dbe0cec63a608193afa * files.el (hack-one-local-variable): If the mode function is for a minor mode, pass it an argument (Bug#4148). diff -r bb8ce3c842e7 -r af13b0630b54 lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 17 21:04:05 2009 +0000 +++ b/lisp/ChangeLog Mon Aug 17 23:40:19 2009 +0000 @@ -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 -r bb8ce3c842e7 -r af13b0630b54 lisp/files.el --- a/lisp/files.el Mon Aug 17 21:04:05 2009 +0000 +++ b/lisp/files.el Mon Aug 17 23:40:19 2009 +0000 @@ -3191,7 +3191,12 @@ "-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