aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | Don’t trust st_size when scanning file head+tailPaul Eggert2025-07-131-15/+12
| | | | | | | | | | | | | | * src/fileio.c (Finsert_file_contents): Do not look at st_size when scanning the file’s head and tail for a coding system comment. Instead, just use read and SEEK_END and don’t worry if the latter fails. st_size and lseek might not work in a /proc file system.
* | copy-file no longer trusts st_sizePaul Eggert2025-07-131-42/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In copy-file, do not trust st_size, since it might change as we run, or we might be in a /proc system where it is unreliable anyway. Also, fix some other unlikely copy-file bugs while we’re here. * src/fileio.c (Fcopy_file): Use O_TRUNC when opening a destination that already exists. This saves us the trouble of having to call ftruncate with a possibly-bogus st_size; the old motivation for using ftruncate is no longer compelling. Do not assume ptrdiff_t is as wide as ssize_t; although this is true on all known platforms, it’s easy to not assume it. Don’t trust st_size. Prefer SSIZE_MAX to TYPE_MAXIMUM (ssize_t). Always read+write, regardless of whether copy_file_range failed.
* | READ_BUF_SIZE → sizeof read_bufPaul Eggert2025-07-131-2/+2
| | | | | | | | | | | | * src/fileio.c (Finsert_file_contents): Minor refactoring. This should help future patches which distinguish read_buf’s size from other uses of READ_BUF_SIZE which may change.
* | insert-file-contents errno confusionPaul Eggert2025-07-131-11/+15
| | | | | | | | | | | | * src/fileio.c (read_non_regular): Return negation of errno on failure, instead of -1. (Finsert_file_contents): Signal with correct errno when a read fails.
* | Avoid crashes when profiling multi-threaded Lisp (bug#76970)Pip Cet2025-07-121-1/+5
| | | | | | | | | | * src/eval.c (backtrace_p): Check 'current_thread' before dereferencing it.
* | * src/fns.c (Flength): Fix char table length off-by-one bug.Mattias Engdegård2025-07-111-1/+1
| |
* | Move CSS into the SVG wrapperAlan Third2025-07-101-30/+26
| | | | | | | | | | | | | | | | This allows CSS to be used with librsvg < 2.48. * src/image.c (svg_load_image): Move CSS construction and include "color". Also append the CSS passed in by the user rather than replacing it.
* | Change foreground color handling for SVG files (bug#77841)Alan Third2025-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/images/checkbox-mixed.svg: * etc/images/checked.svg: * etc/images/conceal.svg: * etc/images/down.svg: * etc/images/gnus/gnus-pointer.svg: * etc/images/left.svg: * etc/images/outline-close.svg: * etc/images/outline-open.svg: * etc/images/radio-checked.svg: * etc/images/radio-mixed.svg: * etc/images/radio.svg: * etc/images/reveal.svg: * etc/images/right.svg: * etc/images/symbols/check-mark_16.svg: * etc/images/symbols/chevron_down_16.svg: * etc/images/symbols/chevron_left_16.svg: * etc/images/symbols/chevron_right_16.svg: * etc/images/symbols/chevron_up_16.svg: * etc/images/symbols/cross_16.svg: * etc/images/symbols/cross_circle_16.svg: * etc/images/symbols/cross_circle_fill_16.svg: * etc/images/symbols/dot_large_16.svg: * etc/images/symbols/dot_medium_16.svg: * etc/images/symbols/dot_small_16.svg: * etc/images/symbols/heart_16.svg: * etc/images/symbols/heart_fill_16.svg: * etc/images/symbols/heart_half_16.svg: * etc/images/symbols/menu_16.svg: * etc/images/symbols/minus_16.svg: * etc/images/symbols/minus_circle_16.svg: * etc/images/symbols/minus_circle_fill_16.svg: * etc/images/symbols/plus_16.svg: * etc/images/symbols/plus_circle_16.svg: * etc/images/symbols/plus_circle_fill_16.svg: * etc/images/symbols/star_16.svg: * etc/images/symbols/star_fill_16.svg: * etc/images/symbols/star_half_16.svg: * etc/images/unchecked.svg: * etc/images/up.svg: Set 'fill' color to 'currentcolor'. * etc/images/symbols/README: Add explanation of change to instructions. * src/image.c: Remove setting of the 'fill' color in the default SVG stylesheet.
* | ; * src/fileio.c: Remove version from commentary (bug#78983).Eli Zaretskii2025-07-101-4/+4
| |
* | Unintern Qget_file_char and Qget_emacs_mule_file_charMattias Engdegård2025-07-101-3/+10
| | | | | | | | | | | | | | | | These symbols are used in the reader as special constants and can't be passed from Lisp (Emacs would crash). * src/lread.c (syms_of_lread): Unintern. (init_source): Use BASE_EQ.
* | Speed up low-level parts of the reader and refactorMattias Engdegård2025-07-101-392/+415
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspect the given 'readcharfun' source once, before using it, instead of for each character read. This moves a bunch of branches away from the critical path, with separate functions for different source types. Replace some preprocessor macros with functions. * src/lread.c (READCHAR, UNREAD, READCHAR_REPORT_MULTIBYTE) (FROM_FILE_P): Remove; use corresponding functions instead. All callers adapted. (source_t): New struct that takes the place of the `readcharfun` and `readbyte` arguments in many places. (init_source) (source_buffer_get, source_buffer_unget) (source_marker_get, source_marker_unget) (source_string_get, source_string_unget) (source_file_get, source_file_unget) (source_function_get, source_function_unget) (from_file_p, unreadbyte_from_file): New. (readbyte_from_stdio): Replace `readbyte_from_file`. (readchar, unreadchar): Rewrite. (lisp_file_lexical_cookie, readevalloop, read_internal_start): Create a source_t for use during reading. All signatures and functions called adapted. (read_char_escape): Remove check for an error that can no longer occur.
* | ; * src/lread.c (read_internal_start): Simplify.Mattias Engdegård2025-07-091-11/+3
| | | | | | | | This removes code that became dead in the non-recursive reader reform.
* | Nativecomp don't materialize non-materializable objects (bug#78606)Andrea Corallo2025-07-091-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The native compiler should not try to generate in rendered code immediate floats produced by the constrain on the '=' operator. * test/src/comp-tests.el (comp-test-78606-1): Add test. * test/src/comp-resources/comp-test-funcs.el (comp-test-78606-1-f): New function. * src/comp.c (emit_mvar_rval): Check if an immediate is materializable. * lisp/emacs-lisp/comp.el (comp-ctxt): Add 'non-materializable-objs-h' slot. (comp--fwprop-insn): Update call. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Add parameter.
* | Fix crashes when "emacsclient -nw" frames are suspended (bug#78980)Pip Cet2025-07-091-3/+3
| | | | | | | | | | * src/frame.c (frame_redisplay_p): Start loop with 'f', not its parent frame. Simplify return expression.
* | print_error_message: Handle user-error to the echo area speciallySean Whitton2025-07-091-0/+13
| | | | | | | | | | | | * src/print.c (print_error_message): For a user-error that is to be printed to the echo area, use message3 in order to preserve fontification.
* | Handle invalid frame_or_window slots in tty input events (Bug#78966)Martin Rudalics2025-07-092-10/+34
| | | | | | | | | | | | | | | | | | | | | | * src/frame.c (make_terminal_frame): Initialize terminal's top_frame slot if it has not been set up yet (Bug#78966). * src/keyboard.c (kbd_buffer_get_event): Do not assume that the event's frame_or_window slot always produces a valid frame (Bug#78966). (tty_read_avail_input): Try to make sure that the input event we create has a valid frame_or_window slot (Bug#78966). Add assertion to that purpose.
* | Add a synchronous way to get parser change ranges (bug#78402)Yuan Fu2025-07-081-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit only adds the new function, the fix for the bug is in the next commit. * doc/lispref/parsing.texi (Using Parser): Add docs. * lisp/treesit.el (treesit): Add shortdoc. * src/treesit.c (treesit_get_affected_ranges): New function extracted from treesit_call_after_change_functions. (treesit_call_after_change_functions): Extract out. (treesit_ensure_parsed): Return affected regions. (Ftreesit_parser_changed_regions): New function that returns the affected regions.
* | Cheaper char counting when reading symbolsMattias Engdegård2025-07-071-4/+2
| | | | | | | | * src/lread.c (read0): Strength reduction.
* | Refactor buffering code in the Lisp readerMattias Engdegård2025-07-071-71/+77
| | | | | | | | | | | | | | | | | | | | | | Abstract the buffering in the reader with a struct and plain functions instead of rather unhygienic preprocessor macros. * src/lread.c (READ_AND_BUFFER, INVALID_SYNTAX_WITH_BUFFER): Removed, replaced with... (readbuf_t, readbuf_grow, add_char_to_buffer, read_and_buffer) (invalid_syntax_with_buffer): ...these new functions and struct. (read0): Use new code instead of old preprocessor macros.
* | ; * src/lread.c (skip_lazy_string): more precise commentMattias Engdegård2025-07-071-2/+2
| | | | | | | | The bool vector compat hack is there for a bug in Emacs 19 only.
* | Read non-ASCII chars from unibyte string sources as raw bytesMattias Engdegård2025-07-071-0/+2
| | | | | | | | | | | | | | Previously, latin-1 was incorrectly assumed (bug#70988). * src/lread.c (readchar): Convert to raw byte. * test/src/lread-tests.el (lread-unibyte-string-source): New test.
* | Print non-ASCII chars in unibyte symbols as raw bytesMattias Engdegård2025-07-071-1/+1
| | | | | | | | | | | | | | Previously, latin-1 was incorrectly assumed (bug#70988). * src/print.c (print_object): Call the correct function. * test/src/print-tests.el (print-unibyte-symbols): New test.
* | Read characters from functions as multibyteMattias Engdegård2025-07-071-0/+3
| | | | | | | | | | | | | | Previously, latin-1 was incorrectly assumed (bug#70988). * src/lread.c (readchar): Set multibyte flag. * test/src/lread-tests.el (lread-function-source): New test.
* | (Ftranspose_regions): Fix bug#76124Stefan Monnier2025-07-061-1/+3
| | | | | | | | | | | | | | * src/editfns.c (Ftranspose_regions): Be careful that ELisp code could move the gap from under our feet. * test/src/editfns-tests.el (editfns-tests--bug76124): New test.
* | Merge from origin/emacs-30Eli Zaretskii2025-07-051-1/+15
|\ \ | |/ | | | | | | | | | | | | | | | | 3f7787c9794 ; * lisp/replace.el (query-replace-help): Fix help text (... b10596a6303 ; * lisp/emacs-lisp/warnings.el (warning-display-at-botto... 060f964906b Handle ts_node_type return NULL (bug#78938) 5bdacbe460a Improve documentation of 'warning-display-at-bottom' 30dae2ad239 Handle the case when ts_node_type returns NULL (bug#78938) 985ad1da76d ; * lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc... de18407f513 ; * doc/lispref/functions.texi (Mapping Functions): Fix w...
| * Handle ts_node_type return NULL (bug#78938)Yuan Fu2025-07-041-1/+11
| | | | | | | | | | | | * src/treesit.c (treesit_traverse_match_predicate): Handle the case when ts_node_type returns NULL. (Ftreesit_node_type): Add some comment.
| * Handle the case when ts_node_type returns NULL (bug#78938)Yuan Fu2025-07-031-1/+5
| | | | | | | | * src/treesit.c (Ftreesit_node_type): Handle NULL.
* | Avoid segfaults due to C-g when a thread does GCEli Zaretskii2025-07-031-1/+9
| | | | | | | | | | * src/keyboard.c (handle_interrupt): Don't forcibly switch threads if a non-main thread was in GC when the signal handler was called.
* | Properly invalidate XRender surfaces when only EmacsFrame is resizedPo Lu2025-06-281-30/+42
| | | | | | | | | | | | * src/xterm.c (handle_one_xevent): Drop XRender surfaces when the frame widget is resized, rather than when the toplevel is. (bug#77988)
* | Avoid extra output in Vprin1_to_string_buffer (bug#78842)Pip Cet2025-06-281-9/+14
| | | | | | | | | | | | | | | | | | | | | | print_error_message can throw after producing some output, so use unwind-protect to ensure prin1-to-string-buffer is cleared. * src/print.c (erase_prin1_to_string_buffer): New. (Ferror_message_string): Use it to catch errors thrown in 'print_error_message'. * test/src/print-tests.el (error-message-string-circular): Expand test.
* | Port varargs macros better to C99Paul Eggert2025-06-271-4/+4
| | | | | | | | | | | | | | | | | | C99 prohibits passing zero args to macro’s ‘...’. * lib-src/seccomp-filter.c (RULE0): New macro, which is like RULE except with zero args. All zero-arg uses of RULE changed to RULE0. * src/comp.c (compile_function, Fcomp__init_ctxt, syms_of_comp): Change ‘CALLN (Fmake_hash_table)’ to ‘Fmake_hash_table (0, NULL)’, since CALLN requires at least two args in C99.
* | (Finsert_file_contents): Refine commit d07af40d8826Stefan Monnier2025-06-271-12/+19
| | | | | | | | | | | | | | | | * src/fileio.c (Finsert_file_contents): Inhibit ask-supersession only if we're VISITing in a non-narrowed buffer (bug#78866). * test/src/fileio-tests.el (ert--tests-dir): New var. (fileio-tests--insert-file-contents-supersession): New test.
* | Avoid segfault when profiling Lisp programs with threadsEli Zaretskii2025-06-211-1/+1
| | | | | | | | | | * src/eval.c (backtrace_top): Don't segfault if current_thread is NULL. (Bug#76970)
* | ; * src/xfaces.c (init_xfaces) <face_attr_sym>: Add :family (bug#78813).Eli Zaretskii2025-06-211-0/+1
| |
* | process-attributes uses CLOCK_BOOTTIME for uptimePaul Eggert2025-06-171-41/+13
| | | | | | | | | | | | | | * src/sysdep.c (get_host_uptime) [GNU_LINUX || CYGWIN || __ANDROID__]: New function, replacing get_host_boot_time. Use CLOCK_BOOTTIME instead of inspecting /proc/stat. All callers changed. This should be an even better way to fix Bug#63496.
* | process-attributes uses /proc/stat for boot timePaul Eggert2025-06-171-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | With a Linux kernel, use /proc/stat rather than get_boot_time to get boot time, since when Emacs is running in a container we want the underlying host boot time, not the container boot time. This should be a better way to fix Bug#63496. * src/sysdep.c: Do not include boot-time.h. (get_host_boot_time) [GNU_LINUX || CYGWIN || __ANDROID__]: New function. (system_process_attributes) [GNU_LINUX || CYGWIN || __ANDROID__]: Use it instead of get_boot_time.
* | Prevent redisplay slowdown with non-zero vscrollEli Zaretskii2025-06-171-3/+5
| | | | | | | | | | | | | | * src/xdisp.c (try_scrolling): Don't loop when the partially-visible cursor line is at the top of the window. This looping are pointless, and just makes redisplay slow for no reason. (Bug#78766)
* | process-attributes now uses get_boot_timePaul Eggert2025-06-151-36/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed this issue while looking into Bug#63496. GNU Emacs does not infer the boot time consistently on GNU/Linux and similar platforms: android_notifications_notify_1 and get_boot_sec use Gnulib’s boot-time module, but process-attributes has idiosyncratic code that evidently predates that module. The idiosyncratic code returns an unstable etime, which is a minor bug. Simplify process-attributes by just using Gnulib. This returns a stable etime. It may also fix Bug#63496; if not, we can fix Gnulib later. * src/sysdep.c: Include <boot-time.h>. (get_up_time) [GNU_LINUX || CYGWIN || __ANDROID__]: Remove. (system_process_attributes) [GNU_LINUX || CYGWIN || __ANDROID__]: Use get_boot_time instead of get_up_time.
* | * src/bytecode.c (exec_byte_code): Remove superfluous conditionMattias Engdegård2025-06-151-4/+1
| | | | | | | | | | Bytecode should never be able to set anything to Qunbound because that value is not accessible from Lisp. Found by Pip Cet.
* | * src/fns.c (mapcar1): Less lax type checkingMattias Engdegård2025-06-151-2/+3
| | | | | | | | | | Previously, mapcar etc would crash or return nonsense when passed a record. Found by Pip Cet.
* | Merge from origin/emacs-30Eli Zaretskii2025-06-142-3/+18
|\ \ | |/ | | | | | | | | | | | | | | | | df3fb94f091 Insert missing step to make use of directory tracking OSC... 1bed2949583 * lisp/keymap.el (keymap-set): Refer to 'key-description'... 941158fc133 Support new tree-sitter grammar filename format (bug#78754) 888f846d377 Fix crash when evaluating "(signal nil 5)" (bug#78738) 51b9e92ab8e Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/... c0a913ea4f3 ; * doc/lispref/modes.texi (Font Lock Basics): Remove old... 37de076017a Adapt emba integration (don't merge)
| * Support new tree-sitter grammar filename format (bug#78754)Yuan Fu2025-06-101-2/+17
| | | | | | | | | | | | | | | | | | | | Previously Emacs only looks for filenames like libtree-sitter-json.so.0.0. Now Emacs also look for filenames like libtree-sitter-json.so.15.0. * src/treesit.c: (treesit_load_language_push_for_each_suffix): Add versioned candidate to candidate list too.
| * Fix crash when evaluating "(signal nil 5)" (bug#78738)Pip Cet2025-06-101-1/+1
| | | | | | | | | | | | | | | | | | The docstring already warns against calling signal with a nil error symbol, which is for internal use only, but we can avoid crashing in this case. * src/eval.c (Fsignal): Produce a "peculiar error" for more arguments involving non-lists.
* | Improve documentation of the internal Lisp_Process->status fieldSteven Allen2025-06-141-2/+9
| | | | | | | | | | | | | | | | Contrary to the existing documentation here, the value of this field cannot be the symbols open or closed. Furthermore, this field is never set to "stop" for network connections. * src/process.h (Lisp_Process): Improve/fix documentation of the 'status' field. (Bug#78784)
* | ; * src/profiler.c (export_log): Fix whitespace (bug#78762).Eli Zaretskii2025-06-141-1/+3
| |
* | Fix segfault in profiler-cpu-log and profiler-memory-log (bug#78763)Zach Shaftel2025-06-141-2/+11
| | | | | | | | | | | | | | | | * src/profiler.c (export_log): Check if a log has been allocated first, and return nil if it hasn't. (Fprofiler_cpu_log, Fprofiler_memory_log): Doc fix. * test/src/profiler-tests.el (profiler-tests-cpu-profiler) (profiler-tests-memory-profiler): New tests.
* | ; Fix warnings in MinGW buildsEli Zaretskii2025-06-142-1/+2
| | | | | | | | | | | | | | | | * src/w32fns.c (msh_mousewheel): Declare. * src/treesit.c (treesit_debug_print_linecol): Fix format specifiers. * lib-src/pop.c (pfn_getaddrinfo, pfn_freeaddrinfo): Now static.
* | Support 'C-g C-g C-g' "urgent quit" feature on MS-WindowsEli Zaretskii2025-06-141-0/+7
| | | | | | | | | | * src/w32fns.c (post_character_message): Support triple-C-g. (Bug#78737)
* | Improve documentation for display property functionsJim Porter2025-06-101-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, use the term "display specification" more consistently to distinguish from "display property", which is the full value of the 'display' text property. * src/xdisp.c (find_display_property): Rename PROP to SPEC. (Fget_display_property): Rename PROP to SPEC and improve docstring. * lisp/emacs-lisp/subr-x.el (add-display-text-property): Rename PROP to SPEC and improve docstring. * doc/lispref/display.texi (Display Property): Reword documentation to more-consistently refer to display specifications.
* | Port to Android API 36Po Lu2025-06-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/AndroidManifest.xml.in: Update targetSdkVersion to 36. * java/INSTALL: Document revised compilation dependencies. * java/org/gnu/emacs/EmacsActivity.java (interceptBackGesture): New function. (onCreate): Invoke the same to register back gesture callbacks on Android 16 or better. * java/org/gnu/emacs/EmacsWindow.java (onBackInvoked): New function. * src/keyboard.c (lispy_function_keys): Amend with new symbols introduced in Android API 36.