aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2015-02-12 18:20:12 -0800
committerPaul Eggert2015-02-12 18:21:32 -0800
commit65563fd7714271582d5146c09202c0f7a0631fe5 (patch)
tree3da5c2a4dec51d8d53f1b8cc7b7de072bd2577d9 /lib-src
parente39d96ebe4c342885433afc28232197ce398fe71 (diff)
downloademacs-65563fd7714271582d5146c09202c0f7a0631fe5.tar.gz
emacs-65563fd7714271582d5146c09202c0f7a0631fe5.zip
Better support for future plugins
See the thread containing: http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg00720.html * lib-src/make-docfile.c (write_globals): Generate code that #defines Qxxx macros other than Qnil only if DEFINE_NONNIL_Q_SYMBOL_MACROS. Qnil is safe to define even in plugins, since it must be zero for other reasons. * src/lisp.h (DEFINE_LISP_SYMBOL): New macro, replacing and simplifying DEFINE_LISP_SYMBOL_BEGIN / DEFINE_LISP_SYMBOL_END. All uses changed. (DEFINE_NONNIL_Q_SYMBOL_MACROS): New macro, defaulting to true.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog10
-rw-r--r--lib-src/make-docfile.c27
2 files changed, 24 insertions, 13 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 8d2c95e671c..534d253cabb 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,13 @@
12015-02-13 Paul Eggert <eggert@cs.ucla.edu>
2
3 Better support for future plugins
4 See the thread containing:
5 http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg00720.html
6 * make-docfile.c (write_globals): Generate code that #defines
7 Qxxx macros other than Qnil only if DEFINE_NONNIL_Q_SYMBOL_MACROS.
8 Qnil is safe to define even in plugins, since it must be zero for
9 other reasons.
10
12015-01-24 Paul Eggert <eggert@cs.ucla.edu> 112015-01-24 Paul Eggert <eggert@cs.ucla.edu>
2 12
3 Fix a couple of AM_V_GEN bugs 13 Fix a couple of AM_V_GEN bugs
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 79d421a0a8e..a7943e3118c 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -707,12 +707,9 @@ write_globals (void)
707 globals[i].name, globals[i].name); 707 globals[i].name, globals[i].name);
708 } 708 }
709 else if (globals[i].type == SYMBOL) 709 else if (globals[i].type == SYMBOL)
710 printf (("DEFINE_LISP_SYMBOL_BEGIN (%s)\n" 710 printf (("#define i%s %d\n"
711 "#define i%s %d\n" 711 "DEFINE_LISP_SYMBOL (%s)\n"),
712 "#define %s builtin_lisp_symbol (i%s)\n" 712 globals[i].name, symnum++, globals[i].name);
713 "DEFINE_LISP_SYMBOL_END (%s)\n\n"),
714 globals[i].name, globals[i].name, symnum++,
715 globals[i].name, globals[i].name, globals[i].name);
716 else 713 else
717 { 714 {
718 if (globals[i].flags & DEFUN_noreturn) 715 if (globals[i].flags & DEFUN_noreturn)
@@ -740,15 +737,19 @@ write_globals (void)
740 puts ("#ifdef DEFINE_SYMBOLS"); 737 puts ("#ifdef DEFINE_SYMBOLS");
741 puts ("static char const *const defsym_name[] = {"); 738 puts ("static char const *const defsym_name[] = {");
742 for (int i = 0; i < num_globals; i++) 739 for (int i = 0; i < num_globals; i++)
743 { 740 if (globals[i].type == SYMBOL)
744 if (globals[i].type == SYMBOL) 741 printf ("\t\"%s\",\n", globals[i].v.svalue);
745 printf ("\t\"%s\",\n", globals[i].v.svalue);
746 while (i + 1 < num_globals
747 && strcmp (globals[i].name, globals[i + 1].name) == 0)
748 i++;
749 }
750 puts ("};"); 742 puts ("};");
751 puts ("#endif"); 743 puts ("#endif");
744
745 puts ("#define Qnil builtin_lisp_symbol (0)");
746 puts ("#if DEFINE_NONNIL_Q_SYMBOL_MACROS");
747 num_symbols = 0;
748 for (int i = 0; i < num_globals; i++)
749 if (globals[i].type == SYMBOL && num_symbols++ != 0)
750 printf ("# define %s builtin_lisp_symbol (%d)\n",
751 globals[i].name, num_symbols - 1);
752 puts ("#endif");
752} 753}
753 754
754 755