aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix "emacs -nw" on MS-WindowsEli Zaretskii2024-01-282-2/+7
| | | | | | | | | | | | | | * src/w32term.c (w32_flip_buffers_if_dirty): Do nothing if F is not a GUI frame. This avoids rare crashes in "emacs -nw". * src/w32console.c (initialize_w32_display): Set the ENABLE_EXTENDED_FLAGS bit in 'prev_console_mode'.
* | ; * src/pdumper.c: Fix comments.Eli Zaretskii2024-01-271-11/+9
| |
* | Allow users to opt out of following Windows Dark modeEli Zaretskii2024-01-271-1/+9
| | | | | | | | | | | | | | | | | | | | | | * src/w32fns.c (globals_of_w32fns) <w32-follow-system-dark-mode>: New variable. (w32_applytheme): Disable application of Dark mode if 'w32-follow-system-dark-mode' is nil. * etc/NEWS: * doc/emacs/msdos.texi (Windows Misc): Document 'w32-follow-system-dark-mode'.
* | * src/pdumper.c (Fdump_emacs_portable): Simplify commit 16a16645f524Stefan Monnier2024-01-271-12/+9
| |
* | Add DOHASH_SAFE, make DOHASH faster (bug#68690)Mattias Engdegård2024-01-273-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert DOHASH to the fast (field-caching) implementation but with an assertion to detect misuses. Add DOHASH_SAFE for use in code that must tolerate arbitrary mutation of the table being iterated through. * src/lisp.h (DOHASH): Go back to fast design that only allows restricted mutation, but with a checking assertion. (DOHASH_SAFE): New macro that tolerates arbitrary mutation while being much simpler (and acceptably fast). * src/fns.c (Fmaphash): * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): Use DOHASH_SAFE.
* | pdumper.c: Minor improvements found while debuggingStefan Monnier2024-01-261-28/+29
| | | | | | | | | | | | * src/pdumper.c (dump_hash_table_list): Remove unused return value; and simplify with `vconcat`. (dump_charset): Don't copy uninitialized fields.
* | pdumder.c: Fix bug#68690Stefan Monnier2024-01-261-2/+4
| | | | | | | | | | | | | | | | | | | | The problem was that the offset computed for the `charset_table` array was a multiple of 4 but the `struct charset` needed an alignment on a multiple of 8, so `dump_charset` inserted 4 bytes of padding, whereas you can't have padding at the beginning of an array. * src/pdumper.c (dump_charset): Don't set alignment here. (dump_charset_table): Set it here instead.
* | Fix crash backtraces on MS-Windows, broken by ASLREli Zaretskii2024-01-261-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32fns.c (DEFAULT_IMAGE_BASE): Define for 64-bit and 32-bit MinGW builds. (emacs_abort): Correct the callstack addresses for potential relocation of the image base due to ASLR. This makes 'addr2line' be able to interpret emacs_backtrace.txt when ASLR is in effect, which it is on every modern version of MS-Windows. (Bug#63365) * configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Add comment about keeping the image-base values in sync with w32fns.c. * etc/DEBUG (How to disable ASLR): New section.
* | Avert race condition between window attachment and buffer swapPo Lu2024-01-263-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsView.java (swapBuffers): Synchronize such that code cannot execute between the bitmap's being loaded and being transferred to surfaceView. (onDetachedFromWindow): Recycle bitmap after the surface view is reset. * java/org/gnu/emacs/EmacsWindow.java (recreateActivity): * src/android.c (android_init_emacs_window) (android_recreate_activity): * src/androidfns.c (Fandroid_recreate_activity) (syms_of_androidfns): New functions for debugging window attachment. * src/androidgui.h: Update prototypes.
* | ; Update 'struct charset' hash for CHECK_STRUCTSBasil L. Contovounesios2024-01-251-1/+1
| | | | | | | | | | This follows commit 33b8d5b6c5 of 2024-01-23 "(struct charset): Remove dependency on hash-table internals".
* | Prevent matrices from remaining invalid post mini-window resizePo Lu2024-01-252-4/+11
| | | | | | | | | | | | | | | | | | * src/androidfns.c (android_create_tip_frame): Enable building with GLYPH_DEBUG. * src/window.c (resize_mini_window_apply): Garbage the frame if F->redisplay is already set to indicate that redisplay_internal should nevertheless return to it.
* | * src/lisp.h (DOHASH): Handle rehashing (bug#68690)Stefan Monnier2024-01-241-14/+24
| | | | | | | | | | | | I gave too much credit to the comment, and didn't realize that macro was used in places that didn't obey the comment. This macro is getting pretty hideous!
* | Fix build when CHECK_LISP_OBJECT_TYPE is setStefan Monnier2024-01-241-1/+6
| | | | | | | | * src/lisp.h (make_lisp_symbol_internal): Fix last commit.
* | (struct composition): Remove dependency on hash-table internalsStefan Monnier2024-01-246-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `struct composition` kept an index into the internal `key_and_value` array of hash tables, which only worked because of details of how hash-tables are handled. Replace it with a reference to the key stored at that location in the hash-table, which saves us an indirection while at it. * src/composite.h (struct composition): Replace `hash_index` with the actual `key`. (COMPOSITION_KEY): Simplify accordingly. (mark_composite): Declare. * src/composite.c (get_composition_id): Adjust accordingly. (mark_composite): New function. * src/charset.c (mark_charset): Uncomment. * src/lisp.h (mark_charset): Declare. * src/alloc.c (garbage_collect): Call `mark_charset` and `mark_composite`. * src/pdumper.c (hash_table_contents): Remove invalid comment, since compositions aren't dumped.
* | (DOHASH): Change calling conventionStefan Monnier2024-01-249-52/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This leads to simpler code in the users, and more efficient machine code because we don't repeatedly need to fetch the `table_size` and `key_and_value` fields of the hash table object. * src/lisp.h (DOHASH): Rewrite. * src/composite.c (composition_gstring_lookup_cache): Simplify. (composition_gstring_cache_clear_font): * src/print.c (print): * src/pdumper.c (hash_table_contents): * src/minibuf.c (Ftest_completion): * src/json.c (lisp_to_json_nonscalar_1): * src/emacs-module.c (module_global_reference_p): * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/fns.c (Fmaphash): Adjust to new calling convention.
* | Remove too-tricky make_lisp_symbol optimizationStefan Monnier2024-01-231-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | Simplify optimization for make_lisp_symbol, so that it’s less tricky and works well enough for gcc -Og or -O2. * src/lisp.h (lisp_h_builtin_lisp_symbol): Remove. (builtin_lisp_symbol) [DEFINE_KEY_OPS_AS_MACROS]: Remove. (make_lisp_symbol_nodebug): New internal static function, which is like the old make_lisp_symbol but without the eassert. (make_lisp_symbol, builtin_lisp_symbol): Use it, so that make_lisp_symbol has the eassert but builtin_lisp_symbol doesn’t. Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
* | (struct charset): Remove dependency on hash-table internalsStefan Monnier2024-01-233-16/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `struct charset` kept an index into the internal `key_and_value` array of hash tables, which only worked because of details of how hash-tables are handled. Replace it with a reference to the value stored at that location in the hash-table, which saves us an indirection while at it. * src/charset.h (struct charset): Replace `hash_index` field with `attributes` field. (CHARSET_ATTRIBUTES): Simplify accordingly. (CHARSET_HASH_INDEX): Delete unused macro. * src/charset.c (Fdefine_charset_internal): * src/pdumper.c (dump_charset): Adjust accordingly. (dump_charset_table): Set the referrer since that's needed while dumping Lisp_Object fields.
* | ; Fix DOHASHGerd Möllmann2024-01-231-1/+3
| |
* | Correct crash when executing IP within twilight zonePo Lu2024-01-231-0/+12
| | | | | | | | | | | | * src/sfnt.c (sfnt_address_zp2, sfnt_address_zp1) (sfnt_address_zp0): Don't save into X or Y if the zone is set to the twilight zone and they are NULL.
* | * src/sfnt.c (sfnt_mul_f26dot6_fixed): Correct typo in last change.Po Lu2024-01-231-1/+1
| |
* | * src/regex-emacs.c (forall_firstchar_1): Improve corner caseStefan Monnier2024-01-221-2/+12
| | | | | | | | | | | | Fixes a "FORALL_FIRSTCHAR: Broken assumption2!!" warning with: "^\\(# *\\)\\([^ ]+?\\) *: *\\(.*?\\(?:\n\\1[ \t]+.*?\\)*\\)[[:space:]]*$"
* | * src/pdumper.c (dump_object_needs_dumping_p): SimplifyStefan Monnier2024-01-221-15/+4
| | | | | | | | (hash_table_contents): Use DOHASH.
* | Do not overwrite flags of succeeding points during generic movePo Lu2024-01-221-0/+6
| | | | | | | | | | * src/sfnt.c (sfnt_move): Save FLAGS and restore it after X axis movement loop.
* | Correct values of INSTCTRL flags testedPo Lu2024-01-221-46/+36
| | | | | | | | | | | | | | | | | | * src/sfnt.c (sfnt_mul_f26dot6_round): New function. (sfnt_mul_f26dot6_fixed): Replace by call to sfnt_mul_fixed_round. (MUL): Round result, as the Apple and MS scalers do. (sfnt_interpret_control_value_program): The instruction control flag which reverts CVT modifications is 2, not 4.
* | Add an eassert back to XSYMBOLPaul Eggert2024-01-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | Problem reported by Alan Mackenzie in: https://lists.gnu.org/r/emacs-devel/2024-01/msg00755.html * src/lisp.h (XSYMBOL): If the arg is not a bare symbol, then eassert (symbols_with_pos_enabled). This shouldn’t affect code generated for regular builds, and could catch caller errors in debug builds. For debug builds although this slows things down XSYMBOL should still be faster than it was the day before yesterday, as there’s still no need to eassert (SYMBOLP (a)).
* | Speed up builtin_lisp_symbol when not optimizingPaul Eggert2024-01-211-2/+7
| | | | | | | | | | | | | | | | | | | | | | This should help when building with --enable-checking and compiling with gcc -O0. Problem reorted by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2024-01/msg00770.html * src/lisp.h (lisp_h_builtin_lisp_symbol): New macro, with a body equivalent in effect to the old ‘builtin_lisp_symbol’ but faster when not optimizing. (builtin_lisp_symbol): Use it. If DEFINE_KEY_OPS_AS_MACROS, also define as macro.
* | Change HASH_UNUSED_ENTRY_KEY from Qunbound to NULL floatMattias Engdegård2024-01-214-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | This removes hacks from code that had to be careful not to use Qunbound as a hash table key, at the cost of a minor hack in the GC marker. * src/lisp.h (INVALID_LISP_VALUE, HASH_UNUSED_ENTRY_KEY): Define as a null-pointer float. * src/alloc.c (process_mark_stack): Add hack to ignore that value. * src/pdumper.c (dump_object_needs_dumping_p) (pdumper_init_symbol_unbound, pdumper_load): * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Remove hacks for Qunbound.
* | Make better use of fixnum range in sxhash etcMattias Engdegård2024-01-211-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | Recent hash table changes reduced the range of sxhash, sxhash-eq etc to [0,2**32) on platforms with 62-bit fixnums. This change makes them use the full fixnum range again. Hash table hashing is unaffected. * src/fns.c (sxhash_eq, sxhash_eql): New. (hash_hash_to_fixnum): Replace with... (reduce_emacs_uint_to_fixnum): ...this. (hashfn_eq, hashfn_eql, Fsxhash_eq, Fsxhash_eql, Fsxhash_equal) (Fsxhash_equal_including_properties): Use the new functions.
* | Clarify permitted mutation in `maphash` documentationMattias Engdegård2024-01-211-0/+2
| | | | | | | | | | | | | | * doc/lispref/hash.texi (Hash Access): * src/fns.c (Fmaphash): Make it clear what the function passed as argument can do. Until now these rules were unwritten, and are still unenforced.
* | Add C macro for hash table iterationMattias Engdegård2024-01-218-82/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes some boilerplate code and further reduces dependencies on hash table implementation internals. * src/lisp.h (DOHASH): New. * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/emacs-module.c (module_global_reference_p): * src/fns.c (Fmaphash): * src/json.c (lisp_to_json_nonscalar_1): * src/minibuf.c (Ftest_completion): * src/print.c (print): Use it instead of a hand-written loop.
* | Speed up make_lisp_symbol when debuggingPaul Eggert2024-01-201-1/+1
| | | | | | | | | | | | * src/lisp.h (make_lisp_symbol): In eassert use XBARE_SYMBOL rather than XSYMBOL. This is safe because the symbol must be bare. The change speeds up make_lisp_symbol when debugging.
* | Simplify and tune XSYMBOLPaul Eggert2024-01-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/lisp.h (XSYMBOL): Simplify and tune. There is no need to examine symbols_with_pos_enabled here, since the arg must be a symbol so if it's not a bare symbol then it must be a symbol_with_pos; and checking whether a symbol is bare is cheap. With Ubuntu 23.10 on a Xeon W-1350, this shrank Emacs’s executable text size by 0.1% and sped up a default build of all *.elc files by 0.4%. Remove unnecessary eassert, since XBARE_SYMBOL and XSYMBOL_WITH_POS have easserts that suffice.
* | Be more systematic about parens in C source codePaul Eggert2024-01-2042-301/+301
| | | | | | | | | | | | | | | | | | Be more systematic about putting space before paren in calls, and in avoiding unnecessary parentheses in macros. This was partly inspired by my wading through gcc -E output while debugging something else, and seeing too many parens. This patch does not change the generated .o files on my platform.
* | Omit some parensPaul Eggert2024-01-201-2/+2
| | | | | | | | | | | | * src/lisp.h (XBARE_SYMBOL, XSYMBOL): Omit parentheses that are no longer needed now that we have symbols with positions and these symbols are never macros.
* | Pacify gcc -Wsuggest-attribute=mallocPaul Eggert2024-01-201-1/+1
| | | | | | | | | | * src/lisp.h (hash_table_alloc_bytes): Declare with ATTRIBUTE_MALLOC_SIZE ((1)).
* | Merge from origin/emacs-29Eli Zaretskii2024-01-201-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | 5bb5590dec9 Fix blunder in labeled_narrow_to_region 78ddb32fadb Fix documentation of icon-elements 725a3f32f8b ; Fix typos in symbol names 6653ee66ca5 Improve two docstrings in ox-latex 7d869a04029 Doc fix in auth-source-read-char-choice f149de223bf Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 1f97a878795 Fix info-xref-tests 51f391998b1 Add @kindex in manuals for existing keybindings on 'C-x x...
| * Fix blunder in labeled_narrow_to_regionGregory Heytings2024-01-141-1/+1
| | | | | | | | | | | | * src/editfns.c (labeled_narrow_to_region): Record point before, instead of after, calling narrow-to-region; otherwise point may already have been changed. Fixes bug#66764.
* | Round projs computed executing IP/ISECT instructions and improve IUPPo Lu2024-01-201-31/+75
| | | | | | | | | | | | | | | | | | | | | | * src/sfnt.c (sfnt_multiply_divide_rounded): New function. (sfnt_multiply_divide_signed): Always round values, as fonts which rely on IP to move points in concert with prior motion and subsequently round such points with MDAP are sensitive to minor deviations in the behavior of the former instruction. (load_unscaled): New macro. (IUP_SINGLE_PAIR, sfnt_interpret_iup_1): Compute ratio w/ unscaled points if possible.
* | Fix another cause of superfluous inotify signals on AndroidPo Lu2024-01-191-0/+13
| | | | | | | | | | * src/android.c (android_select): If the event queue isn't empty upon the initial check, clear all fdsets.
* | Don't use Qunbound as hash table key when printing (bug#68244)Mattias Engdegård2024-01-181-1/+2
| | | | | | | | | | | | | | This flaw could cause an assertion failure. * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Don't consider Qunbound a print-circle candidate; it should never be seen by Lisp anyway.
* | Only use a hash index size of 1 for tables with size 0 (bug#68244)Mattias Engdegård2024-01-181-5/+10
| | | | | | | | | | | | | | | | This invariant was intended but insufficiently enforced which could lead to an assertion failure. * src/fns.c (hash_index_size): Assume size>0, and return a value >1. (make_hash_table): Only use hash_index_size for size>0.
* | ; * src/androidterm.c (handle_one_android_event): Fix typo.Po Lu2024-01-181-2/+2
| |
* | Increase accuracy of IP instructionPo Lu2024-01-171-3/+83
| | | | | | | | | | | | * src/sfnt.c (sfnt_interpret_ip): Avoid precision loss by retrieving original positions from the unscaled outline, whenever possible.
* | Update pdumper hashes for buffer and Lisp_Hash_TableMattias Engdegård2024-01-161-2/+2
| | | | | | | | | | | | * src/pdumper.c (dump_hash_table): Update for changes in recent hash-table patch suites (bug#68244). (dump_buffer): Update for case-fold-search changes (bug#66117).
* | More efficient hash table thawingMattias Engdegård2024-01-161-21/+31
| | | | | | | | | | | | * src/fns.c (hash_table_thaw): Don't allocate anything for empty tables. Don't initialise the next vector twice. (maybe_resize_hash_table): Factor out min_size constant.
* | ; * src/xterm.c (x_focus_frame): Insert missing unblock_input.Po Lu2024-01-151-1/+4
| |
* | Make object-intervals linear instead of quadraticMattias Engdegård2024-01-141-7/+7
| | | | | | | | | | | | * src/fns.c (collect_interval, Fobject_intervals): Build the returned list in reverse instead of appending single elements.
* | Speed up sxhash-equal-including-propertiesMattias Engdegård2024-01-141-8/+14
| | | | | | | | | | | | | | | | | | | | This function now no longer conses at all. Previously, it constructed a list structure of all string intervals for the sole purpose of hashing. * src/fns.c (hash_interval): New. (Fsxhash_equal_including_properties): Use it instead of collect_interval.
* | Retype traverse_interval arg type from Lisp_Object to void *Mattias Engdegård2024-01-144-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a refactoring. It eliminates a few unnecessary conses and allows for further improvements. * src/intervals.c (traverse_intervals): Change argument type. All callers adapted. * src/fns.c (collect_interval, Fsxhash_equal_including_properties) (Fobject_intervals): * src/print.c (print_check_string_charset_prop) (print_prune_string_charset, print_object, print_interval): Pass a pointer to a Lisp_Object instead of a Lisp_Object.
* | Correct implementations of FLIPRGON and FLIPRGOFFPo Lu2024-01-141-5/+5
| | | | | | | | | | | | | | * src/sfnt.c (sfnt_interpret_fliprgoff) (sfnt_interpret_fliprgon): Reorder arguments to match the order in which arguments are popped by macro wrappers. Fix sundry typos.