summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <monnier@IRO.UMontreal.CA>2017-07-14 00:32:34 -0400
committerNoam Postavsky <npostavs@gmail.com>2017-08-07 18:54:49 -0400
commitcc30d77ecdd1b9155ade3d0656a84a0839ee2795 (patch)
treea0b0c1180b8152284d10420d4189eb7cebdbc7d7 /src
parent00f7e31110a27e568529192d7441d9631b9096bc (diff)
downloademacs-cc30d77ecdd1b9155ade3d0656a84a0839ee2795.tar.gz
emacs-cc30d77ecdd1b9155ade3d0656a84a0839ee2795.tar.bz2
emacs-cc30d77ecdd1b9155ade3d0656a84a0839ee2795.zip
Let `define-symbol-prop' take effect during compilation
* src/fns.c (syms_of_fns): New variable `overriding-plist-environment'. (Fget): Consult it. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Let-bind it to nil. (byte-compile-define-symbol-prop): New function, handles compilation of top-level `define-symbol-prop' and `function-put' calls by putting the symbol setting into `overriding-plist-environment'. Co-authored-by: Noam Postavsky <npostavs@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/fns.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fns.c b/src/fns.c
index d849618f2b7..00b6ed6a281 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1987,6 +1987,10 @@ This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */)
(Lisp_Object symbol, Lisp_Object propname)
{
CHECK_SYMBOL (symbol);
+ Lisp_Object propval = Fplist_get (CDR (Fassq (symbol, Voverriding_plist_environment)),
+ propname);
+ if (!NILP (propval))
+ return propval;
return Fplist_get (XSYMBOL (symbol)->plist, propname);
}
@@ -5163,6 +5167,13 @@ syms_of_fns (void)
DEFSYM (Qcursor_in_echo_area, "cursor-in-echo-area");
DEFSYM (Qwidget_type, "widget-type");
+ DEFVAR_LISP ("overriding-plist-environment", Voverriding_plist_environment,
+ doc: /* An alist overrides the plists of the symbols which it lists.
+Used by the byte-compiler to apply `define-symbol-prop' during
+compilation. */);
+ Voverriding_plist_environment = Qnil;
+ DEFSYM (Qoverriding_plist_environment, "overriding-plist-environment");
+
staticpro (&string_char_byte_cache_string);
string_char_byte_cache_string = Qnil;