From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#37034: 26.2.90; checkdoc doesn't support cl-defgeneric, cl-defmethod and cl-defun Date: Fri, 16 Aug 2019 12:26:08 -0500 Message-ID: <874l2hm37z.fsf@gmail.com> References: <877e7e280t.fsf@cassou.me> <871rxmxyvc.fsf@gmail.com> <87r25l1ehd.fsf@cassou.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="88826"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 37034@debbugs.gnu.org To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 19:27:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyg0N-000MsK-LX for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2019 19:27:11 +0200 Original-Received: from localhost ([::1]:58854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyg0M-0002Ka-Ff for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2019 13:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55489) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyg0G-0002KS-6U for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2019 13:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyg0F-00045x-0b for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2019 13:27:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyg0E-00045m-Pl for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2019 13:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hyg0E-0003Sn-1p for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2019 13:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Aug 2019 17:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37034 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37034-submit@debbugs.gnu.org id=B37034.156597638213259 (code B ref 37034); Fri, 16 Aug 2019 17:27:02 +0000 Original-Received: (at 37034) by debbugs.gnu.org; 16 Aug 2019 17:26:22 +0000 Original-Received: from localhost ([127.0.0.1]:54853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyfzY-0003Rm-0s for submit@debbugs.gnu.org; Fri, 16 Aug 2019 13:26:21 -0400 Original-Received: from mail-ot1-f43.google.com ([209.85.210.43]:40860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyfzV-0003RY-En for 37034@debbugs.gnu.org; Fri, 16 Aug 2019 13:26:18 -0400 Original-Received: by mail-ot1-f43.google.com with SMTP id c34so10281959otb.7 for <37034@debbugs.gnu.org>; Fri, 16 Aug 2019 10:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/a8wPRG6XbKG2z3iYWfEHEh7Uw3t1vilHMTznflYP4w=; b=OtXk6CJK28O4+tvBSLGP43NBWfRSqvOS4Yd9GXiQIkaWU/8b7gwDt/JfX0jGaSo3RG h1MueSeXHOBJDGd/EdPsvlAT6RYIi4fZOx75d34O7Z+Fo0aYDgvByeJ4i7zobiWb1ZYv zme2dmguPa5/3+UXnTYp8UREYIONWkuoomSlpgh2D86APFBDgn0433JuUmyARQQCQ8eo SoZI+nK8YENFqXoB7x0E2O7Eo62YjWcON+4iwRLTxk80w5iE5xzxpK6l+O3NqDcHvuWd 2C9aBkGh+q+7hd+DncC4tUS+ibHYcHX2/1qfFl8+l6p92AQJ+CDSAIfSe/SoCc5mZj8P fY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=/a8wPRG6XbKG2z3iYWfEHEh7Uw3t1vilHMTznflYP4w=; b=FaXO5VEXun/5GZjFKoVfIkwwRaoP9QmdxEj3clMXAZ/SLF5zXY2VkbYFUbhpkeHXUn 23R0qvuSf6fTXEoDRI0mVa225UcGXlMagMMxFL9Ig0mOhbFf+wNWtgCA7hAHQ1ZAwpX4 ABh0ZqtzD3ZJjjPk63h3BTg8rSSo6Uwyj0mqCgiML5KNJcT6SdpqDJpTqtoO/vBOHztm YL4hkNaMePv/8IPMgR3LzRmba4HlNo/k0xuxmEl9kdBYLiLD3dxJa0Z5EqxuEFDXf//M dqujdD6sxjF8A+wI8nJLfJQ8lao8pw+uIhGSrksFHrO7I1B1c0pbsgegO2T8Fac+Fj0V 2bIg== X-Gm-Message-State: APjAAAWIO5JyHxZhLfSx40fKaeTRAOtQIWXWhe9P4N5AF6WEH2To1Y+p ul78rJ5q0L8OEnxzcYQixMyO8VBc X-Google-Smtp-Source: APXvYqyoHzlElB+l2GAbarX6hxBUOV5PMC9zfJHO+AEijB4GSDnd15vZCq7LAdpckj/K3/iWOa55Cw== X-Received: by 2002:a9d:3f4b:: with SMTP id m69mr7029488otc.301.1565976371518; Fri, 16 Aug 2019 10:26:11 -0700 (PDT) Original-Received: from earth (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id t18sm2274510otk.73.2019.08.16.10.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 10:26:10 -0700 (PDT) In-Reply-To: <87r25l1ehd.fsf@cassou.me> (Damien Cassou's message of "Fri, 16 Aug 2019 14:28:30 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165221 Archived-At: --=-=-= Content-Type: text/plain On Fri 16 Aug 2019 at 14:28, Damien Cassou wrote: > But this crashes checkdoc+patch because it expects each element of the > parameter list to be a symbol which (entities list) is not. > > Also, CL methods accept &key and &context to specify parameters. Those > should be taken care of by checkdoc in one way or another. True, thanks for reminding me. The attached patch should take care of these two scenarios. Alex --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Make-checkdoc-check-cl-lib-function-docstrings.patch >From 9c0b32423dc95a2d66134132e21a0b59457cdb25 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Thu, 15 Aug 2019 09:51:23 -0500 Subject: [PATCH] Make checkdoc check cl-lib function docstrings * lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring) (checkdoc-defun-info): Include cl-defun, cl-defgeneric, cl-defmethod. (checkdoc-this-string-valid-engine): Add cl-lib supported keywords. (checkdoc-defun-info): Ensure function parameters are a "flat" list. bug#37034 --- lisp/emacs-lisp/checkdoc.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 830743f5f8..8c3276efb8 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -933,7 +933,8 @@ don't move point." ;; Don't bug out if the file is empty (or a ;; definition ends prematurely. (end-of-file))) - (`(,(or 'defun 'defvar 'defcustom 'defmacro 'defconst 'defsubst 'defadvice) + (`(,(or 'defun 'defvar 'defcustom 'defmacro 'defconst 'defsubst 'defadvice + 'cl-defun 'cl-defgeneric 'cl-defmethod 'cl-defmacro) ,(pred symbolp) ;; Require an initializer, i.e. ignore single-argument `defvar' ;; forms, which never have a doc string. @@ -1680,7 +1681,10 @@ function,command,variable,option or symbol." ms1)))))) (last-pos 0) (found 1) (order (and (nth 3 fp) (car (nth 3 fp)))) - (nocheck (append '("&optional" "&rest") (nth 3 fp))) + (nocheck (append '("&optional" "&rest" "&key" "&aux" + "&context" "&environment" "&whole" + "&body" "&allow-other-keys") + (nth 3 fp))) (inopts nil)) (while (and args found (> found last-pos)) (if (or (member (car args) nocheck) @@ -1885,7 +1889,8 @@ the token checkdoc-order: exists, and TOKEN is a symbol read from the comment." (save-excursion (beginning-of-defun) - (let ((defun (looking-at "(def\\(un\\|macro\\|subst\\|advice\\)")) + (let ((defun (looking-at + "(\\(?:cl-\\)?def\\(un\\|macro\\|subst\\|advice\\|generic\\|method\\)")) (is-advice (looking-at "(defadvice")) (lst nil) (ret nil) @@ -1951,7 +1956,10 @@ from the comment." ;; This is because read will intern nil if it doesn't into the ;; new obarray. (if (not (listp lst)) (setq lst nil)) - (if is-advice nil + (unless is-advice + ;; lst here can be something like ((foo bar) baz) from + ;; cl-lib methods; flatten it: + (setq lst (flatten-tree lst)) (while lst (setq ret (cons (symbol-name (car lst)) ret) lst (cdr lst))))) -- 2.22.0 --=-=-=--