Re: master 9613690: Raise an error when detecting old-style backquotes.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: master 9613690: Raise an error when detecting old-style backquotes.

Mark Oteiza

[hidden email] (Philipp Stephani) writes:

>     Raise an error when detecting old-style backquotes.

I see the following when building master

make -C ../admin/grammars all EMACS="../../src/emacs"
make[2]: Entering directory '/tmp/makepkg/emacs-git/src/emacs/admin/grammars'
  GEN      ../../lisp/cedet/semantic/bovine/make-by.el
../../lisp/emacs-lisp/eieio.el: ‘eieio-object-name-string’ is an obsolete generic function (as of 25.1); use ‘eieio-named’ instead.
../../lisp/emacs-lisp/eieio.el: ‘object-print’ is an obsolete generic function (as of 26.1); use ‘cl-print-object’ instead.
../../lisp/emacs-lisp/eieio-base.el: ‘eieio-object-name-string’ is an obsolete generic function (as of 25.1); use ‘eieio-named’ instead.
Loading ‘nil’: old-style backquotes detected!
make[2]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/admin/grammars'
make[2]: Entering directory '/tmp/makepkg/emacs-git/src/emacs/lisp'
  ELC      cedet/semantic/bovine/make.elc
../../../emacs-lisp/eieio.el: ‘eieio-object-name-string’ is an obsolete generic function (as of 25.1); use ‘eieio-named’ instead.
../../../emacs-lisp/eieio.el: ‘object-print’ is an obsolete generic function (as of 26.1); use ‘cl-print-object’ instead.

In toplevel form:
cedet/semantic/bovine/make.el:31:1:Error: Cannot open load file: No such file or directory, semantic/bovine/make-by
make[2]: *** [Makefile:297: cedet/semantic/bovine/make.elc] Error 1
make[2]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/lisp'
make[1]: *** [Makefile:320: compile-main] Error 2
make[1]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/lisp'
make: *** [Makefile:403: lisp] Error 2


Reply | Threaded
Open this post in threaded view
|

Re: master 9613690: Raise an error when detecting old-style backquotes.

Philipp Stephani-2


Mark Oteiza <[hidden email]> schrieb am Mo., 9. Okt. 2017 um 13:56 Uhr:

[hidden email] (Philipp Stephani) writes:

>     Raise an error when detecting old-style backquotes.

I see the following when building master

make -C ../admin/grammars all EMACS="../../src/emacs"
make[2]: Entering directory '/tmp/makepkg/emacs-git/src/emacs/admin/grammars'
  GEN      ../../lisp/cedet/semantic/bovine/make-by.el
../../lisp/emacs-lisp/eieio.el: ‘eieio-object-name-string’ is an obsolete generic function (as of 25.1); use ‘eieio-named’ instead.
../../lisp/emacs-lisp/eieio.el: ‘object-print’ is an obsolete generic function (as of 26.1); use ‘cl-print-object’ instead.
../../lisp/emacs-lisp/eieio-base.el: ‘eieio-object-name-string’ is an obsolete generic function (as of 25.1); use ‘eieio-named’ instead.
Loading ‘nil’: old-style backquotes detected!
make[2]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/admin/grammars'
make[2]: Entering directory '/tmp/makepkg/emacs-git/src/emacs/lisp'
  ELC      cedet/semantic/bovine/make.elc
../../../emacs-lisp/eieio.el: ‘eieio-object-name-string’ is an obsolete generic function (as of 25.1); use ‘eieio-named’ instead.
../../../emacs-lisp/eieio.el: ‘object-print’ is an obsolete generic function (as of 26.1); use ‘cl-print-object’ instead.

In toplevel form:
cedet/semantic/bovine/make.el:31:1:Error: Cannot open load file: No such file or directory, semantic/bovine/make-by
make[2]: *** [Makefile:297: cedet/semantic/bovine/make.elc] Error 1
make[2]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/lisp'
make[1]: *** [Makefile:320: compile-main] Error 2
make[1]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/lisp'
make: *** [Makefile:403: lisp] Error 2


:-(
I've reverted the commit, but this should really be fixed. Apparently Bovine generates incorrect code. 
--

Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

If you received this communication by mistake, please don't forward it to anyone else (it may contain confidential or privileged information), please erase all copies of it, including all attachments, and please let the sender know it went to the wrong person. Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: master 9613690: Raise an error when detecting old-style backquotes.

Stefan Monnier
> I've reverted the commit, but this should really be fixed. Apparently
> Bovine generates incorrect code.

Bovine uses the Lisp reader to `read` things like "( ,@$2 )" and "( foo
,$1 (car ,@$2) )".  AFAICT it was designed for the old-style unquotes, but
it's been tweaked to work correctly when those commas are treated as
new-style unquotes.

The patch below seems to work around this problem.  Of course, as
mentioned in another email, just always interpreting those unquotes as
new-style works just as well (and with cleaner semantics).


        Stefan


diff --git a/src/lread.c b/src/lread.c
index c073fc4ce6..75c7e3ee55 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2667,13 +2667,17 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
 {
   int c;
   bool uninterned_symbol = false;
+  bool went_through_retry = false;
   bool multibyte;
   char stackbuf[MAX_ALLOCA];
   current_thread->stack_top = stackbuf;
 
   *pch = 0;
 
+  goto skipretry;
  retry:
+  went_through_retry = true;
+ skipretry:
 
   c = READCHAR_REPORT_MULTIBYTE (&multibyte);
   if (c < 0)
@@ -3202,6 +3206,9 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
    of a list.  */
  if (new_backquote_flag
     || !first_in_list
+            /* If there was some separation (space, comment, ....) between the
+               `(` and the `,`, we consider this is a new-style unquote.  */
+            || went_through_retry
     || (next_char != ' ' && next_char != '@'))
   {
     Lisp_Object comma_type = Qnil;