From 645b9326771220c10a7e33e18704f5668bece100 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Aug 2009 23:40:19 +0000 Subject: [PATCH] * files.el (hack-one-local-variable): If the mode function is for a minor mode, pass it an argument (Bug#4148). --- lisp/ChangeLog | 5 +++++ lisp/files.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 -- 2.39.2