From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#4612: 23.1; checkdoc insert ";;; Code" before autoload cookie Date: Fri, 02 Oct 2009 10:10:04 +1000 Message-ID: <87ljju7j1f.fsf@blah.blah> Reply-To: Kevin Ryde , 4612@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1254443261 5244 80.91.229.12 (2 Oct 2009 00:27:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 00:27:41 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 02 02:27:34 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MtVzh-0000gn-Fs for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 02:27:33 +0200 Original-Received: from localhost ([127.0.0.1]:60808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtVzg-0000to-Uz for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2009 20:27:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtVzQ-0000iC-9F for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:27:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtVzL-0000eT-1s for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:27:15 -0400 Original-Received: from [199.232.76.173] (port=53842 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtVzK-0000eJ-Oi for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:27:10 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51550) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtVzK-0007Vy-8t for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:27:10 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n920R7nv029519; Thu, 1 Oct 2009 17:27:07 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n920F7jK027648; Thu, 1 Oct 2009 17:15:07 -0700 Resent-Date: Thu, 1 Oct 2009 17:15:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 02 Oct 2009 00:15:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4612 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125444225127461 (code B ref -1); Fri, 02 Oct 2009 00:15:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 2 Oct 2009 00:10:51 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n920AnZn027457 for ; Thu, 1 Oct 2009 17:10:50 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtVjU-00072Z-Ne for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:10:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtVjQ-0006td-ET for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:10:48 -0400 Original-Received: from [199.232.76.173] (port=43969 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtVjQ-0006tP-BL for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:10:44 -0400 Original-Received: from mailout1-1.pacific.net.au ([61.8.2.208]:48533 helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtVjM-0005Sw-QE for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:10:41 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 5325D50720C for ; Fri, 2 Oct 2009 10:10:33 +1000 (EST) Original-Received: from blah.blah (ppp24D8.dyn.pacific.net.au [61.8.36.216]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 5FB5A8C18 for ; Fri, 2 Oct 2009 10:10:32 +1000 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MtVin-0006Px-8z for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 10:10:05 +1000 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 01 Oct 2009 20:27:15 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31626 Archived-At: --=-=-= On foo.el below M-x checkdoc inserts ";;; Code" as ;;;###autoload ;;; Code: (defun foo () where I hoped it would be before the cookie like say ;;; Code: ;;;###autoload (defun foo () generate-file-autoloads etc is happy with either, but the latter reads better for humans. I struck this in one of my own .el files which had an autoload cookie on the first func. Incidentally, I see the `cont' loop puts ";;; Code" after any initial `require' forms. Is that actually usual, or usual any more? I think I've only ever seen `require's after ";;; Code". 2009-10-01 Kevin Ryde * emacs-lisp/checkdoc.el (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. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=foo.el Content-Transfer-Encoding: quoted-printable ;;; foo.el --- do something ;;; Commentary: ;;=20 ;;; History: ;;=20 ;;;###autoload (defun foo () "This is foo." (message "foo")) (provide 'foo) ;;; foo.el ends here --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=checkdoc.el.code-autoload.diff --- 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:\"" --=-=-= In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-09-14 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t --=-=-=--