# HG changeset patch # User Kevin Ryde # Date 1256162734 0 # Node ID bbd67ae03f385243503285c26cd0bbda3660e308 # Parent a08904175e1a7672edf42763e4e3aa63b91f97ab (checkdoc-file-comments-engine): When inserting ";;; Code" put it before any ";;;###autoload" cookie on the first form. And insert a blank line after ";;; Code" since that's usual style. (My Bug#4612.) diff -r a08904175e1a -r bbd67ae03f38 lisp/emacs-lisp/checkdoc.el --- a/lisp/emacs-lisp/checkdoc.el Wed Oct 21 21:28:59 2009 +0000 +++ b/lisp/emacs-lisp/checkdoc.el Wed Oct 21 22:05:34 2009 +0000 @@ -2307,15 +2307,24 @@ (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-+"))) + ;; match ";;;###autoload" cookie to keep it with the form + (require 'autoload) + (while (and cont (re-search-forward + (concat "^\\(" + (regexp-quote generate-autoload-cookie) + "\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:\""