From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#50658: Error messages including function names violates coding conventions Date: Sat, 18 Sep 2021 03:52:54 -0700 Message-ID: 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="33892"; mail-complaints-to="usenet@ciao.gmane.io" To: 50658@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 18 12:53:24 2021 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 1mRXyG-0008ev-80 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 12:53:24 +0200 Original-Received: from localhost ([::1]:45394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRXyE-0001YE-Mj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 06:53:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRXxu-0001AI-QZ for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 06:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRXxu-0005pb-IE for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 06:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mRXxu-0007mv-BG for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 06:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Sep 2021 10:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50658 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163196238129932 (code B ref -1); Sat, 18 Sep 2021 10:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Sep 2021 10:53:01 +0000 Original-Received: from localhost ([127.0.0.1]:33653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRXxt-0007mc-Ai for submit@debbugs.gnu.org; Sat, 18 Sep 2021 06:53:01 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRXxp-0007mS-JC for submit@debbugs.gnu.org; Sat, 18 Sep 2021 06:52:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRXxp-00011w-9e for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 06:52:57 -0400 Original-Received: from mail-pl1-f174.google.com ([209.85.214.174]:41659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRXxn-0005jl-Sb for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 06:52:57 -0400 Original-Received: by mail-pl1-f174.google.com with SMTP id v2so7873515plp.8 for ; Sat, 18 Sep 2021 03:52:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to :content-transfer-encoding; bh=qx+gZ7eWQsN0cr/VGCtobBybdiIoHfeWBnf/eP33kqI=; b=CSzYQQEs2NAS+xpal86FemhMSugDCLbXPnUEOblbeGXYikReqvhJUwoVy2d5WtWEQJ vIn0jsQan59MokGy1pJQ+oZvsqi+PS5nAxTsijju3xGUecI3ZyKFPgTXtqlQWK0il0i+ 6YG/S1uwIzvRVk2U1cMCEtOE/r3++dwUegHOgsJhuya7LT7VlP/0u+H2B1gjtGnPb1U5 ETK6mgztAbdxC0xN1gDHOLCHE/WQsqkjhD9EAeo9m4M0ll+PzIYtNJ1rpmg+tD90IcRH HbjBzl3SAVOWav7dCVTo6xPFm3+cUbRoVSrCrCqYKpYdViLHFij6JvcZRwou6cYPBiwe lEeA== X-Gm-Message-State: AOAM531A9EQALtoJFEvkLVoagbDoanGKHV92XKj1rzB61W6yrgrwwwPI 65FVOYEha0O/gwjG/nptHoexMoCt2Gx2UD3Pv2lGoidS X-Google-Smtp-Source: ABdhPJwG3Juby2QBjrCYaiQBx4G5kp98mICrLeU7GoClfggP9cCaxpJGIkEs1MMKfXEHtRd/v7sEeHV+xh5IVBcTU4E= X-Received: by 2002:a17:903:189:b0:13d:965f:e83f with SMTP id z9-20020a170903018900b0013d965fe83fmr4411169plg.32.1631962374491; Sat, 18 Sep 2021 03:52:54 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 18 Sep 2021 03:52:54 -0700 Received-SPF: pass client-ip=209.85.214.174; envelope-from=stefankangas@gmail.com; helo=mail-pl1-f174.google.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_20=-0.001, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:214614 Archived-At: Severity: minor We currently have a whole lot of places in Emacs where the error message include the function name that they come from, such as: (error "ad-read-advised-function: There are no advised functions") This violates our coding convention in `(elisp) Programming Tips': =E2=80=A2 An error message should start with a capital letter but should= not end with a period. These cases are all flagged by checkdoc when it tries to enforce the above convention. Fixing all these according to our current conventions would in the above case mean that it should say: (error "There are no advised functions") Unfortunately, this might lose some pertinent information (the function name) if the user is running with `debug-on-error' off. Do we care about that? If we don't care, we should just make the above change, and there is nothing more to discuss. If we do care, I see three options: 1. We decide on some format for how to type out the function name that does not put it at the start of the message (since that violates the coding convention), and then we document that to be the convention. 2. We modify the above coding convention to say that including the function name at the start is okay. Presumably this includes updating checkdoc to check that it is actually the function name that is used (or perhaps to just accept any symbol). 3. We add some way of displaying the function name in the error message without having to type it out.