summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-03-11Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-11Update Android portPo Lu
* configure.ac (HAVE_MAILUTILS, with_mailutils) (ANDROID_SDK_8_OR_EARLIER, XCONFIGURE): Fix POP and mailutils configuration on Android. * java/Makefile.in: * src/callproc.c (syms_of_callproc): Avoid using built-in movemail when --with-mailutils.
2023-03-11Remove recursion from character escape handling in readerMattias Engdegård
This cures a C stack overflow when reading certain long (crafted) strings (bug#62039) and improves performance of reading escaped characters in character and string literals. Reported by Bruno Haible. * src/lread.c (invalid_escape_syntax_error): New. (read_escape): Rename to... (read_char_escape): ...this. Remove recursion. Pass read-ahead char as argument. Improve code performance and clarity. (read_char_literal, read_string_literal): Update calls. * test/src/lread-tests.el (lread-char-modifiers) (lread-many-modifiers): Add test cases.
2023-03-11Update Android portPo Lu
* src/android.c (android_resolve_handle) (android_resolve_handle2): Don't perform checking done by CheckJNI by default. (android_copy_area): Check for errors here because CopyArea can perform a lot of consing. (android_define_cursor): Remove redundant code.
2023-03-11Don't use GCC extensions in src/emacs-module.cPo Lu
* configure.ac: Default modules to on. Remove check for __attribute__((cleanup)). However, keep the new `ifavailable' value for systems without dlopen. * src/emacs-module.c (MODULE_HANDLE_NONLOCAL_EXIT): Don't rely on cleanup attribute and correctly reset handlerlist upon longjmp. (MODULE_INTERNAL_CLEANUP): New macro. (module_make_global_ref, module_free_global_ref) (module_make_function, module_get_function_finalizer) (module_set_function_finalizer, module_make_interactive) (module_funcall, module_intern, module_type_of) (module_extract_integer, module_make_integer, module_extract_float) (module_make_float, module_copy_string_contents) (module_make_string, module_make_unibyte_string) (module_make_user_ptr, module_get_user_ptr, module_set_user_ptr) (module_get_user_finalizer, module_set_user_finalizer) (module_vec_set, module_vec_get, module_vec_size) (module_process_input, module_extract_time, module_make_time) (module_extract_big_integer, module_make_big_integer) (module_open_channel): Call MODULE_INTERNAL_CLEANUP prior to returning.
2023-03-11Implement hourglass cursor on AndroidPo Lu
* lisp/term/android-win.el (x-pointer-arrow, x-pointer-left-ptr) (x-pointer-left-side, x-pointer-sb-h-double-arrow) (x-pointer-sb-v-double-arrow, x-pointer-watch, x-pointer-xterm) (x-pointer-invisible): New constants. * src/androidterm.c (android_show_hourglass) (android_hide_hourglass): New functions. (android_toggle_visible_pointer, android_define_frame_cursor): Define or don't define hourglass cursor if x->hourglass. (android_redisplay_interface): Add new functions. * src/androidterm.h (struct android_output): New field `hourglass'.
2023-03-11Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-10src/profiler.c: Keep track of the discarded countsStefan Monnier
When the table overflows and wh evict entries, keep track of those counts in a global counter so we can see the proportion of samples this represents. * src/profiler.c (struct profiler_log): Add `discarded` field. (evict_lower_half): Change arg to be `struct profiler_log`. Transfer counts to the new `discarded` field. (record_backtrace): Change arg to be `struct profiler_log`. (add_sample): Adjust call accordingly. (export_log): Add `discarded` counts to the result. Onle add the GC and `discarded` counts if they're non-zero. (syms_of_profiler): Define new symbol `Discarded Samples`.
2023-03-10src/profiler.c: Share more code between CPU and Memory profilersStefan Monnier
* src/profiler.c (struct profiler_log): New type. (make_log): Use it. (cpu, memory): New vars to replace cpu_log, memory_log, cpu_gc_count, and mem_gc_count. (add_sample): New function, extracted from `handle_profiler_signal`. (handle_profiler_signal, malloc_probe): Use it. (Fprofiler_cpu_start, Fprofiler_memory_start): Adjust call to `make_log`. (export_log): New function, extracted from `Fprofiler_cpu_log`. (Fprofiler_cpu_log, Fprofiler_memory_log): Use it. (syms_of_profiler, syms_of_profiler_for_pdumper): Adjust to new `cpu` and `memory` vars.
2023-03-10src/profiler.c: Try and fix occasional assertion failuresStefan Monnier
Apparently the (>= match imatch) test fails sometimes in `profiler.el`. Not sure where this comes from, but this patch should remove one possible source. * src/profiler.c (Fprofiler_cpu_log, Fprofiler_memory_log): Change the special Automatic_GC backtrace to make it clear that it's a *sibling* of the call tree (i.e. it's at the (its own) root). (malloc_probe): Obey `size` when incrementing the gc_counter.
2023-03-10src/profiler.c: Keep track of allocations during GCEli Zaretskii
Cargo-cult the `cpu_gc_count` code to `memory_gc_count`. * src/profiler.c (mem_gc_count): New var. (Fprofiler_memory_start): Initialize it. (Fprofiler_memory_log): Increment it. (Fprofiler_memory_log): Use it.
2023-03-10Update Android portPo Lu
* doc/emacs/android.texi (Android Windowing): Document how to pass multimedia keys to the system. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New function. * java/org/gnu/emacs/EmacsView.java (onKeyDown, onKeyMultiple) (onKeyUp): Check that function. * java/org/gnu/emacs/EmacsWindow.java (defineCursor): Handle cases where cursor is NULL. * src/android.c (NATIVE_NAME): New function. * src/androidfns.c (syms_of_androidfns): New variable. * src/keyboard.c (lispy_function_keys): Add volume keys.
2023-03-10Implement mouse cursors on Android 7.0 and laterPo Lu
* java/org/gnu/emacs/EmacsWindow.java (defineCursor): New function. * src/android.c (struct android_emacs_cursor): New struct. (android_init_emacs_cursor): New function. (JNICALL): Call it. (android_create_font_cursor, android_define_cursor) (android_free_cursor): New functions. * src/android.h (enum android_handle_type): Add cursor handle type. * src/androidfns.c (Fx_create_frame, android_create_tip_frame) (enum mouse_cursor, struct mouse_cursor_types, mouse_cursor_types) (struct mouse_cursor_data, android_set_mouse_color) (syms_of_androidfns): * src/androidgui.h (enum android_cursor_shape): * src/androidterm.c (make_invisible_cursor) (android_toggle_invisible_pointer, android_free_frame_resources) (android_define_frame_cursor): * src/androidterm.h (struct android_display_info) (struct android_output): Port mouse cursor code over from X.
2023-03-10Port Android battery status to Android 4.4 and earlierPo Lu
* java/org/gnu/emacs/EmacsService.java (EmacsService) (queryBattery19): New function. (queryBattery): Call it on old systems. Also, return AC line status and temperature. * lisp/battery.el (battery-android): Implement more format directives. * src/android.c (android_query_battery): Handle new status fields. * src/android.h (struct android_battery_state): Add `plugged' and `temperature'. * src/androidfns.c (Fandroid_query_battery): Return new fields.
2023-03-09Update Android portPo Lu
* src/android.c (android_destroy_handle): Handle OOM errors in android_destroy_handle.
2023-03-09; * textconv.c: Remove out-of-date comment.Po Lu
2023-03-09Fix menu and popup race conditions on AndroidPo Lu
* java/org/gnu/emacs/EmacsActivity.java (onContextMenuClosed): * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu) (onMenuItemClick, run): * java/org/gnu/emacs/EmacsDialog.java (EmacsDialog, onClick) (createDialog, onDismiss): Take menu event serial, and pass it along in context menu events. * java/org/gnu/emacs/EmacsNative.java (sendContextMenu): New argument. * src/android.c (sendContextMenu): Pass serial number in event. * src/androidgui.h (struct android_menu_event): New field `menu_event_serial'. * src/androidmenu.c (FIND_METHOD_STATIC) (android_init_emacs_context_menu): Adjust method declarations. (android_menu_show, android_dialog_show): * src/androidterm.c (handle_one_android_event): Expect serial in context menu events. * src/androidterm.h: Update prototypes.
2023-03-09Update Android portPo Lu
* java/debug.sh (is_root): Port to android versions which don't support `chmod +x'. * src/android.c (android_content_name_p): Disable before API level 19.
2023-03-09Update Android portPo Lu
* src/android.c (android_build_string): Convert the text to UTF-16, and create the Java string using that. (android_build_jstring): Update comment. * src/androidmenu.c (android_init_emacs_context_menu): Add String argument to `addItem'. (android_menu_show): Correctly pass help strings in regular menu items. * src/sfnt.c (_sfnt_swap16, _sfnt_swap32): Avoid reserved names.
2023-03-09Fix crash upon restoring desktopPo Lu
* src/android.c (android_set_input_focus): Don't call method on window using service class.
2023-03-09; * src/sfnt.c (ODD): Use PUSH_UNCHECKED.Po Lu
2023-03-08Update Android portPo Lu
* src/fileio.c (Fcopy_file): On Android, ignore ENOSYS and ENOTSUP when restoring file times, as the system call used is supported by many kernels.
2023-03-08Fix occasional crashPo Lu
* src/androidterm.c (android_build_extracted_text): Return NULL if text class not initialized. (android_update_selection): Check that EXTRACTED is not NULL.
2023-03-08Update Android portPo Lu
* doc/emacs/android.texi (Android File System): Document what `temp~unlinked' means in the temporary files directory. * java/org/gnu/emacs/EmacsService.java (updateExtractedText): New function. * java/org/gnu/emacs/EmacsView.java (onCreateInputConnection): Ask the input method nicely to not display the extracted text UI. * src/android.c (struct android_emacs_service): New method `updateExtractedText'. (android_hack_asset_fd_fallback): Improve naming convention. Fix typo. (android_init_emacs_service): Add new method. (android_update_extracted_text): New function. (android_open_asset): Fix typo. * src/androidgui.h: Update prototypes. * src/androidterm.c (struct android_get_extracted_text_context): New field `flags'. (android_get_extracted_text): Set flags on the frame's output data. (android_build_extracted_text): New function. (getExtractedText): Move out class structures. (android_update_selection): Send updates to extracted text if the input method asked for them. (android_reset_conversion): Clear extracted text flags. * src/androidterm.h (struct android_output): New fields for storing extracted text data.
2023-03-08Fix double free upon encountering invalid fontPo Lu
* src/sfnt.c (sfnt_read_cmap_table): Don't allocate too big data. Also, free elements of (*data), not offsets into data itself.
2023-03-07Save build timestamps in Android buildsPo Lu
* java/Makefile.in (install_temp/assets/build_info): New rule.:(emacs.apk-in): Depend on that file. * lisp/version.el (android-read-build-system) (android-read-build-time): New functions. (emacs-build-system, emacs-build-time): Use those functions on Android, as dumping is done after installation on Android. * src/fileio.c (Finsert_file_contents): * src/window.c (replace_buffer_in_windows): Don't call functions if they are not defined, which can happen during loadup.
2023-03-07Update Android portPo Lu
* java/org/gnu/emacs/EmacsWindow.java (onSomeKindOfMotionEvent): Dismiss splurious LeaveNotify events from button presses. * src/android.c (android_change_window_attributes) (android_change_gc, android_set_clip_rectangles) (android_reparent_window, android_clear_window, android_map_window) (android_unmap_window, android_resize_window, android_move_window) (android_swap_buffers, android_fill_rectangle, android_copy_area) (android_fill_polygon, android_draw_rectangle, android_draw_point) (android_draw_line, android_clear_area, android_bell) (android_set_input_focus, android_raise_window) (android_lower_window, android_set_dont_focus_on_map) (android_set_dont_accept_focus, android_get_keysym_name) (android_toggle_on_screen_keyboard, android_restart_emacs) (android_display_toast, android_update_ic, android_reset_ic) (android_set_fullscreen): Optimize by specifying the class explicitly when calling a method.
2023-03-07Update Android portPo Lu
* src/lread.c (lread_fd, file_tell, infile, skip_dyn_bytes) (skip_dyn_eof, readbyte_from_stdio, safe_to_load_version) (close_infile_unwind, close_file_unwind_android_fd): New function. (Fload, Flocate_file_internal, openp): New argument PLATFORM. All callers changed. (skip_lazy_string): Add optimized versions of various functions for accessing Android assets.
2023-03-06Update Android portPo Lu
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New function requestSelectionUpdate. * java/org/gnu/emacs/EmacsView.java (onCreateInputConnection): Call it instead of losing if getting the current selection fails. * src/android-asset.h (AAsset_seek): Define stub. * src/android.c (android_open): Take mode_t. (android_open_asset, android_close_asset, android_asset_read_quit) (android_asset_read, android_asset_lseek, android_asset_fstat): New functions. * src/android.h (struct android_fd_or_asset): Update prototypes. * src/androidgui.h (enum android_ime_operation): Add new operation to update the selection position. * src/androidterm.c (android_handle_ime_event): Handle new operation. (requestSelectionUpdate): New function. * src/fileio.c (close_file_unwind_emacs_fd): New function. (Fcopy_file, union read_non_regular, read_non_regular) (Finsert_file_contents): Use optimized codepath to insert Android asset files. * src/frame.h (enum text_conversion_operation): New operation. * src/textconv.c (really_request_point_update) (handle_pending_conversion_events_1, request_point_update): New functions. * src/textconv.h: Update prototypes.
2023-03-06* src/conf_post.h: Avoid macro redeclaration.Po Lu
2023-03-06Update Android portPo Lu
* java/org/gnu/emacs/EmacsService.java (sync): Delete function. * java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap): Erase with window background. (onDetachedFromWindow): Only recycle bitmap if non-NULL. * java/org/gnu/emacs/EmacsWindow.java (background): New field. (changeWindowBackground): Set it. * src/android.c (struct android_emacs_service): Remove `sync'. (android_init_emacs_service): Likewise. (android_sync): Delete function. * src/androidfns.c (android_create_tip_frame): Set frame background color correctly. (Fx_show_tip): Make the tip frame visible. * src/androidgui.h: Update prototypes. * src/androidterm.c (handle_one_android_event): Handle tooltip movement correctly.
2023-03-05Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-05Update Android portPo Lu
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Don't set the style here. * java/res/values-v11/style.xml: * java/res/values-v14/style.xml: * java/res/values-v29/style.xml: * java/res/values/style.xml: Define styles for the emacsclient wrapper. * src/keyboard.c (read_key_sequence): Don't disable text conversion if use_mouse_menu or if a menu bar prefix key is being displayed.
2023-03-05Update Android portPo Lu
* etc/PROBLEMS: Document problem with default monospace font. * src/fileio.c (check_mutable_filename): Check /content as well. (Fcopy_file, Fdelete_directory_internal, Fdelete_file) (Frename_file, Fadd_name_to_file, Fmake_symbolic_link) (Fset_file_modes, Fset_file_times, Ffile_newer_than_file_p) (write_region): Adjust accordingly. (Fset_visited_file_modtime): Remove unnecessary restriction. * src/filelock.c (make_lock_file_name): Don't interlock files under /assets and /content. * src/inotify.c (Finotify_add_watch): Fix typo.
2023-03-05Merge from origin/emacs-29Stefan Kangas
836044f329a Fix c-ts-mode preproc directive indentation 64980a59b65 ; * lisp/files.el (hack-local-variables): Fix typo in the... a7cd125d490 More robustly unspoof HOME in Eglot tests (bug#61637) 6c66dbd02c7 Turn on Eglot inlay hints by default 246f5b541c5 Update ts modes missed in 4c16fd3a512 to use column-0 0bfba49ca7c Robustify Eglot for "transient" projects ea5fd375bb2 Fix documentation of 'normal-mode' in buffers that don't ... 4c16fd3a512 Change tree-sitter indent anchor 'point-min' to 'column-0' f47b3930158 Fix go-ts-mode multi-line string indentation (bug#61923) e0bf2da3db6 ; More accurate doc strings for 'window-at' and 'window-a...
2023-03-05Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-04Unbreak the unexec buildEli Zaretskii
* src/alloc.c (BLOCK_ALIGN) [HAVE_UNEXEC]: Reset back to 1024. (Bug#61960)
2023-03-04Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-04Fix out of bound write after poly of single pixel spanPo Lu
* src/sfnt.c (sfnt_fill_span): Specifically handle spans that span a single pixel by computing the coverage in the center.
2023-03-04bug#61489: Increase BLOCK_ALIGN from 1024 to 32768Konstantin Kharlamov
Originally discovered by Tyler Dodge in his article "Significant Garbage Collection Improvement For Emacs". While testing this change on Archlinux system with Intel i5-7200U CPU, average time of garbage collection gets reduced by ≈25%. Other users report improvements up to 50%. While monitoring PSS of emacs with and without customizations loaded before and after the patch, no statistically significant differences were discovered. So overall, this change is a win. * src/alloc.c (BLOCK_ALIGN): increase from 1024 to 32768.
2023-03-04; More accurate doc strings for 'window-at' and 'window-at-x-y'.Eli Zaretskii
* lisp/window.el (window-at-x-y): * src/window.c (Fwindow_at): Doc fix. (Bug#61948)
2023-03-04Port to broken Android NDK versionPo Lu
* configure.ac: Check for __ctype_get_mb_cur_max. Then see if MB_CUR_MAX is defined to it, and define REPLACEMENT_MB_CUR_MAX if so and it does not link. * java/INSTALL: Update documentation. * src/conf_post.h (MB_CUR_MAX): Define replacement if necessary.
2023-03-04Merge from origin/emacs-29Stefan Kangas
bd5115e1347 Remove Eglot activation check from find-file-hook adc04ad5247 * src/intervals.c (set_intervals_multibyte_1): Fix bug#61887 b3e930d328e Revert inadvertent change to lisp/icomplete.el in previou... da8e4b6fe43 Revert previous change in go-ts-mode.el 7548446194a Release ERC 5.5 585faf4c173 ; More doc improvements for OClosures 2840895c1ae Don't create GUI frames in batch sessions 452b5ed1030 ; Fix wrong error name in erc-server-908 doc string. 1e9484f2fd1 ; * etc/ERC-NEWS: Mention more deprecations. 119b3a4dba1 Minor copyedits of documentation of OClosures 3a651773d29 Eglot: pay better attention to hints' paddingLeft/Right (... # Conflicts: # etc/NEWS
2023-03-03* src/intervals.c (set_intervals_multibyte_1): Fix bug#61887Stefan Monnier
When `total_length` is 0 there should be no subtree at all, but `delete_interval` only deletes one interval, so make sure we don't end up with some stale child of `i`.
2023-03-03Fix visiting and saving writable content provider filesPo Lu
* java/org/gnu/emacs/EmacsService.java (checkContentUri): Improve debug output. * lisp/files.el (basic-save-buffer): Check whether or not file itself exists before checking for the existence of the directory containing it. * src/android.c (android_open): Don't forget to set errno after open_content_uri fails.
2023-03-03Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-03Update Android portPo Lu
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity) (onCreate): Add view tree observer. (onGlobalLayout): Sync fullscreen state. (syncFullscreenWith): Improve visibility flag setting. * src/textconv.c (select_window): New function. (textconv_query): (restore_selected_window): (really_commit_text): (really_set_composing_text): (really_set_composing_region): (really_delete_surrounding_text): (really_set_point_and_mark): (get_extracted_text): Call it instead of Fselect_window to avoid selecting the mini window if it is no longer active.
2023-03-03Merge from origin/emacs-29Stefan Kangas
9e105d483fa Fix c-ts-mode indentation for statement after preproc (bu... a72a55e3e49 Fix c/c++-ts-mode's mode lighter 67befc1f5a5 Eglot: use shell-file-name in eglot--cmd (bug#61748) 1c7b2673bdd Avoid signaling errors in url-basic-auth when password is... 756225e3778 Fix wdired-tests on MS-Windows a137f71c67e Improvements to xwidget on macOS (bug#60703) 3f43a16bc63 ; Avoid byte-compilation warning in c-ts-mode.el
2023-03-02Merge remote-tracking branch 'origin/master' into feature/androidPo Lu
2023-03-02Improvements to xwidget on macOS (bug#60703)Andrew De Angelis
* src/nsxwidget.m () ([XwWebView initWithFrame:configuration:xwidget:]) (nsxwidget_init): Fixed memory leaks: when sending an alloc message to an object, send an autorelease message to any objects we won't explictly release. ([XwWebView webView:didFinishNavigation:]): Second string to store in 'store_xwidget_event_string' is "load finished" rather than empty string. ([XwWebView webView:didStartProvisionalNavigation:]) ([XwWebView webView:didReceiveServerRedirectForProvisionalNavigation:]) ([XwWebView webView:didCommitNavigation:]): New functions. (nsxwidget_webkit_estimated_load_progress): New function. (nsxwidget_webkit_stop_loading): New function. * src/xwidget.c (Fxwidget_webkit_estimated_load_progress): Call 'nsxwidget_webkit_estimated_load_progress' if we're on MacOS. (Fxwidget_webkit_stop_loading): Call 'nsxwidget_webkit_stop_loading' if we're on MacOS. (syms_of_xwidget): Define symbol for function. 'xwidget_webkit_estimated_load_progress' if we're on MacOS. * src/nsxwidget.h: Signature for functions 'nsxwidget_webkit_estimated_load_progress' and 'nsxwidget_webkit_stop_loading'. * lisp/xwidget.el (xwidget-webkit-current-url): Message URL rather than return value of 'kill-new' (which is always nil).