GNU bug report logs - #50658
Error messages including function names violates coding conventions

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sat, 18 Sep 2021 10:53:02 UTC

Severity: minor

Tags: fixed

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: 50658 <at> debbugs.gnu.org
Subject: bug#50658: Error messages including function names violates coding conventions
Date: Sat, 18 Sep 2021 03:52:54 -0700
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':

   • 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.




This bug report was last modified 3 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.