diff options
| author | Stefan Monnier | 2017-07-14 00:32:34 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-08-07 18:54:49 -0400 |
| commit | cc30d77ecdd1b9155ade3d0656a84a0839ee2795 (patch) | |
| tree | a0b0c1180b8152284d10420d4189eb7cebdbc7d7 /src | |
| parent | 00f7e31110a27e568529192d7441d9631b9096bc (diff) | |
| download | emacs-cc30d77ecdd1b9155ade3d0656a84a0839ee2795.tar.gz 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.c | 11 |
1 files changed, 11 insertions, 0 deletions
| @@ -1987,6 +1987,10 @@ This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */) | |||
| 1987 | (Lisp_Object symbol, Lisp_Object propname) | 1987 | (Lisp_Object symbol, Lisp_Object propname) |
| 1988 | { | 1988 | { |
| 1989 | CHECK_SYMBOL (symbol); | 1989 | CHECK_SYMBOL (symbol); |
| 1990 | Lisp_Object propval = Fplist_get (CDR (Fassq (symbol, Voverriding_plist_environment)), | ||
| 1991 | propname); | ||
| 1992 | if (!NILP (propval)) | ||
| 1993 | return propval; | ||
| 1990 | return Fplist_get (XSYMBOL (symbol)->plist, propname); | 1994 | return Fplist_get (XSYMBOL (symbol)->plist, propname); |
| 1991 | } | 1995 | } |
| 1992 | 1996 | ||
| @@ -5163,6 +5167,13 @@ syms_of_fns (void) | |||
| 5163 | DEFSYM (Qcursor_in_echo_area, "cursor-in-echo-area"); | 5167 | DEFSYM (Qcursor_in_echo_area, "cursor-in-echo-area"); |
| 5164 | DEFSYM (Qwidget_type, "widget-type"); | 5168 | DEFSYM (Qwidget_type, "widget-type"); |
| 5165 | 5169 | ||
| 5170 | DEFVAR_LISP ("overriding-plist-environment", Voverriding_plist_environment, | ||
| 5171 | doc: /* An alist overrides the plists of the symbols which it lists. | ||
| 5172 | Used by the byte-compiler to apply `define-symbol-prop' during | ||
| 5173 | compilation. */); | ||
| 5174 | Voverriding_plist_environment = Qnil; | ||
| 5175 | DEFSYM (Qoverriding_plist_environment, "overriding-plist-environment"); | ||
| 5176 | |||
| 5166 | staticpro (&string_char_byte_cache_string); | 5177 | staticpro (&string_char_byte_cache_string); |
| 5167 | string_char_byte_cache_string = Qnil; | 5178 | string_char_byte_cache_string = Qnil; |
| 5168 | 5179 | ||