bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24649: 24.5; Why no standard error for "Trailing garbage following e


From: Lars Ingebrigtsen
Subject: bug#24649: 24.5; Why no standard error for "Trailing garbage following expression"?
Date: Sat, 27 Jul 2019 16:11:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]