all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 24649@debbugs.gnu.org
Subject: bug#24649: 24.5; Why no standard error for "Trailing garbage following expression"?
Date: Sat, 27 Jul 2019 16:11:52 +0200	[thread overview]
Message-ID: <875znnh8if.fsf@mouse.gnus.org> (raw)
In-Reply-To: <58b6fb05-499d-4406-9bac-9c0889a588b8@default> (Drew Adams's message of "Sun, 9 Oct 2016 18:03:04 +0000 (UTC)")

Drew Adams <drew.adams@oracle.com> writes:

> Shouldn't this error be a standard error?  If not a new standard error,
> shouldn't it at least use one of the existing standard errors, such as
> `scan-error' or `invalid-read-syntax'?
>
> Otherwise, how to easily handle this error (e.g., to tell the user to
> correct the input being read and then read again)?

Makes sense to me.  I'm not sure what signal to use, though -- anybody
got an idea?

Tentative patch:

diff --git a/src/minibuf.c b/src/minibuf.c
index 14a0dbe762..f6cf47f1f2 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -169,7 +169,8 @@ string_to_object (Lisp_Object val, Lisp_Object defalt)
 	{
 	  int c = SREF (val, i);
 	  if (c != ' ' && c != '\t' && c != '\n')
-	    error ("Trailing garbage following expression");
+	    xsignal1 (Qinvalid_read_syntax,
+		      build_string ("Trailing garbage following expression"));
 	}
     }
 


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-07-27 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09 18:03 bug#24649: 24.5; Why no standard error for "Trailing garbage following expression"? Drew Adams
2019-07-27 14:11 ` Lars Ingebrigtsen [this message]
2019-08-23  0:25   ` Lars Ingebrigtsen
2019-08-23  8:06     ` Eli Zaretskii
2019-08-23  8:16       ` Lars Ingebrigtsen
2019-08-23  9:18         ` Eli Zaretskii
2019-08-23 18:43           ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=875znnh8if.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=24649@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.