* bug#36988: 26.2; Error "Non-hex digit used for Unicode escape" is not too helpful
@ 2019-08-09 16:25 Drew Adams
2019-08-23 4:21 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2019-08-09 16:25 UTC (permalink / raw)
To: 36988
emacs -Q
Put this text in *scratch*, then move point to bob:
"\u2"
Then evaluate (read (current-buffer)). You get this error:
Debugger entered--Lisp error: (error "Non-hex digit used for Unicode escape")
read(#<buffer *scratch*>)
eval((read (current-buffer)) nil)
eval-expression((read (current-buffer)) nil nil 127)
funcall-interactively(eval-expression (read (current-buffer)) nil nil 127)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)
Dunno what the right fix/enhancement is, but this error message does not
seem very helpful in this case.
FWIW, I stumbled on this when code tried to read some Lisp code that
contained an MS Windows absolute file name where the backslashes were
not escaped, such as "C:\Users\foo.html". It would have been nice if a
better error message could have been presented to the user in such a
case.
Perhaps there could be some way to point more or less to the offensive
"Non-hex digit used for Unicode escape"? In this case, the offense was
apparently committed by the \u.
In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
of 2019-04-13
Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749
Windowing system distributor `Microsoft Corp.', version 10.0.17763
Configured using:
`configure --without-dbus --host=x86_64-w64-mingw32
--without-compress-install 'CFLAGS=-O2 -static -g3''
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#36988: 26.2; Error "Non-hex digit used for Unicode escape" is not too helpful
2019-08-09 16:25 bug#36988: 26.2; Error "Non-hex digit used for Unicode escape" is not too helpful Drew Adams
@ 2019-08-23 4:21 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-23 4:21 UTC (permalink / raw)
To: Drew Adams; +Cc: 36988
Drew Adams <drew.adams@oracle.com> writes:
> emacs -Q
>
> Put this text in *scratch*, then move point to bob:
>
> "\u2"
>
> Then evaluate (read (current-buffer)). You get this error:
>
> Debugger entered--Lisp error: (error "Non-hex digit used for Unicode escape")
> read(#<buffer *scratch*>)
> eval((read (current-buffer)) nil)
> eval-expression((read (current-buffer)) nil nil 127)
> funcall-interactively(eval-expression (read (current-buffer)) nil nil 127)
> call-interactively(eval-expression nil nil)
> command-execute(eval-expression)
[...]
> Perhaps there could be some way to point more or less to the offensive
> "Non-hex digit used for Unicode escape"? In this case, the offense was
> apparently committed by the \u.
No, the quote mark.
I've now changed this error message to be a bit more helpful:
Non-hex character used for Unicode escape: " (34)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-23 4:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-09 16:25 bug#36988: 26.2; Error "Non-hex digit used for Unicode escape" is not too helpful Drew Adams
2019-08-23 4:21 ` Lars Ingebrigtsen
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.