aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lread.c b/src/lread.c
index 1dd6275684b..02b13affb6a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -50,7 +50,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#endif 50#endif
51 51
52#include <unistd.h> 52#include <unistd.h>
53#include <math.h>
54 53
55#ifdef HAVE_SETLOCALE 54#ifdef HAVE_SETLOCALE
56#include <locale.h> 55#include <locale.h>
@@ -1680,6 +1679,17 @@ readevalloop (Lisp_Object readcharfun,
1680 int whole_buffer = 0; 1679 int whole_buffer = 0;
1681 /* 1 on the first time around. */ 1680 /* 1 on the first time around. */
1682 int first_sexp = 1; 1681 int first_sexp = 1;
1682 Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
1683
1684 if (NILP (Ffboundp (macroexpand))
1685 /* Don't macroexpand in .elc files, since it should have been done
1686 already. We actually don't know whether we're in a .elc file or not,
1687 so we use circumstancial evidence: .el files normally go through
1688 Vload_source_file_function -> load-with-code-conversion
1689 -> eval-buffer. */
1690 || EQ (readcharfun, Qget_file_char)
1691 || EQ (readcharfun, Qget_emacs_mule_file_char))
1692 macroexpand = Qnil;
1683 1693
1684 if (MARKERP (readcharfun)) 1694 if (MARKERP (readcharfun))
1685 { 1695 {
@@ -1694,7 +1704,7 @@ readevalloop (Lisp_Object readcharfun,
1694 1704
1695 /* We assume START is nil when input is not from a buffer. */ 1705 /* We assume START is nil when input is not from a buffer. */
1696 if (! NILP (start) && !b) 1706 if (! NILP (start) && !b)
1697 abort (); 1707 emacs_abort ();
1698 1708
1699 specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */ 1709 specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */
1700 specbind (Qcurrent_load_list, Qnil); 1710 specbind (Qcurrent_load_list, Qnil);
@@ -1809,6 +1819,8 @@ readevalloop (Lisp_Object readcharfun,
1809 unbind_to (count1, Qnil); 1819 unbind_to (count1, Qnil);
1810 1820
1811 /* Now eval what we just read. */ 1821 /* Now eval what we just read. */
1822 if (!NILP (macroexpand))
1823 val = call1 (macroexpand, val);
1812 val = eval_sub (val); 1824 val = eval_sub (val);
1813 1825
1814 if (printflag) 1826 if (printflag)
@@ -3671,7 +3683,7 @@ intern_c_string_1 (const char *str, ptrdiff_t len)
3671 /* Creating a non-pure string from a string literal not 3683 /* Creating a non-pure string from a string literal not
3672 implemented yet. We could just use make_string here and live 3684 implemented yet. We could just use make_string here and live
3673 with the extra copy. */ 3685 with the extra copy. */
3674 abort (); 3686 emacs_abort ();
3675 3687
3676 return Fintern (make_pure_c_string (str, len), obarray); 3688 return Fintern (make_pure_c_string (str, len), obarray);
3677} 3689}