unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 50658@debbugs.gnu.org
Subject: bug#50658: Error messages including function names violates coding conventions
Date: Mon, 27 Sep 2021 16:25:09 -0700	[thread overview]
Message-ID: <CADwFkmmRkQc_7jWKAKQfd1i1US0Mmb_k_V-Ds50jFfoR2eNcGQ@mail.gmail.com> (raw)
In-Reply-To: <83h7ei53pr.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> Perhaps we could add a requirement here, something like: a Lisp symbol
>> must always be in `quotes', or behind ": "?
>
> Yes, I think the idea is that the error message proper starts after
> the colon.
>
>> (I guess this would also affect the text we want to put in `(elisp)
>> Documentation Tips'.)
>
> Yes.

Please find attached a patch.  WDYT?  Too wordy?

[-- Attachment #2: 0001-Improve-coding-conventions-for-error-messages.patch --]
[-- Type: text/x-diff, Size: 1218 bytes --]

From 522ff5074033208da5470ea418bc27777cfcc220 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Mon, 27 Sep 2021 23:34:36 +0200
Subject: [PATCH] Improve coding conventions for error messages

* doc/lispref/tips.texi (Programming Tips): Clarify coding
conventions for error messages to say that an error message can
start with a Lisp symbol.  (Bug#50658)
---
 doc/lispref/tips.texi | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index e56ddf3c28..2eb6c78212 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -393,7 +393,13 @@ Programming Tips
 
 @item
 An error message should start with a capital letter but should not end
-with a period.
+with a period or other punctuation.
+
+It is occasionally useful to tell the user where an error originated,
+even if @code{debug-on-error} is nil.  In such cases, a lower-case
+Lisp symbol can be added to the error message.  For example, the error
+message ``Invalid input'' could be extended say ``some-function:
+Invalid input''.  This convention is better avoided in most cases.
 
 @item
 A question asked in the minibuffer with @code{yes-or-no-p} or
-- 
2.30.2


  reply	other threads:[~2021-09-27 23:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18 10:52 bug#50658: Error messages including function names violates coding conventions Stefan Kangas
2021-09-18 11:08 ` Eli Zaretskii
2021-09-18 11:58   ` Stefan Kangas
2021-09-18 12:02     ` Eli Zaretskii
2021-09-18 12:49       ` Stefan Kangas
2021-09-18 13:25         ` Eli Zaretskii
2021-09-18 14:54   ` Stefan Kangas
2021-09-18 15:00     ` Eli Zaretskii
2021-09-27 23:25       ` Stefan Kangas [this message]
2021-09-28  5:54         ` Eli Zaretskii
2021-09-28 12:11           ` Stefan Kangas
2021-09-28 12:28             ` Eli Zaretskii
2021-09-28 12:59               ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmmRkQc_7jWKAKQfd1i1US0Mmb_k_V-Ds50jFfoR2eNcGQ@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=50658@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).