From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#56968: Incorrect definition prefix "my-" assigned to battery.el in ldefs-boot.el Date: Thu, 04 Aug 2022 11:01:16 +0200 Message-ID: <87r11widr7.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28737"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56968@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 04 11:02:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oJWkF-0007M2-Lt for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 11:02:19 +0200 Original-Received: from localhost ([::1]:48176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJWkE-0002mi-Op for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 05:02:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJWjy-0002la-HV for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 05:02:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJWjy-0001aD-89 for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 05:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJWjy-0002AQ-0E for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 05:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2022 09:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56968 X-GNU-PR-Package: emacs Original-Received: via spool by 56968-submit@debbugs.gnu.org id=B56968.16596036948297 (code B ref 56968); Thu, 04 Aug 2022 09:02:01 +0000 Original-Received: (at 56968) by debbugs.gnu.org; 4 Aug 2022 09:01:34 +0000 Original-Received: from localhost ([127.0.0.1]:51136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJWjW-00029k-BD for submit@debbugs.gnu.org; Thu, 04 Aug 2022 05:01:34 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:50060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJWjU-00029V-5A for 56968@debbugs.gnu.org; Thu, 04 Aug 2022 05:01:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Ohy63NQYPaCRpPyyqbsOualE9Mrk36jA5Z6N0tWZbCM=; b=cRtsLDiYdWVdq8WgYdfZdr637F vP6WrFstZmZiqLsXmsY1xJMJfAGdevkjUa3eUkG9VTWY4R+OeocYWZOvc9OiquoCGt4h86qoQmXy6 5konJD4E8ttiO4ErUjMcBLb8frt/rK4GuY22JnJ3PUwqlYCKr6SF8ZQpdXvQEyGvc/Ac=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJWjH-00053y-IJ; Thu, 04 Aug 2022 11:01:25 +0200 In-Reply-To: (Stefan Kangas's message of "Thu, 4 Aug 2022 08:33:49 +0000") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEX7+/stKCjV1dSH g3NcWE8MBwmxsKX///8fuVgaAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YIBAg6JkpshJUAAAF+SURB VDjL7ZOxcoMwDIZ9vIEO3JkY6p1g2Ckxuy9W50CI3/8RKtm0Sblk6tqfQYc+6ZcwIMS/9oKkwxar ZoDTCaAUmPS+xQoGLCTiRaDvjGTgqJ7AAEiBgJ/aOXbk5IFYo0SH6AisICMYJXvMm+VFgEd5lgSo 3EcACRSDN4Y7ij1YxzfrCNA9mScrR+va6Rps4XgrCd8AB5oxVmMn8RYLCbgIJFuFvGncjbOpw/cd g08dcmPdyrsmcFQHHu5OH6Pp8BAfK4LT2jAwZrAe+EgcxA5v2hbhIiSJ3OkQ+zBHUE06AsB0JLiw 9+xc29eOAN4Bd9QIue7icBsBFRdjg44AjjaCJh4OAQSQvqbV8lXyi0LqYUBLFfJcF9Yfl6vlGfkP APR6MVPQS0XvfDByAxyV6pVSOhDw9vFjoFwISl9LEfrA0iGppHpVZkoIpUSWlayMoyJSqgSe6jfI XgH1d5Dt0+X2K2RPs/v8I9nUvvq5noKHde7iGXpRdC1kv434ApdpsKWK9rESAAAAJXRFWHRkYXRl OmNyZWF0ZQAyMDIyLTA4LTA0VDA4OjU4OjM4KzAwOjAwer+ILwAAACV0RVh0ZGF0ZTptb2RpZnkA MjAyMi0wOC0wNFQwODo1ODozOCswMDowMAviMJMAAAAASUVORK5CYII= X-Now-Playing: Genesis's _The Lamb Lies Down On Broadway (2)_: "The Lamia" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238702 Archived-At: Stefan Kangas writes: > Severity: minor > > I see in ldefs-boot.el: > > (register-definition-prefixes "battery" '("battery-" "my-")) > > However, in battery.el, the "my-" prefix only ever shows up inside a > docstring. That seems like a bug. > > AFAICT, this doesn't happen in emacs-28, so this might be a regression. The (defun my- in battery.el is new in Emacs 29, so it's not a regression exactly -- it's why we're doing \( in all doc strings that have lines that start with (def. I briefly wondered whether we could usefully warn about this with something like the below, but I don't think so, since by the time we're called where, we've already read the \( into (, so there's too many false positives. So I've just fixed up the existing errors here instead. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 7d2971502d..d8255b2584 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -294,7 +294,8 @@ byte-compile-warning-types '(redefine callargs free-vars unresolved obsolete noruntime interactive-only make-local mapcar constants suspicious lexical lexical-dynamic - docstrings docstrings-non-ascii-quotes not-unused) + docstrings docstrings-non-ascii-quotes not-unused + docstrings-defthings) "The list of warning types used when `byte-compile-warnings' is t.") (defcustom byte-compile-warnings t "List of warnings that the byte-compiler should issue (t for almost all). @@ -338,7 +339,8 @@ byte-compile-warnings byte-compile-warning-types)))) =20 (defconst byte-compile--emacs-build-warning-types - '(docstrings-non-ascii-quotes) + '(docstrings-non-ascii-quotes + docstrings-defthings) "List of warning types that are only enabled during Emacs builds. This is typically either warning types that are being phased in (but shouldn't be enabled for packages yet), or that are only relevant @@ -1770,6 +1772,13 @@ byte-compile-docstring-style-warn (when (string-match-p "\\( \"\\|[ \t]\\|^\\)[=E2=80=98=E2=80=99]= " docs) (byte-compile-warn-x name "%s%sdocstring has wrong usage of \"fancy\" single quota= tion marks" + kind name))) + ;; There's a "(def" in the first column. This will typically + ;; lead to wrong `register-definition-prefixes'. + (when (byte-compile-warning-enabled-p 'docstrings-defthings) + (when (string-match-p "^(def" docs) + (byte-compile-warn-x + name "%s%sdocstring has a \"(def\" form in the first column" kind name)))))) form) =20