summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-12-12Fix crash when using XRender and restoring image from X (bug#44930)Alan Third
* src/dispextern.h (struct image): Add original dimension elements. * src/image.c (image_set_transform): Store the original dimensions. (image_get_x_image): If we're using transforms use the original dimensions with XGetImage.
2020-12-11Fix image-cache-size crashLars Ingebrigtsen
* src/image.c (image_frame_cache_size): Ensure that img->pixmap is in use before trying to access it.
2020-12-11* src/fns.c (Fbuffer_hash): Doc fix. (Bug#45178)Stefan Kangas
2020-12-11docstring: If FRAME is nil, it defaults to selected frame.Pankaj Jangid
* src/frame.c (Fset_frame_size): Clarify what a nil FRAME parameter means (bug#45170).
2020-12-11Fix compilation of image.c on non-Cairo systemsLars Ingebrigtsen
* src/image.c (image_frame_cache_size): pixmap->width etc is only defined on Cairo. Return 0 for now on other systems.
2020-12-11Add new function `object-intervals'Lars Ingebrigtsen
* doc/lispref/text.texi (Examining Properties): Document it. * src/fns.c (Fobject_intervals): New defun. (collect_interval): New function.
2020-12-11Add new function 'image-cache-size'Lars Ingebrigtsen
* src/image.c (Fimage_cache_size): New defun. (image_frame_cache_size): New function.
2020-12-10Avoid segfaults in pos_visible_pEli Zaretskii
* src/xdisp.c (pos_visible_p): Don't try accessing the glyphs produced by iterator whose glyph_row was set to NULL; instead, record the X coordinate before the display string when moving past it, and use the recorded coordinate if needed. (Bug#45156)
2020-12-09Clarify `scroll-preserve-screen-position' doc stringLars Ingebrigtsen
* src/window.c (syms_of_window): Clarify the doc string (bug#7910).
2020-12-09Merge from origin/emacs-27Glenn Morris
32090a3de4 Improve documentation of streams in batch mode 34feded008 Support ks_c_5601-1987 encoding da00a6f317 Fix Xaw widget text disappearing when built with cairo (bu... 6916e7954a Improve documentation of 'ps-print-color-p' 6663b2f211 ; * lisp/simple.el (move-beginning-of-line): Doc fix. a4dd03ebe9 ; * src/charset.c (Fmap_charset_chars): Doc fix. d86cc3ffcb ; * src/chartab.c, src/lisp.h: Fix typos in comments.
2020-12-09Improve predictability of 'scroll-preserve-screen-position'Eli Zaretskii
* src/window.c (window_scroll_pixel_based): Compute the new window-start more precisely when 'scroll-preserve-screen-position' is non-nil. (Bug#8355)
2020-12-09Clarify the default-boundp doc stringLars Ingebrigtsen
* src/data.c (Fdefault_boundp): Doc string clarification (bug#44141).
2020-12-09Fix [:upper:] and [:lower:] for Unicode characters (bug#11309)Mattias Engdegård
* src/regex-emacs.c (execute_charset): Add canon_table argument to allow expression of a correct predicate for [:upper:] and [:lower:]. (mutually_exclusive_p, re_match_2_internal): Pass extra argument. * test/src/regex-emacs-tests.el (regexp-case-fold, regexp-eszett): New tests. Parts of regexp-eszett still fail and are commented out.
2020-12-09Make uncache_image slightly more efficientLars Ingebrigtsen
* src/image.c (uncache_image): Extremely minor speed-up: Only compute the hash once.
2020-12-08* src/fns.c: Remove left over includeStefan Monnier
2020-12-09Restore Emacs 27 image cache semanticsLars Ingebrigtsen
* src/image.c (equal_lists): Remove. (search_image_cache): Use Fequal instead of equal_lists. Benchmarking shows no measurable time difference, and this restores the cache semantics from Emacs 27 (where file names didn't have to be EQ for the cache to be used).
2020-12-08* src/fns.c (hash_string): Speed up on large stringsStefan Monnier
2020-12-08Improve documentation of 'backtrace-on-error-noninteractive'Eli Zaretskii
* src/eval.c (syms_of_eval) <backtrace-on-error-noninteractive>: Format the doc string according to conventions. * etc/NEWS: Improve formatting and wording of the entry describing 'backtrace-on-error-noninteractive.
2020-12-07Make previous Fkill_emacs change saferLars Ingebrigtsen
* src/emacs.c (Fkill_emacs): Don't run `kill-emacs-hook' if it's nil.
2020-12-07Allow shutting down Emacs even if there are errors in kill-emacs-hookLars Ingebrigtsen
* lisp/subr.el (run-hook-query-error-with-timeout): New function (bug#28542). * src/emacs.c (Fkill_emacs): Use it to allow exiting Emacs even if there are errors in kill-emacs-hook. (syms_of_emacs): Define the symbol.
2020-12-07Add new variable to selectively suppress backtraces in batch mode.Philipp Stephani
* src/eval.c (syms_of_eval): Define new variable 'backtrace-on-error-noninteractive' to selectively enable backtrace printing in batch mode. (signal_or_quit): Use it. * etc/NEWS: Document new variable. * test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode/inhibit): New unit test.
2020-12-06Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-12-06Print a backtrace on unhandled errors in batch mode (Bug#44942).Philipp Stephani
* src/eval.c (signal_or_quit): Print a backtrace in batch mode if no error handler was found. * test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode) (eval-tests/backtrace-in-batch-mode/demoted-errors): New unit tests. * etc/NEWS: Document change.
2020-12-05Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano
2020-12-04Vanilla build warning clean-upAndrea Corallo
* 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.
2020-12-04* Fix `load-history' causing a number of spurious compiler warningsAndrea Corallo
* src/comp.c (Fcomp__register_subr): Fix missing entry into `load-history' indicating that the loaded function was already an autoload.
2020-12-04* src/alloc.c (Fgarbage_collect_maybe): New functionSpencer Baugh
2020-12-04Speed up match-substitute-replacementMattias Engdegård
* lisp/subr.el (match-substitute-replacement): Use match-data--translate. * src/search.c (Fmatch_data__translate): Remove string restriction. * test/lisp/subr-tests.el (subr-match-substitute-replacement): New test.
2020-12-04Don't abort when terminated by SIGINT in -batchEli Zaretskii
* src/xdisp.c (clear_message_stack): New function. * src/emacs.c (terminate_due_to_signal): Call clear_message_stack when we are being shut down by SIGINT under -batch. * src/lisp.h (clear_message_stack): Add prototype.
2020-12-04* Reduce (half) the number of loads emitted for calling into C codeAndrea Corallo
As after each function call GCC clobbers the pointer to the function relocation table. This commit modify the code generation to create a local copy of it for each function. This reduces the average number of loads for each function call into C from two to one. * src/comp.c (comp_t): Add 'func_relocs_ptr_type' and 'func_relocs_local' fields. (emit_call): Use the local func_relocs pointer when possible. (emit_ctxt_code): Fill 'comp.func_relocs_ptr_type'. (compile_function): Declare 'func_relocs_ptr_local'. (compile_function): Assign 'func_relocs_ptr_local' from the global value in each function prologue.
2020-12-02; * src/charset.c (Fmap_charset_chars): Doc fix.Eli Zaretskii
2020-12-02; * src/chartab.c, src/lisp.h: Fix typos in comments.Eli Zaretskii
2020-12-01Merge from origin/emacs-27Glenn Morris
749e4b7e0b Reset xref-show-xrefs-function temporarily 3e6525d69f Don't show in 'view-lossage' responses to xterm feature qu... 9fbff9c35c ; * src/buffer.c: Fix comment describing 'buffer_defaults'.
2020-11-30; * src/buffer.c: Fix comment describing 'buffer_defaults'.Eli Zaretskii
2020-11-29Fix double-free bug when finalizing module runtimes.Philipp Stephani
* src/emacs-module.c (finalize_runtime_unwind): Don't finalize initial environment twice. * test/src/emacs-module-resources/mod-test.c (emacs_module_init): Allocate lots of values during module initialization to trigger the bug.
2020-11-29Allow doprint to handle multibyte chars in format (bug#44349)Alan Third
* src/doprnt.c (doprnt): Handle the case where fmtchar is the start of a multibyte character.
2020-11-29Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo
2020-11-29frame-position doc string clarificatonLars Ingebrigtsen
* src/frame.c (Fframe_position): Mention that the values are system-dependent (bug#32977).
2020-11-29garbage-collect doc string clarificationLars Ingebrigtsen
* src/alloc.c (Fgarbage_collect): Mention that calling this function is not guaranteed to collect all the garbage (bug#34404).
2020-11-29Merge branch 'master' into feature/pgtkYuuki Harano
2020-11-29* src/pgtkterm.c (scroll_event): Shut up warningsYuuki Harano
2020-11-28Improve smooth scrollYuuki Harano
* src/pgtkterm.c (scroll_event): Accumulate deltas and calculate the number of lines. (pgtk_term_init): Set smooth scroll parameters. * src/pgtkterm.h (scroll): New members to store parameters.
2020-11-28Revert "Fix incorrect handling of module runtime and environment pointers."Eli Zaretskii
This reverts commit cdc632fbe6e149318147a98cccf1b7af191f2ce8. Those changes are too significant and non-trivial to be suitable for a release branch at this time.
2020-11-27* Synthesize as const primitive function pointers and its container struct.Andrea Corallo
* src/comp.c (declare_imported_func): Make const function pointer to primitive funcions. (emit_ctxt_code): Make struct 'comp.func_relocs' const.
2020-11-27Fix incorrect handling of module runtime and environment pointers.Philipp Stephani
We used to store module runtime and environment pointers in the static lists Vmodule_runtimes and Vmodule_environments. However, this is incorrect because these objects have to be kept per-thread. With this naive approach, interleaving module function calls in separate threads leads to environments being removed in the wrong order, which in turn can cause local module values to be incorrectly garbage-collected. Instead, turn Vmodule_runtimes and Vmodule_environments into hashtables keyed by the thread objects. The fix is relatively localized and should therefore be safe enough for the release branch. Module assertions now have to walk the pointer list for the current thread, which is more correct since they now only find environments for the current thread. Also add a unit test that exemplifies the problem. It interleaves two module calls in two threads so that the first call ends while the second one is still active. Without this change, this test triggers an assertion failure. * src/emacs-module.c (Fmodule_load, initialize_environment) (finalize_environment, finalize_runtime_unwind): Store runtime and environment pointers in per-thread lists. (syms_of_module): Initialize runtimes and environments hashtables. (module_assert_runtime, module_assert_env, value_to_lisp): Consider only objects for the current thread. (module_gc_hash_table_size, module_hash_push, module_hash_pop): New generic hashtable helper functions. (module_objects, module_push_pointer, module_pop_pointer): New helper functions to main thread-specific lists of runtime and environment pointers. (mark_modules): Mark all environments in all threads. * test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test function. (emacs_module_init): Bind it. * test/src/emacs-module-tests.el (emacs-module-tests--variable): New helper type to guard access to state in a thread-safe way. (emacs-module-tests--wait-for-variable) (emacs-module-tests--change-variable): New helper functions. (emacs-module-tests/interleaved-threads): New unit test.
2020-11-27Use correct glyph in title when resizing NS framesMattias Engdegård
* src/nsterm.m ([EmacsView windowWillResize:toSize:]): Use ×, not x.
2020-11-27Fix incorrect handling of module runtime and environment pointers.Philipp Stephani
We used to store module runtime and environment pointers in the static lists Vmodule_runtimes and Vmodule_environments. However, this is incorrect because these objects have to be kept per-thread. With this naive approach, interleaving module function calls in separate threads leads to environments being removed in the wrong order, which in turn can cause local module values to be incorrectly garbage-collected. The fix isn't completely trivial: specbinding the lists wouldn't work either, because then the garbage collector wouldn't find the environments in other threads than the current ones, again leading to objects being garbage-collected incorrectly. While introducing custom pseudovector types would fix this, it's simpler to put the runtime and environment pointers into the specbinding list as new specbinding kinds. This works since we need to unwind them anyway, and we only ever treat the lists as a stack. The thread switching machinery ensures that the specbinding lists are thread-local, and that all elements of the specbinding lists in all threads are marked during garbage collection. Module assertions now have to walk the specbinding list for the current thread, which is more correct since they now only find environments for the current thread. As a result, we can now remove the faulty Vmodule_runtimes and Vmodule_environments variables entirely. Also add a unit test that exemplifies the problem. It interleaves two module calls in two threads so that the first call ends while the second one is still active. Without this change, this test triggers an assertion failure. * src/lisp.h (enum specbind_tag): Add new tags for module runtimes and environments. * src/eval.c (record_unwind_protect_module): New function to record a module object in the specpdl list. (do_one_unbind): Unwind module objects. (backtrace_eval_unrewind, default_toplevel_binding, lexbound_p) (Fbacktrace__locals): Deal with new specbinding types. (mark_specpdl): Mark module environments as needed. * src/alloc.c (garbage_collect): Remove call to 'mark-modules'. Garbage collection of module values is now handled as part of marking the specpdl of each thread. * src/emacs-module.c (Fmodule_load, funcall_module): Use specpdl to record module runtimes and environments. (module_assert_runtime, module_assert_env, value_to_lisp): Walk through specpdl list instead of list variables. (mark_module_environment): Rename from 'mark_modules'. Don't attempt to walk though current thread's environments only, since that would miss other threads. (initialize_environment, finalize_environment): Don't change Vmodule_environments variable; environments are now in the specpdl list. (finalize_environment_unwind, finalize_runtime_unwind): Make 'extern' since do_one_unbind now calls them. (finalize_runtime_unwind): Don't change Vmodule_runtimes variable; runtimes are now in the specpdl list. (syms_of_module): Remove Vmodule_runtimes and Vmodule_environments. * test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test function. (emacs_module_init): Bind it. * test/src/emacs-module-tests.el (emacs-module-tests--variable): New helper type to guard access to state in a thread-safe way. (emacs-module-tests--wait-for-variable) (emacs-module-tests--change-variable): New helper functions. (emacs-module-tests/interleaved-threads): New unit test.
2020-11-27; * src/lisp.h (enum specbind_tag): Fix typo.Philipp Stephani
2020-11-28Enable harfbuzzYuuki Harano
* src/pgtkfns.c (Fx_create_frame): Register ftcrhb font driver if enabled.
2020-11-26Add support for hyper modifier keyYuuki Harano
* src/pgtkterm.c (x_find_modifier_meanings): Autodetect key mask. (pgtk_gtk_to_emacs_modifiers): Use autodetected mask instead of GDK's. (pgtk_emacs_to_gtk_modifiers): Use autodetected mask instead of GDK's. (key_press_event): Ignore hyper as well as super. * src/pgtkterm.h (struct pgtk_display_info): New member for hyper.