aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Check whether img exists before computing the sizeLars Ingebrigtsen2020-12-101-2/+3
|
* Add image cache dataLars Ingebrigtsen2020-12-101-0/+34
|
* Continue implementationLars Ingebrigtsen2020-12-101-0/+32
|
* Clarify `scroll-preserve-screen-position' doc stringLars Ingebrigtsen2020-12-091-1/+7
| | | | * src/window.c (syms_of_window): Clarify the doc string (bug#7910).
* Merge from origin/emacs-27Glenn Morris2020-12-093-20/+23
|\ | | | | | | | | | | | | | | | | | | 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.
| * ; * src/charset.c (Fmap_charset_chars): Doc fix.Eli Zaretskii2020-12-021-1/+3
| |
| * ; * src/chartab.c, src/lisp.h: Fix typos in comments.Eli Zaretskii2020-12-022-19/+20
| |
* | Improve predictability of 'scroll-preserve-screen-position'Eli Zaretskii2020-12-091-4/+44
| | | | | | | | | | | | * src/window.c (window_scroll_pixel_based): Compute the new window-start more precisely when 'scroll-preserve-screen-position' is non-nil. (Bug#8355)
* | Clarify the default-boundp doc stringLars Ingebrigtsen2020-12-091-2/+3
| | | | | | | | * src/data.c (Fdefault_boundp): Doc string clarification (bug#44141).
* | Fix [:upper:] and [:lower:] for Unicode characters (bug#11309)Mattias Engdegård2020-12-091-8/+9
| | | | | | | | | | | | | | | | * 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.
* | Make uncache_image slightly more efficientLars Ingebrigtsen2020-12-091-1/+2
| | | | | | | | | | * src/image.c (uncache_image): Extremely minor speed-up: Only compute the hash once.
* | * src/fns.c: Remove left over includeStefan Monnier2020-12-081-1/+0
| |
* | Restore Emacs 27 image cache semanticsLars Ingebrigtsen2020-12-091-12/+1
| | | | | | | | | | | | | | | | * 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).
* | * src/fns.c (hash_string): Speed up on large stringsStefan Monnier2020-12-081-9/+32
| |
* | Improve documentation of 'backtrace-on-error-noninteractive'Eli Zaretskii2020-12-081-2/+4
| | | | | | | | | | | | | | | | * 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.
* | Make previous Fkill_emacs change saferLars Ingebrigtsen2020-12-071-4/+7
| | | | | | | | * src/emacs.c (Fkill_emacs): Don't run `kill-emacs-hook' if it's nil.
* | Allow shutting down Emacs even if there are errors in kill-emacs-hookLars Ingebrigtsen2020-12-071-1/+3
| | | | | | | | | | | | | | | | | | * 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.
* | Add new variable to selectively suppress backtraces in batch mode.Philipp Stephani2020-12-071-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Print a backtrace on unhandled errors in batch mode (Bug#44942).Philipp Stephani2020-12-061-1/+14
| | | | | | | | | | | | | | | | | | | | * 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.
* | * src/alloc.c (Fgarbage_collect_maybe): New functionSpencer Baugh2020-12-042-0/+26
| |
* | Speed up match-substitute-replacementMattias Engdegård2020-12-041-2/+2
| | | | | | | | | | | | * 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.
* | Don't abort when terminated by SIGINT in -batchEli Zaretskii2020-12-043-3/+16
| | | | | | | | | | | | | | * 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.
* | Merge from origin/emacs-27Glenn Morris2020-12-011-2/+3
|\ \ | |/ | | | | | | | | 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'.
| * ; * src/buffer.c: Fix comment describing 'buffer_defaults'.Eli Zaretskii2020-11-301-2/+3
| |
| * Revert "Fix incorrect handling of module runtime and environment pointers."Eli Zaretskii2020-11-281-109/+22
| | | | | | | | | | | | This reverts commit cdc632fbe6e149318147a98cccf1b7af191f2ce8. Those changes are too significant and non-trivial to be suitable for a release branch at this time.
| * Fix incorrect handling of module runtime and environment pointers.Philipp Stephani2020-11-271-22/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix double-free bug when finalizing module runtimes.Philipp Stephani2020-11-291-2/+2
| | | | | | | | | | | | | | | | | | * 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.
* | Allow doprint to handle multibyte chars in format (bug#44349)Alan Third2020-11-291-5/+21
| | | | | | | | | | * src/doprnt.c (doprnt): Handle the case where fmtchar is the start of a multibyte character.
* | frame-position doc string clarificatonLars Ingebrigtsen2020-11-291-1/+5
| | | | | | | | | | * src/frame.c (Fframe_position): Mention that the values are system-dependent (bug#32977).
* | garbage-collect doc string clarificationLars Ingebrigtsen2020-11-291-1/+8
| | | | | | | | | | * src/alloc.c (Fgarbage_collect): Mention that calling this function is not guaranteed to collect all the garbage (bug#34404).
* | Use correct glyph in title when resizing NS framesMattias Engdegård2020-11-271-1/+1
| | | | | | | | * src/nsterm.m ([EmacsView windowWillResize:toSize:]): Use ×, not x.
* | Fix incorrect handling of module runtime and environment pointers.Philipp Stephani2020-11-274-67/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | ; * src/lisp.h (enum specbind_tag): Fix typo.Philipp Stephani2020-11-271-1/+1
| |
* | Fix replace-regexp-in-string substring match data translationMattias Engdegård2020-11-261-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For certain patterns, re-matching the same regexp on the matched substring does not produce correctly translated match data (bug#15107 and bug#44861). Using a new builtin function also improves performance since the number of calls to string-match is halved. Reported by Kevin Ryde and Shigeru Fukaya. * lisp/subr.el (replace-regexp-in-string): Translate the match data using match-data--translate instead of trusting a call to string-match on the matched string to do the job. * test/lisp/subr-tests.el (subr-replace-regexp-in-string): Add test cases. * src/search.c (Fmatch_data__translate): New internal function. (syms_of_search): Register it as a subroutine.
* | (defvar): Detect defining a variable currently lexically boundStefan Monnier2020-11-251-0/+48
| | | | | | | | | | * src/eval.c (lexbound_p): New function. (Finternal__define_uninitialized_variable): Use it.
* | Merge from origin/emacs-27Michael Albinus2020-11-251-3/+7
|\ \ | |/ | | | | | | | | 6442cdc0e4 Revert extra focus redirection in do_switch_frame (Bug#24803) fc4379f1ae Minor cleanup of tramp-tests.el on MS Windows dea3d6aa18 Fix handling of defcustom :local tag
| * Revert extra focus redirection in do_switch_frame (Bug#24803)Martin Rudalics2020-11-251-3/+7
| | | | | | | | | | | | | | | | | | * src/frame.c (do_switch_frame): Do not also redirect frame focus when FRAME has its minibuffer window on the selected frame which was intended to fix Bug#24500. It may cause Bug#24803 and lead to a nasty state where no active cursor is shown on any frame, see https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01137.html.
* | Merge from origin/emacs-27Michael Albinus2020-11-251-0/+2
|\ \ | |/ | | | | f425a774c2 Fix display artifacts when 'display' properties cover newl...
| * Fix display artifacts when 'display' properties cover newlinesEli Zaretskii2020-11-241-0/+2
| | | | | | | | | | | | * src/xdisp.c (pos_visible_p): Set glyph_row of scratch iterators to NULL, to avoid producing glyphs while we figure out the layout. (Bug#44826)
* | Codesign the executable on recene MacOS systemsItai Seggev2020-11-241-0/+7
| | | | | | | | | | | | | | | | * src/Makefile.in (temacs$(EXEEXT)): Codesign the executable on recent (ARM) MacOS systems (bug#43878). Without this, building Emacs fails. Copyright-paperwork-exempt: yes
* | Merge from origin/emacs-27Glenn Morris2020-11-232-1/+30
|\ \ | |/ | | | | | | | | | | | | | | 86cbc9d216 Make ignoring modifiers on IME input optional 32b97bb9e0 Ignore modifiers when processing WM_IME_CHAR messages f641ef1a07 Improve documentation of 'font-spec' # Conflicts: # etc/NEWS
| * Make ignoring modifiers on IME input optionalEli Zaretskii2020-11-211-1/+13
| | | | | | | | | | | | | | | | | | | | | | By default, ignore modifier keys on IME input, but add a variable to get back old behavior. * src/w32fns.c (syms_of_w32fns): New variable w32-ignore-modifiers-on-IME-input. (w32_wnd_proc): Use it to ignore modifier keys when IME input is used. (Bug#44641) * etc/NEWS: Announce the change and the new variable.
| * Ignore modifiers when processing WM_IME_CHAR messagesMasahiro Nakamura2020-11-211-1/+1
| | | | | | | | | | * src/w32fns.c (w32_wnd_proc): Ignore modifiers when processing WM_IME_CHAR messages.
| * Improve documentation of 'font-spec'Eli Zaretskii2020-11-191-0/+17
| | | | | | | | | | | | * doc/lispref/display.texi (Low-Level Font): * src/font.c (Ffont_spec): Document 'font-spec' keys that are supported, but were undocumented.
| * Don't leave lock files after 'replace-buffer-contents'Eli Zaretskii2020-11-141-0/+7
| | | | | | | | | | | | | | * src/editfns.c (Freplace_buffer_contents): Unlock the buffer's file if no changes have been made. (Bug#44303) (cherry picked from commit a5867ddfbd721568005175bf6c725f7834b21ea4)
* | minibuffer code: restore original frame after using minibuffer-only frame, etcAlan Mackenzie2020-11-231-1/+4
| | | | | | | | | | | | * src/minibuf.c (read_minibuf): In the record_unwind_protect for the second restore_window_configuration (separate minibuffer frame case) arrange for the future switching back to the original frame by Fset_window_configuration.
* | Unbreak compilation with CHECK_STRUCTS.Philipp Stephani2020-11-221-1/+1
| | | | | | | | | | | | | | Commit 3963aea4f4a22da0c1fb8ca8ca80b59c58373811 modified the ‘buffer’ structure, but didn’t adapt the hash. * src/pdumper.c (dump_buffer): Update buffer hash.
* | Say which command shadows a key bindingStefan Kangas2020-11-221-1/+7
| | | | | | | | | | | | | | | | * src/keymap.c (describe_vector): Say which command shadows this binding. (Bug#9293) * test/src/keymap-tests.el (help--describe-vector/bug-9293-one-shadowed-in-range): Adapt test.
* | Don't shadow bindings by the same commandStefan Kangas2020-11-221-1/+1
| | | | | | | | | | | | | | | | * src/keymap.c (describe_vector): Do not say binding is shadowed if the other key binding points to the same command. (Bug#9293) * test/src/keymap-tests.el (help--describe-vector/bug-9293-same-command-does-not-shadow): New test.
* | Don't show key ranges if shadowed by different commandsStefan Kangas2020-11-221-4/+18
| | | | | | | | | | | | | | | | * src/keymap.c (describe_vector): Make sure found consecutive keys are either not shadowed or, if they are, that they are shadowed by the same command. (Bug#9293) * test/src/keymap-tests.el (help--describe-vector/bug-9293-one-shadowed-in-range): New test.