[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/emacs-lisp checkdoc.el
From: |
Kevin Ryde |
Subject: |
[Emacs-diffs] emacs/lisp/emacs-lisp checkdoc.el |
Date: |
Wed, 21 Oct 2009 22:05:34 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Kevin Ryde <kryde> 09/10/21 22:05:34
Modified files:
lisp/emacs-lisp: checkdoc.el
Log message:
(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.)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/checkdoc.el?cvsroot=emacs&r1=1.75&r2=1.76
Patches:
Index: checkdoc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/checkdoc.el,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -b -r1.75 -r1.76
--- checkdoc.el 2 Oct 2009 03:48:43 -0000 1.75
+++ checkdoc.el 21 Oct 2009 22:05:34 -0000 1.76
@@ -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:\""
- [Emacs-diffs] emacs/lisp/emacs-lisp checkdoc.el,
Kevin Ryde <=