diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 2ca557c52b7..fef42161bf3 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -348,7 +348,7 @@ Matches the visited file name against the elements of `auto-insert-alist'." (setq desc (cdr cond) cond (car cond))) (if (if (symbolp cond) - (eq cond major-mode) + (derived-mode-p cond) (and buffer-file-name (string-match cond buffer-file-name))) (setq action (cdr (car alist))