all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: 28759@debbugs.gnu.org
Subject: bug#28759: 26.0.60; Bovine apparently generates Elisp code with oldstyle backquotes
Date: Sun, 29 Oct 2017 19:38:35 +0000	[thread overview]
Message-ID: <CAArVCkQm3pDXZfbqdyvdJstxPE=1fYW7r3ZYZBQ7PVrFZnYcEA@mail.gmail.com> (raw)
In-Reply-To: <CAArVCkQdc2NL107skb=mVhMh=NGupO3owTfBeJXkRrE+=DcPYw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1791 bytes --]

Philipp Stephani <p.stephani2@gmail.com> schrieb am So., 15. Okt. 2017 um
21:41 Uhr:

> Philipp <p.stephani2@gmail.com> schrieb am Mo., 9. Okt. 2017 um 16:20 Uhr:
>
>>
>> See https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00313.html
>>
>> The backtrace I got was
>>
>> $ (cd admin/grammars && EMACSLOADPATH= "../../src/emacs" -batch
>> --no-site-file --no-site-lisp -eval '(setq debug-on-error t)' -l
>> semantic/bovine/grammar  -f bovine-batch-make-parser -o
>> "../../lisp/cedet/semantic/bovine/make-by.el" make.by)
>> ../../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.
>> Debugger entered--Lisp error: (error "Loading ‘nil’: old-style backquotes
>> detected!")
>>   read("( ,@$2 )")
>>
>
> I looked a bit around, and found that these strings are copied verbatim
> from the *.by files.
> Looking at the comments of lread.c, this seems to be a limitation of the
> reader: "Because it's more difficult to peek 2 chars ahead, a new-style ,@
> can still not be used outside of a `, unless it's in the middle of a list."
> Not sure what to do with this, though. Changing the reader would introduce
> a breaking change for no good reason, since we're trying to get rid of
> old-style backquotes. So I think this should rather be fixed in Bovine,
> either by escaping the offending commas, or by removing the space between (
> and ,.
>

Here is a minimal patch.

[-- Attachment #1.2: Type: text/html, Size: 2616 bytes --]

[-- Attachment #2: 0001-Work-around-reader-limitations-for-old-style-backquote.txt --]
[-- Type: text/plain, Size: 1372 bytes --]

From 0ac030d1526ee7d7c3bf49a22cdaf4b177a98210 Mon Sep 17 00:00:00 2001
From: Philipp Stephani <phst@google.com>
Date: Sun, 15 Oct 2017 21:32:17 +0200
Subject: [PATCH] Work around reader limitations for old-style backquotes.

See Bug#28759.

* admin/grammars/make.by: Escape ,@ to avoid old-style backquote
detection
---
 admin/grammars/make.by | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/admin/grammars/make.by b/admin/grammars/make.by
index d3a03ead47..4d029186d8 100644
--- a/admin/grammars/make.by
+++ b/admin/grammars/make.by
@@ -54,15 +54,20 @@
 
 %%
 
+;; Escape the ,@ below because the reader doesn't correctly detect
+;; old-style backquotes for this case.  The backslashes can be removed
+;; once old-style backquotes are completely gone (probably in
+;; Emacs 28).
+
 Makefile : bol newline (nil)
 	 | bol variable
-	   ( ,@$2 )
+	   ( \,@$2 )
 	 | bol rule
-	   ( ,@$2 )
+	   ( \,@$2 )
 	 | bol conditional
-	   ( ,@$2 )
+	   ( \,@$2 )
 	 | bol include
-	   ( ,@$2 )
+	   ( \,@$2 )
 	 | whitespace ( nil )
 	 | newline ( nil )
 	 ;
@@ -125,13 +130,13 @@ colons: COLON COLON ()
       ;
 
 element-list: elements newline
-	      ( ,@$1 )
+	      ( \,@$1 )
 	    ;
 
 elements: element some-whitespace elements
-	  ( ,@$1 ,@$3 )
+	  ( \,@$1 ,@$3 )
 	| element
-	  ( ,@$1 )
+	  ( \,@$1 )
 	| ;;EMPTY
 	;
 
-- 
2.14.2


  reply	other threads:[~2017-10-29 19:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 14:19 bug#28759: 26.0.60; Bovine apparently generates Elisp code with oldstyle backquotes Philipp
2017-10-15 19:41 ` Philipp Stephani
2017-10-29 19:38   ` Philipp Stephani [this message]
2017-12-09 20:17     ` Philipp Stephani

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='CAArVCkQm3pDXZfbqdyvdJstxPE=1fYW7r3ZYZBQ7PVrFZnYcEA@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=28759@debbugs.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 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.