From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Silence checkdoc for symbols designating major and minor modes Date: Tue, 27 Jul 2021 21:50:43 +0000 Message-ID: <87k0lbfmto.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1156"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 27 23:51:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8UzK-000AdK-LS for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 23:51:46 +0200 Original-Received: from localhost ([::1]:40772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8UzJ-0003fh-DO for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 17:51:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8UyT-0002x9-VY for emacs-devel@gnu.org; Tue, 27 Jul 2021 17:50:54 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:41355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8UyQ-00032B-BA for emacs-devel@gnu.org; Tue, 27 Jul 2021 17:50:53 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 7AAE0240026 for ; Tue, 27 Jul 2021 23:50:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1627422645; bh=cnxRZivYZyVt27BEZU52UBLC01tTiOarXe+uHfa9V1U=; h=From:To:Subject:Autocrypt:Date:From; b=qL7BM1CbInsPcuQhmUxNv6jdhG5LL9uMZxLZG7N6W8khHyJgePwLAvdfLh9nxlgfd qYAW1Leb4AZhxtQ5TP2fpYFB7KYRxo3cW8GpIK5cTN977cmzZy/1a9iROOcimaXDYh GVAVGl2WNgSbBZV/ihcYjw+rIrhkuSoRbTl8OXaklhTtM9N8KSgvzRArBQvYfJgJfc 1F7yKVBq+bzbWBh/WoinRxdngTxED7RTiGqwjsG9md5/S7BA12A5mEt0VKEWlMds45 0HKPBGZzS2+WqaEHTkx5QVykTzcxX1Mmk3DdzjbSdosmtl7FnLlPfQHJbct/KQLBdI aQNi2Bkw/3tUw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GZ9TJ1jTkz6tmR for ; Tue, 27 Jul 2021 23:50:43 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271707 Archived-At: --=-=-= Content-Type: text/plain Hi, an issue I have been having when documenting code is that checkdoc wants me to disambiguate symbols referring to major or minor modes. That usually means adding "function", "command" "variable", "option" or "symbol" but in my experience these usually do not fit. In fact, most of the time it is obvious what is meant when referring to a major/minor mode. ... Foo when `bar-mode' is active ... The patch I added below silences the disambiguation request when a symbol ends in "-mode". Alternatively, one could also add a "minor mode" and "major mode" to the list of accepted keywords, but I think that would sound to repetitive: ... Foo when minor mode `bar-mode' is active ... Opinions? -- Philip K. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Ignore-ambiguous-symbols-that-end-in-mode.patch >From afbfcec6f0da120c99ff1ff3e0355544c768cb8c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 27 Jul 2021 23:43:13 +0200 Subject: [PATCH] Ignore ambiguous symbols that end in "-mode" * checkdoc.el (checkdoc-this-string-valid-engine): Check if bound and fbound symbol ends in "-mode" --- lisp/emacs-lisp/checkdoc.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 00cc7777e1..9831a5aa06 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1559,6 +1559,7 @@ checkdoc-this-string-valid-engine (setq mb (match-beginning 1) me (match-end 1)) (if (and sym (boundp sym) (fboundp sym) + (not (string-match-p "-mode\\'" (symbol-name sym))) (save-excursion (goto-char mb) (forward-word-strictly -1) -- 2.30.2 --=-=-=--