summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-02-12 18:20:12 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-02-12 18:21:32 -0800
commit65563fd7714271582d5146c09202c0f7a0631fe5 (patch)
tree3da5c2a4dec51d8d53f1b8cc7b7de072bd2577d9 /src
parente39d96ebe4c342885433afc28232197ce398fe71 (diff)
downloademacs-65563fd7714271582d5146c09202c0f7a0631fe5.tar.gz
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 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/lisp.h13
2 files changed, 17 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f8e65d5d91d..6d246fb52c6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Better support for future plugins
+ * 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.
+
2015-02-11 Martin Rudalics <rudalics@gmx.at>
* w32term.c (w32_read_socket): In SIZE_MAXIMIZED and
diff --git a/src/lisp.h b/src/lisp.h
index 6c7b51fea06..7795c90e5cc 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -740,11 +740,18 @@ struct Lisp_Symbol
/* Declare extern constants for Lisp symbols. These can be helpful
when using a debugger like GDB, on older platforms where the debug
format does not represent C macros. */
-#define DEFINE_LISP_SYMBOL_BEGIN(name) \
- DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name)
-#define DEFINE_LISP_SYMBOL_END(name) \
+#define DEFINE_LISP_SYMBOL(name) \
+ DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name) \
DEFINE_GDB_SYMBOL_END (LISP_INITIALLY (XLI_BUILTIN_LISPSYM (i##name)))
+/* By default, define macros for Qt, etc., as this leads to a bit
+ better performance in the core Emacs interpreter. A plugin can
+ define DEFINE_NONNIL_Q_SYMBOL_MACROS to be false, to be portable to
+ other Emacs instances that assign different values to Qt, etc. */
+#ifndef DEFINE_NONNIL_Q_SYMBOL_MACROS
+# define DEFINE_NONNIL_Q_SYMBOL_MACROS true
+#endif
+
#include "globals.h"
/* Convert a Lisp_Object to the corresponding EMACS_INT and vice versa.