--- Begin Message ---
Subject: |
24.3.50; Eager macro-expansion failure: (void-variable ruby-syntax-methods-before-regexp) when ruby-mode is not compiled |
Date: |
Sat, 02 Feb 2013 01:25:57 +0400 |
This applies both to trunk and emacs-24.
ruby-mode compiles without warnings, and ruby-syntax-propertize-function
works fine either way, but when ruby-mode is not compiled, it shows the
subject warning upon loading, and ruby-syntax-propertize-function is an
order of magnitude slower (not very noticeable in the simple cased, though),
due to syntax-propertize-rules not being expanded.
The constant in question is defined in an `eval-and-compile' block, I
can't see what else could the interpreter need. Help?
In GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.0)
of 2013-01-27 on vbx
Bzr revision: 111609 address@hidden
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System Description: Ubuntu 12.10
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#13605: 24.3.50; Eager macro-expansion failure: (void-variable ruby-syntax-methods-before-regexp) when ruby-mode is not compiled |
Date: |
Fri, 08 Feb 2013 11:18:42 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>>> Maybe the better way to fix it (for trunk) is to change eval-and-compile
>>> (and probably eval-when-compile) so that it evaluates its argument during
>>> macro-expansion.
I've installed the patch below which fixes this problem and hopefully
won't introduce others.
Stefan
=== modified file 'lisp/emacs-lisp/byte-run.el'
--- lisp/emacs-lisp/byte-run.el 2013-01-03 02:37:57 +0000
+++ lisp/emacs-lisp/byte-run.el 2013-02-08 16:13:13 +0000
@@ -392,15 +392,15 @@
Thus, the result of the body appears to the compiler as a quoted constant.
In interpreted code, this is entirely equivalent to `progn'."
(declare (debug t) (indent 0))
- ;; Not necessary because we have it in b-c-initial-macro-environment
- ;; (list 'quote (eval (cons 'progn body)))
- (cons 'progn body))
+ (list 'quote (eval (cons 'progn body) lexical-binding)))
(defmacro eval-and-compile (&rest body)
"Like `progn', but evaluates the body at compile time and at load time."
(declare (debug t) (indent 0))
- ;; Remember, it's magic.
- (cons 'progn body))
+ ;; When the byte-compiler expands code, this macro is not used, so we're
+ ;; either about to run `body' (plain interpretation) or we're doing eager
+ ;; macroexpansion.
+ (list 'quote (eval (cons 'progn body) lexical-binding)))
(put 'with-no-warnings 'lisp-indent-function 0)
(defun with-no-warnings (&rest body)
--- End Message ---