Commit 68634374 authored by Kevin Ryde's avatar Kevin Ryde
Browse files

(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.)
parent 26898943
...@@ -2307,15 +2307,24 @@ Code:, and others referenced in the style guide." ...@@ -2307,15 +2307,24 @@ Code:, and others referenced in the style guide."
(or (or
;; * Code section ;; * Code section
(if (not (lm-code-mark)) (if (not (lm-code-mark))
(let ((cont t)) (let ((cont t)
pos)
(goto-char (point-min)) (goto-char (point-min))
(while (and cont (re-search-forward "^(" nil t)) ;; match ";;;###autoload" cookie to keep it with the form
(setq cont (looking-at "require\\s-+"))) (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) (if (and (not cont)
(checkdoc-y-or-n-p (checkdoc-y-or-n-p
"There is no ;;; Code: marker. Insert one? ")) "There is no ;;; Code: marker. Insert one? "))
(progn (beginning-of-line) (progn (goto-char pos)
(insert ";;; Code:\n") (insert ";;; Code:\n\n")
nil) nil)
(checkdoc-create-error (checkdoc-create-error
"You should have a section marked \";;; Code:\"" "You should have a section marked \";;; Code:\""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment