]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/lread.c (readevalloop): Use filename to decide macroexpansion
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 15 Feb 2019 23:02:40 +0000 (18:02 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 15 Feb 2019 23:02:40 +0000 (18:02 -0500)
src/lread.c

index ff9b75475b8409f20b823a76e255a41591cb067c..ddef135687febebba8f784844728d9b3b6ca1eda 100644 (file)
@@ -1932,13 +1932,12 @@ readevalloop (Lisp_Object readcharfun,
   Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
 
   if (NILP (Ffboundp (macroexpand))
-      /* Don't macroexpand in .elc files, since it should have been done
-        already.  We actually don't know whether we're in a .elc file or not,
-        so we use circumstantial evidence: .el files normally go through
-        Vload_source_file_function -> load-with-code-conversion
-        -> eval-buffer.  */
-      || EQ (readcharfun, Qget_file_char)
-      || EQ (readcharfun, Qget_emacs_mule_file_char))
+      || (STRINGP (sourcename)
+          && SBYTES (sourcename) >= 4
+          && !strcmp (".elc", SSDATA (sourcename) + SBYTES (sourcename) - 4)))
+    /* Don't macroexpand before the corresponding function is defined
+       and don't bother macroexpanding in .elc files, since it should have
+       been done already.  */
     macroexpand = Qnil;
 
   if (MARKERP (readcharfun))