aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-03-311-0/+1
|\
| * Protect add-variable-watcher from incorrect usageEli Zaretskii2021-03-291-0/+1
| | | | | | | | | | * src/data.c (Fadd_variable_watcher): Avoid crashes if SYMBOL isn't. (Bug#47462)
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-02-211-1/+11
|\ \ | |/
| * Faster, more compact, and readable closure creationMattias Engdegård2021-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify closure creation by calling a single function at run time instead of putting it together from small pieces. This is faster (by about a factor 2), takes less space on disk and in memory, and makes internal functions somewhat readable in disassembly listings again. This is done by creating a prototype function at compile-time whose closure variables are placeholder values V0, V1... which can be seen in the disassembly. The prototype is then cloned at run time using the new make-closure function that replaces the placeholders with the actual closure variables. * lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Generate call to make-closure from a prototype function. * src/alloc.c (Fmake_closure): New function. (syms_of_alloc): Defsubr it. * src/data.c (syms_of_data): Defsym byte-code-function-p.
| * Change how (declare (modes store the dataLars Ingebrigtsen2021-02-201-1/+9
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-run--set-modes): Change from being a predicate to storing the modes. This allows using the modes for positive command discovery, too. * src/data.c (Fcommand_modes): Look at the `command-modes' symbol property, too.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-02-171-5/+82
|\ \ | |/
| * Revert the bit about command_modes in previous patch setLars Ingebrigtsen2021-02-141-6/+1
| | | | | | | | | | | | | | | | * src/data.c (Fcommand_modes): Remove the subr bit -- it's not necessary since it can just use a predicate. * src/lisp.h (GCALIGNED_STRUCT): Remove command_modes. * src/lread.c (defsubr): Remove command_modes.
| * Extend the syntax of `interactive' to list applicable modesLars Ingebrigtsen2021-02-141-5/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/commands.texi (Using Interactive): Document the extended `interactive' form. * doc/lispref/loading.texi (Autoload): Document list-of-modes form. * lisp/emacs-lisp/autoload.el (make-autoload): Pick the list of modes from `interactive' out of the functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Allow for the extended `interactive' form. * src/callint.c (Finteractive): Document the extended form. * src/data.c (Finteractive_form): Return the interactive form in the old format (even when there's an extended `interactive') to avoid having other parts of Emacs be aware of this. (Fcommand_modes): New defun. * src/emacs-module.c (GCALIGNED_STRUCT): Allow for modules to return command modes. * src/lisp.h: New function module_function_command_modes.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-02-101-1/+3
|\ \ | |/
| * Add cross-references to defvar-localStefan Kangas2021-02-011-1/+3
| | | | | | | | | | * src/data.c (Fmake_variable_buffer_local): * src/eval.c (Fdefvar): Add cross-references to 'defvar-local'.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-01-161-0/+3
|\ \ | |/
| * Add a new variable `inhibit-interaction'Lars Ingebrigtsen2021-01-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/elisp.texi (Top): Add a link. * doc/lispref/errors.texi (Standard Errors): Mention the new error. * doc/lispref/minibuf.texi (Minibuffers): Add a link. (Inhibiting Interaction): New node. * src/data.c (syms_of_data): Define the `inhibited-interaction' error. * src/lisp.h: Export the barfing function. * src/lread.c (Fread_char, Fread_event, Fread_char_exclusive): Barf if inhibited. * src/minibuf.c (barf_if_interaction_inhibited): New function. (Fread_from_minibuffer, Fread_no_blanks_input): Barf if inhibited. (syms_of_minibuf): Define the `inhibit-interaction' variable.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-01-021-1/+1
|\ \ | |/
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | Store function type and expose it with `subr-type'Andrea Corallo2020-12-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/lisp.h (struct Lisp_Subr): Add 'type' field. (SUBR_TYPE): New inline accessor. * src/pdumper.c (dump_subr): Update for 'type' field. * src/data.c (Fsubr_type): New primitive. (syms_of_data): Update. * src/comp.c (ABI_VERSION): Bump new ABI version. (make_subr): Set type. (Fcomp__register_lambda, Fcomp__register_subr) (Fcomp__late_register_subr): Receive and pass subr type to 'make_subr'. * src/alloc.c (mark_object): Mark subr type. * lisp/emacs-lisp/comp.el (comp-func): Change slot type into mvar. (comp-emit-for-top-level, comp-emit-lambda-for-top-level): Pass type mvar to subr register functions. (comp-compute-function-type): Fix-up subr type mvars. * test/src/comp-tests.el (comp-tests-check-ret-type-spec): Use `subr-type'.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-12-121-2/+3
|\ \ | |/
| * Clarify the default-boundp doc stringLars Ingebrigtsen2020-12-091-2/+3
| | | | | | | | * src/data.c (Fdefault_boundp): Doc string clarification (bug#44141).
* | Vanilla build warning clean-upAndrea Corallo2020-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/disass.el (native-comp-unit-file) (subr-native-comp-unit): Declare function. * lisp/progmodes/elisp-mode.el (native-compile): Likewise. * lisp/emacs-lisp/package.el (comp-el-to-eln-filename): Likewise. * lisp/startup.el (normal-top-level): Silence warning. * src/data.c (syms_of_data): 'Ssubr_native_lambda_list' is always defined. * src/pdumper.c (dump_cold_native_subr): Move under ifdefs. (dump_drain_cold_data): Add ifdefs.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-11-221-4/+8
|\ \ | |/
| * Avoid a compilation warning about an ambiguous elseLars Ingebrigtsen2020-11-201-4/+6
| | | | | | | | | | | | | | | | * src/data.c (set_internal): Avoid compilation warning. data.c:1443:9: error: suggest explicit braces to avoid ambiguous ‘else’ 1443 | if (idx > 0 && bindflag == SET_INTERNAL_SET | ^
| * * src/data.c (set_internal): Fix bug#44733Stefan Monnier2020-11-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | Set the default value when `set` encounters a PER_BUFFER variable which has been let-bound globally, to match the behavior seen with `make-variable-buffer-local`. * test/src/data-tests.el (binding-test--let-buffer-local): Add corresponding test. (data-tests--set-default-per-buffer): Add tentative test for the performance problem encountered in bug#41029.
* | Make primitive redefinition effective through trampoline synthesisAndrea Corallo2020-10-051-0/+7
| | | | | | | | | | | | | | | | | | | | * lisp/loadup.el (dump-mode): Set `comp-enable-subr-trampolines' when finished bootstrap. * src/data.c (Ffset): Call `comp-enable-subr-trampolines' when redefining a subr. * src/comp.c (syms_of_comp): Define `comp-subr-trampoline-install' symbol. (syms_of_comp): Define `comp-enable-subr-trampolines' variable.
* | Make CHECK_SUBR publicAndrea Corallo2020-09-231-6/+0
| | | | | | | | | | * src/data.c (CHECK_SUBR): Move from here to... * src/lisp.h (CHECK_SUBR): ...to here.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-09-211-0/+9
|\ \ | |/
| * Fix builds without modulesGlenn Morris2020-09-131-0/+2
| | | | | | | | | | * src/data.c (Finteractive_form): * src/eval.c (Fcommandp): Fix builds without modules.
| * Add facility to make module functions interactive (Bug#23486).Philipp Stephani2020-09-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/module-env-28.h: Add field for 'make_interactive' function. * src/emacs-module.c (Lisp_Module_Function): Add new field holding the interactive form. (allocate_module_function): Adapt to structure layout change. (module_make_interactive, module_function_interactive_form): New functions. (initialize_environment): Use them. * src/eval.c (Fcommandp): * src/data.c (Finteractive_form): Also handle interactive module functions. * test/data/emacs-module/mod-test.c (Fmod_test_identity): New test function. (emacs_module_init): Create two interactive module test functions. * test/src/emacs-module-tests.el (module/interactive/return-t) (module/interactive/return-t-int, module/interactive/identity): New unit tests. * doc/lispref/internals.texi (Module Functions): Document new function. Rework paragraph about wrapping module functions, as the example no longer applies. * etc/NEWS: Document new facility.
* | * src/data.c (subr-native-lambda-list): Defined it unconditionally (bug#43255)Andrea Corallo2020-09-061-2/+2
| |
* | Rework native compiled lisp/d lambda list accessorAndrea Corallo2020-09-011-13/+3
| | | | | | | | | | | | | | | | | | * lisp/help.el (help-function-arglist): Logic update for new 'Fsubr_native_lambda_list'. * src/data.c (Fsubr_native_dyn_p): Remove. (Fsubr_native_lambda_list): Return t when the input is not a compiled lisp/d subr. (syms_of_data): Update for 'Fsubr_native_dyn_p' removal.
* | Fix describe function arglist for native compiled lisp/d (bug#42572)Andrea Corallo2020-08-311-2/+27
| | | | | | | | | | | | | | | | | | | | * lisp/help.el (help-function-arglist): Handle the case of native compiled lisp/d. * src/data.c (syms_of_data): Register new subrs. (Fsubr_native_dyn_p, Fsubr_native_lambda_list): New primitives. * test/src/comp-tests.el (comp-tests-dynamic-help-arglist): New test.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-08-091-6/+0
|\ \ | |/
| * Simplify use of __lsan_ignore_objectPaul Eggert2020-08-031-6/+0
| | | | | | | | | | | | | | | | | | * configure.ac: Use AC_CHECK_FUNCS_ONCE for __lsan_ignore_object. * src/buffer.c, src/data.c, src/emacs-module.c, src/regex-emacs.c: * src/search.c: Use __lsan_ignore_object unconditionally, and don’t include sanitizer/lsan_interface.h. * src/lisp.h (__lsan_ignore_object): Provide a dummy in the typical case where leak sanitization is not available.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-08-021-0/+7
|\ \ | |/
| * Use a more precise check for '__lsan_ignore_object'Philipp Stephani2020-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | * configure.ac: Add check for __lsan_ignore_object. * src/buffer.c (enlarge_buffer_text): * src/data.c (make_blv): * src/emacs-module.c (Fmodule_load, initialize_environment): * src/regex-emacs.c (regex_compile): * src/search.c (newline_cache_on_off): Use new configuration macro.
| * Suppress leak detector in some casesPhilipp Stephani2020-08-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We intentionally leak some objects. Prevent the ASan leak detector from raising false alarms in these cases. * configure.ac: Search for lsan_interface.h header. * src/data.c (make_blv): Allow leaking of buffer-local values. * src/buffer.c (enlarge_buffer_text): Allow leaking of buffer text. * src/emacs-module.c (Fmodule_load, initialize_environment): Allow intentional leak of runtime and environment objects if module assertions are enabled.
* | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-05-061-4/+16
|\ \ | |/
| * Merge from origin/emacs-27Glenn Morris2020-05-061-4/+16
| |\ | | | | | | | | | f9fa726ced Improve doc strings of makunbound and fmakunbound
| | * Improve doc strings of makunbound and fmakunboundStefan Kangas2020-05-031-4/+16
| | | | | | | | | | | | | | | * src/data.c (Fmakunbound, Ffmakunbound): Improve doc strings. (Bug#41026)
* | | * src/data.c (syms_of_data): Fix #ifdef HAVE_NATIVE_COMP position.Andrea Corallo2020-04-251-1/+1
| | |
* | | * src/comp.c (native-comp-unit-set-file): New function.Andrea Corallo2020-04-121-0/+11
| | |
* | | * src/comp.c (native-comp-unit-file): Better parameter name.Andrea Corallo2020-04-121-3/+4
| | |
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-03-291-36/+41
|\ \ \ | |/ /
| * | Refactor and fix typo in CHECK_*_COERCE_MARKERPaul Eggert2020-03-261-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/data.c (check_integer_coerce_marker) (check_number_coerce_marker): New functions. Also, fix a typo in the former, by having it use Qinteger_or_marker_p not Qnumber_or_marker_p. (arithcompare, floatop_arith_driver, bignum_arith_driver) (arith_driver, Fplus, Fminus, Ftimes, Fquo, Frem, Fmod) (minmax_driver, Flogand, Flogior, Flogxor, Fadd1, Fsub1): Use them in place of the similarly-named macros. * src/lisp.h (CHECK_NUMBER_COERCE_MARKER) (CHECK_INTEGER_COERCE_MARKER): Remove; no longer used.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-03-231-1/+1
|\ \ \ | |/ /
| * | Merge from origin/emacs-27Glenn Morris2020-03-231-1/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d66331aea4 (origin/emacs-27) Don't build the Gnulib 'utimens' module ... f2351a689b Add Harfbuzz dependency 8944310d7c Don't signal during backtrace unrewind (Bug#40088) 8709aaddd8 Fix a couple of problems in changelog generating functions 9ab85f087f Fix cl-concatenate (Bug#40180) 561e9fb91b Improve documentation of project.el commands b28a9a6cc3 Make svg images with links valid 7515252cce * lisp/tab-line.el (tab-line-new-button-show): New defcustom. # Conflicts: # etc/NEWS # nt/gnulib-cfg.mk
| | * Don't signal during backtrace unrewind (Bug#40088)Noam Postavsky2020-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backtrace_eval_unrewind is used to temporarily reverse let-bindings (it's called with a positive argument to reverse bindings, and then a negative argument to re-apply them) by backtrace--locals and backtrace-eval. For the SPECPDL_LET_DEFAULT and SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local variables), the code calls Fdefault_value and Fbuffer_local_value on the symbol. For symbols which are unbound at top-level, the first (with positive argument) call to backtrace_eval_unrewind will set the symbol's value to unbound (putting the current value in the specpdl's "old value" slot). On the second (with negative argument) call, backtrace_eval_unrewind attempts to retrieve the symbol's value with Fdefault_value or Fbuffer_local_value, but that raises a void-variable signal. This interrupts the restoration of the let-bindings, so any other variables more recent on the stack will now have the wrong value. * src/data.c (default_value): Make non-static. * src/lisp.h: Declare it. * src/eval.c (backtrace_eval_unrewind): Replace the calls to Fdefault_value and Fbuffer_local_value with default_value and buffer_local_value, respectively. The latter do exactly the same as the former, except if the symbol's value is Qunbound they just return it instead of signaling void-variable.
* | | Trigger native compilation when loading bytecodeAndrea Corallo2020-03-161-0/+2
| | | | | | | | | | | | | | | Introduce a first mechanism to trigger compilation when lex elc files are loaded. This is off by default and has to be better tested.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-231-8/+2
|\ \ \ | |/ /
| * | Restore runtime check for invalid tagPaul Eggert2020-02-221-8/+2
| | | | | | | | | | | | | | | | | | * src/data.c (wrong_type_argument): Restore check that the object’s tag is valid, since invalid tags exist again. * src/lisp.h (Lisp_Type_Unused0): New constant.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-041-41/+25
|\ \ \ | |/ /
| * | Make Faset nonrecursivePaul Eggert2020-01-181-28/+28
| | | | | | | | | | | | | | | * src/data.c (Faset): Refactor Faset so that it’s not recursive. This helps the compiler and makes the code a bit clearer.