--- checkdoc.el.~1.74.~ 2009-09-18 08:22:27.000000000 +1000 +++ checkdoc.el 2009-09-25 18:22:29.000000000 +1000 @@ -2304,15 +2304,18 @@ (or ;; * Code section (if (not (lm-code-mark)) - (let ((cont t)) + (let ((cont t) + pos) (goto-char (point-min)) - (while (and cont (re-search-forward "^(" nil t)) - (setq cont (looking-at "require\\s-+"))) + ;; matching ";;;###" to keep autoload cookie with the form + (while (and cont (re-search-forward "^\\(;;;###.*\n\\)?(" nil t)) + (setq pos (match-beginning 0) + cont (looking-at "require\\s-+"))) (if (and (not cont) (checkdoc-y-or-n-p "There is no ;;; Code: marker. Insert one? ")) - (progn (beginning-of-line) - (insert ";;; Code:\n") + (progn (goto-char pos) + (insert ";;; Code:\n\n") nil) (checkdoc-create-error "You should have a section marked \";;; Code:\""