changeset 104317:af13b0630b54

* files.el (hack-one-local-variable): If the mode function is for a minor mode, pass it an argument (Bug#4148).
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 17 Aug 2009 23:40:19 +0000
parents bb8ce3c842e7
children eb3f2c155d07
files lisp/ChangeLog lisp/files.el
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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  <cyd@stupidchicken.com>
+
+	* 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  <michael.albinus@gmx.de>
 
 	* net/tramp.el (tramp-register-completion-file-name-handler):
--- 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