commit 5e12f4c89cbb0fd5fb0002686815a71f5d6220f7 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Wed Aug 16 14:33:47 2023 +0800 ; ChangeLog.android: Clean up more entries. diff --git a/ChangeLog.android b/ChangeLog.android index 8c54909e60f..759868c668e 100644 --- a/ChangeLog.android +++ b/ChangeLog.android @@ -2908,10 +2908,8 @@ 2023-03-11 Po Lu * configure.ac (with_mailutils): Default to off on Android. - - * configure.ac (HAVE_MAILUTILS, with_mailutils) - (ANDROID_SDK_8_OR_EARLIER, XCONFIGURE): Fix POP and mailutils - configuration on Android. + (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 @@ -2934,16 +2932,12 @@ * lib/gnulib.mk.in: Update from gnulib. -2023-03-11 Po Lu - - Don't use GCC extensions in src/emacs-module.c * 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. + * 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) @@ -2976,203 +2970,203 @@ 2023-03-10 Po Lu - Update Android port - * doc/emacs/android.texi (Android Windowing): Document how to - pass multimedia keys to the system. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New - function. + * doc/emacs/android.texi (Android Windowing): Document how to pass + multimedia keys to the system. + + * java/org/gnu/emacs/EmacsNative.java + (shouldForwardMultimediaButtons): 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. + + * 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. * java/org/gnu/emacs/EmacsCursor.java: New file. - Implement mouse cursors on Android 7.0 and later * 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. + (initEmacs): 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. * java/org/gnu/emacs/EmacsNative.java: Add missing dependency. - Avoid using Linux sysfs APIs to access battery state on Android - * lisp/battery.el (battery-status-function): Don't look for /sys, - /proc* on Android. Explain why. + * lisp/battery.el (battery-status-function): Don't look for /sys + or /proc* on Android. Explain why. - Port Android battery status to Android 4.4 and earlier - * java/org/gnu/emacs/EmacsService.java (EmacsService) - (queryBattery19): New function. + * java/org/gnu/emacs/EmacsService.java (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. - Merge remote-tracking branch 'origin/master' into feature/android + * src/android.c (android_query_battery): Handle new status fields. -2023-03-09 Po Lu + * src/android.h (struct android_battery_state): Add `plugged' and + `temperature'. - Merge remote-tracking branch 'origin/master' into feature/android + * src/androidfns.c (Fandroid_query_battery): Return new fields. + +2023-03-09 Po Lu - Update Android port * src/android.c (android_destroy_handle): Handle OOM errors in android_destroy_handle. * textconv.c: Remove out-of-date comment. -2023-03-09 Po Lu - - Fix menu and popup race conditions on Android * 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/EmacsDialog.java (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. + + * src/androidmenu.c (android_init_emacs_dialog): 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-09 Po Lu + * src/androidterm.h: Update prototypes. - Fix webp test for Android * configure.ac (HAVE_WEBP): Disable WebPGetInfo check when REALLY_ANDROID. - Merge remote-tracking branch 'origin/master' into feature/android - - Update Android port - * java/debug.sh (is_root): Port to android versions which don't + * 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. - Update Android port - * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu) - (addItem): New argument `tooltip'. + * src/android.c (android_content_name_p): Disable before API level + 19. + + * java/org/gnu/emacs/EmacsContextMenu.java (addItem): New argument + `tooltip'. - Update Android port * 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'. + + * 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. - Fix crash upon restoring desktop * src/android.c (android_set_input_focus): Don't call method on window using service class. * src/sfnt.c (ODD): Use PUSH_UNCHECKED. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-03-08 Po Lu - Update Android port - * 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. - - Merge remote-tracking branch 'origin/master' into feature/android + * src/fileio.c (Fcopy_file): On Android, ignore ENOSYS and ENOTSUP + when restoring file times, as many old kernel versions encountered + on Android devices omit support for the relevant system calls. - Fix occasional crash - * src/androidterm.c (android_build_extracted_text): Return NULL - if text class not initialized. + * src/androidterm.c (android_build_extracted_text): Return NULL if + text class not initialized. (android_update_selection): Check that EXTRACTED is not NULL. - Update Android port * 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. + + * 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_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_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. - Fix double free upon encountering invalid font - * src/sfnt.c (sfnt_read_cmap_table): Don't allocate too big - data. Also, free elements of (*data), not offsets into data - itself. - - Merge remote-tracking branch 'origin/master' into feature/android + * 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-07 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * java/Makefile.in (install_temp/assets/build_info): New rule. + (emacs.apk-in): Depend on that file. - Save build timestamps in Android builds - * 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. - Update Android port * 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_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) @@ -3183,75 +3177,77 @@ (android_set_fullscreen): Optimize by specifying the class explicitly when calling a method. - Merge remote-tracking branch 'origin/master' into feature/android - - Update Android port * 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. + (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. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-03-06 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New function + requestSelectionUpdate. - Update Android port - * 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. + 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. + + * src/android.c (android_open): Take mode_t MODE instead of int. (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/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. + (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. * src/conf_post.h: Avoid macro redeclaration. - Update Android port * 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-05 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Update Android port * java/org/gnu/emacs/EmacsActivity.java (onCreate): * java/org/gnu/emacs/EmacsContextMenu.java: * java/org/gnu/emacs/EmacsDocumentsProvider.java (getMimeType): @@ -3261,49 +3257,48 @@ * java/org/gnu/emacs/EmacsFontDriver.java: * java/org/gnu/emacs/EmacsHandleObject.java: * java/org/gnu/emacs/EmacsInputConnection.java: - * java/org/gnu/emacs/EmacsMultitaskActivity.java - (EmacsMultitaskActivity): + * java/org/gnu/emacs/EmacsMultitaskActivity.java: * java/org/gnu/emacs/EmacsNative.java: - * java/org/gnu/emacs/EmacsNoninteractive.java - (EmacsNoninteractive, main): - * java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity) - (startEmacsClient): + * java/org/gnu/emacs/EmacsNoninteractive.java (main): + * java/org/gnu/emacs/EmacsOpenActivity.java (startEmacsClient): * java/org/gnu/emacs/EmacsSdk7FontDriver.java: * java/org/gnu/emacs/EmacsSdk8Clipboard.java: - * java/org/gnu/emacs/EmacsService.java (EmacsService, onCreate): - * java/org/gnu/emacs/EmacsView.java (EmacsView, onLayout): + * java/org/gnu/emacs/EmacsService.java (onCreate): + * java/org/gnu/emacs/EmacsView.java (onLayout): * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): - * java/org/gnu/emacs/EmacsWindowAttachmentManager.java - (EmacsWindowAttachmentManager): Remove redundant includes. - Reorganize some functions around, remove duplicate `getLibDir' - functions, and remove unused local variables. + * java/org/gnu/emacs/EmacsWindowAttachmentManager.java: Remove + redundant includes. Reorganize some functions, remove duplicate + `getLibDir' functions, and remove unused local variables. + + * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Don't set + the style here. - Update Android port - * 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. + conversion if use_mouse_menu or if a menu bar prefix key is being + displayed. - Update Android port * etc/PROBLEMS: Document problem with default monospace font. - * src/fileio.c (check_mutable_filename): Check /content as well. + + * src/fileio.c (check_mutable_filename): Check if the file is a + constituent of /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. - Fix cross compilation of cross/lib in some cases - * cross/Makefile.in: (config.status): Depend on + * cross/Makefile.in (config.status): Depend on top_builddir/config.status instead. * configure.ac: Fix another typo. @@ -3312,189 +3307,168 @@ * cross/README: Update. - Remove redundant gnulib files * cross/lib: Delete. Make configure generate it instead. - Remove redundant second copy of gnulib * .gitignore: Simplify cross/lib rule. + * admin/merge-gnulib (avoided_flags): Stop copying to cross/lib. - * configure.ac: Link gnulib source and header files to - cross/lib. + + * configure.ac: Link gnulib source and header files to cross/lib. + * cross/Makefile.in (LIB_SRCDIR): Make relative to builddir. (maintainer-clean): Merge with distclean. Remove links created by configure. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-03-04 Po Lu - Fix x86_64 builds of libjpeg on Android * cross/ndk-build/ndk-build-shared-library.mk: * cross/ndk-build/ndk-build-static-library.mk: Specify right ELF format for 64 bit executables. - Fix calls to nasm in cross/ndk-build * cross/ndk-build/ndk-build-shared-library.mk: * cross/ndk-build/ndk-build-static-library.mk: Ensure nasm generates ELF objects. - Merge remote-tracking branch 'origin/master' into feature/android + * src/sfnt.c (sfnt_fill_span): Specifically handle spans that span + a single pixel by computing the coverage in the center. - Fix out of bound write after poly of single pixel span - * src/sfnt.c (sfnt_fill_span): Specifically handle spans that - span a single pixel by computing the coverage in the center. + * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New field + `lastClosedMenu'. + (onContextMenuClosed): Don't send event if a menu is closed twice + in a row. Also, clear wasSubmenuSelected immediately. - Improve context menus on old versions of Android - * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New - field `lastClosedMenu'. - (onContextMenuClosed): Don't send event if a menu is closed - twice in a row. Also, clear wasSubmenuSelected immediately. * java/org/gnu/emacs/EmacsContextMenu.java: Display submenus manually in Android 6.0 and earlier. + * java/org/gnu/emacs/EmacsView.java (onCreateContextMenu) (popupMenu): Adjust accordingly. - Port to broken Android NDK version - * 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. + * 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. * m4/ndk-build.m4 (ndk_INIT): Fix typo. - Merge remote-tracking branch 'origin/master' into feature/android - - Improve support for building Android C++ dependencies * configure.ac: Call ndk_LATE after gl_EARLY. + * cross/ndk-build/Makefile.in (NDK_BUILD_CXX): New variable. + * cross/ndk-build/ndk-build-shared-library.mk: * cross/ndk-build/ndk-build-static-library.mk: Use it. + * java/INSTALL: Describe how to build C++ dependencies. + * m4/ndk-build.m4 (ndk_LATE): New macro. (ndk_INIT): Try to find a suitable C++ compiler. (ndk_CHECK_MODULES): Make sure the C++ compiler works before allowing C++ dependencies. - Fix cross-compilation of C++ code with old NDK versions - * cross/ndk-build/Makefile.in (NDK_BUILD_CFLAGS_CXX): New variable. + * cross/ndk-build/Makefile.in (NDK_BUILD_CFLAGS_CXX): New + variable. + * cross/ndk-build/ndk-build-shared-library.mk ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): * cross/ndk-build/ndk-build-static-library.mk - ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): Use it to build - C++ code. + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): Use it to + build C++ code. 2023-03-03 Po Lu - Minor fixes to configury * configure.ac (ANDROID_SDK_8_OR_EARLIER): Pass through `--with-ndk-cxx-shared'. - * m4/ndk-build.m4: Fix quoting of $CC. - Fix out-of-tree builds with native dependencies + * m4/ndk-build.m4 (ndk_INIT): Fix quoting of $CC. + * cross/ndk-build/ndk-build-shared-library.mk: * cross/ndk-build/ndk-build-static-library.mk: Include ndk-resolve.mk in srcdir. * cross/ndk-build/README: Update accordingly. - Improve ndk-build implementation * build-aux/ndk-build-helper.mk: Define in terms of BUILD_AUXDIR. + * m4/ndk-build.m4 (ndk_INIT): Find right build-aux directory. Remove uses of unportable shell constructs. - Fix visiting and saving writable content provider files - * java/org/gnu/emacs/EmacsService.java (checkContentUri): - Improve debug output. + * 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. - Merge remote-tracking branch 'origin/master' into feature/android - -2023-03-03 Po Lu - - Update Android port - * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity) - (onCreate): Add view tree observer. + * java/org/gnu/emacs/EmacsActivity.java (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-03 Po Lu - - Merge remote-tracking branch 'origin/master' into feature/android + (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-02 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Merge remote-tracking branch 'origin/master' into feature/android - * doc/emacs/input.texi (On-Screen Keyboards): Fix indexing. - Summary: Update Android port * INSTALL: Document where to find Android installation instructions. + * configure.ac (CHECK_LISP_OBJECT_TYPE): Pacify -Wsuggest-attribute=noreturn only on Android. + * cross/ndk-build/README: New file. + * doc/emacs/android.texi (Android): * doc/emacs/emacs.texi (Top): * doc/emacs/input.texi (Other Input Devices): Untabify menus. + * etc/NEWS: Move INSTALL.android to java/INSTALL. + * java/INSTALL: New file. + * java/README: + * src/coding.c (from_unicode_buffer): Make Android specific code only build on Android. * INSTALL.android: Remove file. - Fix Makefile race conditions * configure.ac: Make cross/* and related directories. + * cross/Makefile.in (src/verbose.mk, lib/libgnu.a) (src/config.h): Stop making directories here. (lib-src/config.h): New config.h rule. ($(LIBSRC_BINARIES)): Add it. (clean): Don't remove CLEAN_SUBDIRS, but clean inside. - Fix Android handle wraparound * src/android.c (android_alloc_id): Return correct values upon wraparound. -2023-03-02 Po Lu - - Improve criteria for restoring fullscreen state on Android - * java/Makefile.in ($(CLASS_FILES) &): Touch all class files, - even those javac chose not to rebuild. + * java/Makefile.in ($(CLASS_FILES) &): Touch all class files, even + those the Java compiler elected not to rebuild. * java/org/gnu/emacs/EmacsActivity.java (onWindowFocusChanged): Restore fullscreen state here. (onResume): And not here. -2023-03-02 Po Lu - - Fix sectioning of android texi files * doc/emacs/android.texi (Android): * doc/emacs/emacs.texi (Top, GNU Free Documentation License): Rearrange menu and sectioning. - Update Android port * doc/emacs/android.texi (Android Windowing): Reword documentation. + * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu): * java/org/gnu/emacs/EmacsFontDriver.java (EmacsFontDriver): @@ -3502,31 +3476,36 @@ (EmacsSdk7FontDriver): * java/org/gnu/emacs/EmacsService.java (queryBattery): * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Make - functions final and classes static where necessary. + functions final and classes static where possible. This + subsequently brings a small speed-up as the JVM can optimize + vtable dispatch away at run-time. + * src/android.c (struct android_emacs_service): New method `display_toast'. (android_init_emacs_service): Load new method. (android_display_toast): New function. - * src/android.h: Export. + + * src/android.h (android_display_toast): Export that new function. + * src/androidfns.c (Fandroid_detect_mouse): * src/androidselect.c (Fandroid_clipboard_owner_p) (Fandroid_set_clipboard, Fandroid_get_clipboard) (Fandroid_browse_url): Prevent crashes when called from - libandroid-emacs.so. + libandroid-emacs.so, where the Emacs service object is not + present. + * src/androidterm.c (handle_one_android_event): Fix out of date commentary. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-03-01 Po Lu - Fix out-of-tree Android builds - * configure.ac (JAVA_PUSH_LINT): Push to WARN_JAVAFLAGS instead - of JAVAFLAGS. + * configure.ac (JAVA_PUSH_LINT): Push to WARN_JAVAFLAGS instead of + JAVAFLAGS. (cross/lib): Always AS_MKDIR_P. + * cross/Makefile.in (srcdir): New variable. - (LIB_SRCDIR): Take realpath relative to srcdir, not - .:(src/verbose.mk): Depend on verbose.mk.android in srcdir. + (LIB_SRCDIR): Take realpath relative to srcdir, not. + (src/verbose.mk): Depend on verbose.mk.android in srcdir. (lib/Makefile): Edit srcdir and VPATH to LIB_SRCDIR. (src/Makefile): Edit -I$$(top_srcdir) to -I../$(srcdir)/lib, instead of ommitting it. @@ -3540,47 +3519,46 @@ (install_temp, emacs.apk-in) (../config.status): Depend relative to top_srcdir. (AndroidManifest.xml, $(APK_NAME)): Likewise. - (RESOURCE_FILE, CLASS_FILES, classes.dex): Output class files - to $(srcdir); these are arch independents, so this is okay. + (RESOURCE_FILE, CLASS_FILES, classes.dex): Output class files to + $(srcdir); these are arch independents, so this is okay. 2023-03-01 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Fix mostlyclean rules * cross/Makefile.in: Remove outdated comment. - * src/Makefile.in: (.PHONY): Clean android-emacs and - libemacs.so, not emacs.so and aemacs. - Update Android port + * src/Makefile.in (.PHONY): Clean android-emacs and libemacs.so, + not emacs.so and aemacs. + * doc/emacs/android.texi (Android File System): Document new behavior of starting a subprocess from /assets. + * java/org/gnu/emacs/EmacsWindow.java (onSomeKindOfMotionEvent): Don't use isFromSource where not present. - * src/androidterm.c (android_scroll_run): Avoid undefined - behavior writing to bitfields. + + * src/androidterm.c (android_scroll_run): Avoid undefined behavior + writing to bitfields. + * src/callproc.c (get_current_directory): When trying to run a - subprocess inside /assets, run it from the home directory - instead. + subprocess inside /assets, run it from the home directory instead. - Update Android port * java/AndroidManifest.xml.in: Specify @style/EmacsStyle. + * java/org/gnu/emacs/EmacsActivity.java (onCreate): Stop setting the theme here. + * java/res/values-v11/style.xml: * java/res/values-v14/style.xml: * java/res/values-v29/style.xml: * java/res/values/style.xml: Extract style resources into res/values. - Update Android port * java/Makefile.in (ETAGS, clean): New rules to generate tags. + * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): * java/org/gnu/emacs/EmacsApplication.java (EmacsApplication): * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu): * java/org/gnu/emacs/EmacsCopyArea.java (EmacsCopyArea): - * java/org/gnu/emacs/EmacsDialog.java (EmacsDialog)::(dialog. - Then): + * java/org/gnu/emacs/EmacsDialog.java (EmacsDialog): * java/org/gnu/emacs/EmacsDocumentsProvider.java (EmacsDocumentsProvider): * java/org/gnu/emacs/EmacsDrawLine.java (EmacsDrawLine): @@ -3607,36 +3585,33 @@ * java/org/gnu/emacs/EmacsSdk8Clipboard.java (EmacsSdk8Clipboard): * java/org/gnu/emacs/EmacsService.java (EmacsService): - * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView) - (buffers): - * java/org/gnu/emacs/EmacsView.java (EmacsView, ViewGroup): - * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, drawables): + * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView): + * java/org/gnu/emacs/EmacsView.java (EmacsView): + * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): * java/org/gnu/emacs/EmacsWindowAttachmentManager.java (EmacsWindowAttachmentManager): Make classes final where - appropriate. + appropriate. The Java virtual machine is capable of removing + vtable dispatch when a virtual function call is being performed on + an instance of a final class. - More fixes to JNI error checking * src/android.c (android_query_tree, android_get_geometry) - (android_translate_coordinates, android_query_battery): - Correctly handle result of GetTArrayElements. + (android_translate_coordinates, android_query_battery): Correctly + verify the results of calls to JNI GetArrayElements + functions. (android_exception_check_nonnull): New function. - * src/android.h: - * src/androidselect.c (Fandroid_get_clipboard): Likewise. - Merge remote-tracking branch 'origin/master' into feature/android + * src/androidselect.c (Fandroid_get_clipboard): Also check the + return values of calls to JNI array extraction functions. 2023-02-28 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Update Android port * src/sfnt.c (main): + * src/sfntfont.c (sfntfont_get_glyph_outline): Remove outdated - comment. + commentary. 2023-02-26 Po Lu - Get rid of android_lookup_method * src/android.c (struct android_emacs_window): New methods. (android_init_emacs_window): Add new methods. (android_lookup_method): Delete now-unused function. @@ -3646,61 +3621,60 @@ (android_raise_window, android_lower_window, android_get_geometry) (android_translate_coordinates, android_set_dont_focus_on_map) (android_set_dont_accept_focus): Don't look up the class and - method each time when calling a function; that's just waste. + method each time when calling a function; that's just wasteful. - Update from gnulib * cross/lib/unistd.in.h: - * lib/gnulib.mk.in (INT64_MAX_EQ_LONG_MAX): - * m4/gnulib-comp.m4 (gl_EARLY): Update from gnulib. - - Merge remote-tracking branch 'origin/master' into feature/android + * lib/gnulib.mk.in: + * m4/gnulib-comp.m4: Update from gnulib. - Update Android port * doc/lispref/commands.texi (Misc Events): Update documentation. - * java/org/gnu/emacs/EmacsService.java (EmacsService) - (onStartCommand): Improve notification message. + + * java/org/gnu/emacs/EmacsService.java (onStartCommand): Improve + notification message. + * src/android.c (android_hack_asset_fd): Detect if ashmem is available dynamically. (android_detect_ashmem): New function. + * src/textconv.c (record_buffer_change): Use markers to represent BEG and END instead. (syms_of_textconv): Update doc string. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-02-25 Po Lu - Update Android port - * java/debug.sh (is_root): Fix tee detection again for old - systems which don't return exit codes from adb shell. - * src/android.c (android_run_select_thread, NATIVE_NAME, - JNICALL): - * src/android.h (NATIVE_NAME): - * src/androidterm.c (JNICALL, NATIVE_NAME): Apply stack - alignment to all JNICALL functions. + * java/debug.sh (is_root): Fix tee detection again for old systems + which don't return exit codes from adb shell. + + * src/android.c (android_run_select_thread, initEmacs): + * src/android.h: + * src/androidterm.c: Apply stack alignment to all JNICALL + functions. * src/android.c (android_open): Clean up unused variables. - Update Android port * java/org/gnu/emacs/EmacsNoninteractive.java (main): Port to Android 2.2. + * src/android-asset.h (AAsset_openFileDescriptor): Delete stub function. - * src/android.c (android_check_compressed_file): Delete - function. - (android_open): Stop trying to find compressed files or to use - the system provided file descriptor. Explain why. - Update Android port + * src/android.c (android_check_compressed_file): Delete function. + (android_open): Stop trying to find compressed files or to use the + system provided file descriptor. Explain why. + * doc/emacs/android.texi (Android Startup, Android File System) - (Android Environment, Android Windowing, Android - Troubleshooting): Improve documentation; fix typos. + (Android Environment, Android Windowing, Android Troubleshooting): + Improve documentation; fix typos. + * doc/lispref/commands.texi (Misc Events): Likewise. + * java/org/gnu/emacs/EmacsService.java (queryBattery): New function. + * lisp/battery.el (battery-status-function): Set appropriately for Android. (battery-android): New function. + * src/android.c (struct android_emacs_service): New method `query_battery'. (android_check_content_access): Improve exception checking. @@ -3719,9 +3693,12 @@ (android_browse_url): Improve exception handling. Always use android_exception_check and don't leak local refs. (android_query_battery): New function. + * src/android.h (struct android_battery_state): New struct. + * src/androidfns.c (Fandroid_query_battery, syms_of_androidfns): - New function. + New functions. + * src/androidfont.c (androidfont_from_lisp, DO_SYMBOL_FIELD) (DO_CARDINAL_FIELD, androidfont_list, androidfont_match) (androidfont_draw, androidfont_open_font) @@ -3730,196 +3707,142 @@ (Fandroid_get_clipboard): * src/sfnt.c (sfnt_map_glyf_table): * src/sfntfont.c (sfntfont_free_outline_cache) - (sfntfont_free_raster_cache, sfntfont_close): Allow font close - functions to be called twice. - - Merge remote-tracking branch 'origin/master' into feature/android + (sfntfont_free_raster_cache, sfntfont_close): Allow calling font + close functions twice. 2023-02-24 Po Lu - Improve Android configury * configure.ac (JAVA_PUSH_LINT): New macro. (JAVAFLAGS): New variable. Check for various lint flags and macros and enable them. + * java/Makefile.in (ANDROID_ABI): + * java/org/gnu/emacs/EmacsSdk7FontDriver.java: Remove compiler warning. - Enable normal-erase-is-backspace on Android * lisp/frame.el (display-symbol-keys-p): * lisp/simple.el (normal-erase-is-backspace-setup-frame): Return appropriate values on Android. - Merge remote-tracking branch 'origin/master' into feature/android - - Fix auto-revert-mode on Android - * src/inotify.c (Finotify_add_watch): Handle asset files. + * src/inotify.c (Finotify_add_watch): Handle asset files by + returning nil. * src/keyboard.c (lispy_function_keys): Add missing delete key. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-02-23 Po Lu - Make sure scroll-bar.el is loaded on Android * lisp/loadup.el: Update commentary. + * src/androidterm.c (syms_of_androidterm): Define Vx_toolkit_scroll_bars. - * src/xterm.c (syms_of_xterm): Update doc string.xf64 - Merge remote-tracking branch 'origin/master' into feature/android + * src/xterm.c (syms_of_xterm): Update doc string. - Fix ImageMagick build on Android - * INSTALL.android (-linux_arm_sources): + * INSTALL.android: * build-aux/ndk-build-helper-1.mk: - (NDK_$(LOCAL_MODULE)_STATIC_LIBRARIES)::(NDK_CXX_FLAG_$(LOCAL_MODULE)): + (NDK_$(LOCAL_MODULE)_STATIC_LIBRARIES) + (NDK_CXX_FLAG_$(LOCAL_MODULE)): * build-aux/ndk-build-helper-2.mk: - (NDK_$(LOCAL_MODULE)_STATIC_LIBRARIES)::(NDK_CXX_FLAG_$(LOCAL_MODULE)): - * cross/ndk-build/ndk-build-shared-library.mk (objname)::($(call - objname,$(LOCAL_MODULE),$(basename - $(1))))::(ALL_OBJECT_FILES$(LOCAL_MODULE)): - * cross/ndk-build/ndk-build-static-library.mk (objname)::($(call - objname,$(LOCAL_MODULE),$(basename - $(1))))::(ALL_OBJECT_FILES$(LOCAL_MODULE)): - (ALL_SOURCE_FILES): Update ImageMagick build instructions and - C++ module detection. + (NDK_$(LOCAL_MODULE)_STATIC_LIBRARIES) + (NDK_CXX_FLAG_$(LOCAL_MODULE)): + * cross/ndk-build/ndk-build-shared-library.mk (objname) + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))) + (ALL_OBJECT_FILES$(LOCAL_MODULE)): + * cross/ndk-build/ndk-build-static-library.mk (objname) + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))) + (ALL_OBJECT_FILES$(LOCAL_MODULE)): + (ALL_SOURCE_FILES): Update ImageMagick build instructions and C++ + module detection. * src/android.c (android_run_select_thread): Fix typos. - - Make android_select more robust - * src/android.c (android_run_select_thread): Lock select_mutex - before signalling condition variable. + (android_run_select_thread): Lock select_mutex before signalling + condition variable. (android_select): Unlock event queue mutex prior to waiting for it. 2023-02-22 Po Lu - ; Fix typo * cross/ndk-build/ndk-build-shared-library.mk: Fix typo. * src/image.c (imagemagick_load_image): Check HAVE_DECL_xxx. -2023-02-22 Po Lu - - Update Android port - ImageMagick now builds but does not link yet some of the time. - * INSTALL.android: Document ImageMagick and caveats. + * build-aux/ndk-build-helper-1.mk (NDK_SO_NAMES): * build-aux/ndk-build-helper-2.mk (NDK_A_NAMES): - * build-aux/ndk-build-helper.mk (TARGET_ARCH_ABI): Define architecture - and don't respect explicitly specified library names. + * build-aux/ndk-build-helper.mk (TARGET_ARCH_ABI): Define + architecture and don't respect explicitly specified library names. * configure.ac: Enable ImageMagick and lcms2 on Android. - * cross/ndk-build/ndk-build-shared-library.mk (objname)::($(call - objname,$(LOCAL_MODULE),$(basename - $(1))))::(ALL_OBJECT_FILES$(LOCAL_MODULE)): - * cross/ndk-build/ndk-build-static-library.mk (objname)::($(call - objname,$(LOCAL_MODULE),$(basename $(1)))): - (NDK_CFLAGS, ALL_SOURCE_FILES): Handle sources files which start with - $(LOCAL_PATH). - * cross/ndk-build/ndk-clear-vars.mk: Don't undefine; clear variables - instead. - * m4/ndk-build.m4 (ndk_SEARCH_MODULE): Redirect make stderr to - config.log.xf64 + * cross/ndk-build/ndk-build-shared-library.mk (objname) + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))) + (ALL_OBJECT_FILES$(LOCAL_MODULE)): + * cross/ndk-build/ndk-build-static-library.mk (objname) + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))) + (NDK_CFLAGS, ALL_SOURCE_FILES): Handle source files whose names + begin with $(LOCAL_PATH). -2023-02-22 Po Lu + * cross/ndk-build/ndk-clear-vars.mk: Don't undefine; clear + variables instead. + + * m4/ndk-build.m4 (ndk_SEARCH_MODULE): Redirect make stderr to + config.log. * src/androidmenu.c (android_menu_show): Fix typo. - Update Android port - * doc/emacs/input.texi (On-Screen Keyboards): Document changes - to text conversion. - * java/org/gnu/emacs/EmacsInputConnection.java (getExtractedText) - (EmacsInputConnection): + * doc/emacs/input.texi (On-Screen Keyboards): Document changes to + text conversion. + + * java/org/gnu/emacs/EmacsInputConnection.java (getExtractedText): * src/keyboard.c (read_key_sequence): Disable text conversion after reading prefix key. + * src/textconv.c (get_extracted_text): Fix returned value when request length is zero. - Merge remote-tracking branch 'origin/master' into feature/android - - Add cross-compilation test for cleanup attribute * configure.ac: Per title. - Update Android port * INSTALL.android: Port to MIPS. - * configure.ac (modules): Default to ifavailable. - Write actual test for __attribute__((cleanup)). + + * configure.ac (modules): Default to ifavailable. Write actual + test for __attribute__((cleanup)). + * m4/ndk-build.m4: Recognize mips and mips64. + * src/emacs-module.c: Remove broken HAS_ATTRIBUTE test. 2023-02-21 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * java/org/gnu/emacs/EmacsContextMenu.java (addSubmenu) + (inflateMenuItems): Handle tooltips correctly. - Update Android port - * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu) - (addSubmenu, inflateMenuItems): Handle tooltips correctly. * src/android.c (android_scan_directory_tree): Fix limit generation for root directory. + * src/androidmenu.c (android_init_emacs_context_menu) - (android_menu_show): Implement menu item help text on Android - 8.0 and later. - - Update from gnulib - * admin/merge-gnulib (GNULIB_MODULES): - * cross/lib/getopt-pfx-core.h (optind): - * cross/lib/limits.in.h (BOOL_WIDTH): - * cross/lib/math.in.h: - * cross/lib/stpncpy.c (__stpncpy): - * cross/lib/string.in.h: - * lib/getopt-pfx-core.h (optind): - * lib/gnulib.mk.in (ANDROID_MIN_SDK): - (GL_COND_OBJ_STDIO_READ_CONDITION): - (LIBS): - (NDK_BUILD_AR): - (REPLACE__EXIT): - (libgnu_a_SOURCES): - * lib/limits.in.h (BOOL_WIDTH): - * lib/math.in.h: - * lib/stpncpy.c (__stpncpy): - * lib/string.in.h: - * m4/assert_h.m4 (gl_ASSERT_H): - * m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): - * m4/getdelim.m4 (gl_FUNC_GETDELIM): - * m4/getline.m4 (gl_FUNC_GETLINE): - * m4/gnulib-common.m4 (gl_COMMON_BODY): - (gl_CONDITIONAL_HEADER): - (gl_CHECK_FUNCS_ANDROID): - * m4/gnulib-comp.m4 (gl_EARLY): - (gl_INIT): - (gl_FILE_LIST): - * m4/limits-h.m4: - * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): - * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): - * m4/printf.m4 (gl_PRINTF_SIZES_C99): - (gl_PRINTF_INFINITE): - (gl_PRINTF_INFINITE_LONG_DOUBLE): - (gl_PRINTF_DIRECTIVE_A): - (gl_PRINTF_DIRECTIVE_F): - (gl_PRINTF_FLAG_ZERO): - (gl_SNPRINTF_PRESENCE): - (gl_SNPRINTF_DIRECTIVE_N): - (gl_VSNPRINTF_ZEROSIZE_C99): - * m4/pselect.m4 (gl_FUNC_PSELECT): - * m4/readlink.m4 (gl_FUNC_READLINK): - * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): - * m4/signbit.m4 (gl_SIGNBIT): - * m4/stpncpy.m4 (gl_FUNC_STPNCPY): - * m4/symlink.m4 (gl_FUNC_SYMLINK): Add gnulib module stpncpy. + (android_menu_show): Implement menu item help text on Android 8.0 + and later. + + * admin/merge-gnulib (GNULIB_MODULES): Add gnulib module stpncpy. + + * m4, lib: Update from Gnulib. + * src/android.c: Include string.h. - Update Android port * doc/emacs/android.texi (Android Startup): Document `content' special directory. + * java/debug.sh (is_root): Improve /bin/tee detection. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New - function `dup'. - * java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity) - (checkReadableOrCopy, onCreate): Create content directory names - when the file is not readable. - * java/org/gnu/emacs/EmacsService.java (EmacsService) - (openContentUri, checkContentUri): New functions. + + * java/org/gnu/emacs/EmacsNative.java (dup): New function. + + * java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy) + (onCreate): Create content directory names when the file is not + readable. + + * java/org/gnu/emacs/EmacsService.java (openContentUri) + (checkContentUri): New functions. + * src/android.c (struct android_emacs_service): New methods. (android_content_name_p, android_get_content_name) (android_check_content_access): New function. @@ -3928,37 +3851,29 @@ (android_init_emacs_service): Initialize new methods. (android_faccessat): Implement content file names. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-02-20 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - -2023-02-20 Po Lu - - Update Android port * INSTALL.android: Explain where to get tree-sitter. * configure.ac: Add support for dynamic modules and tree-sitter. * doc/emacs/android.texi (Android Windowing): + * java/org/gnu/emacs/EmacsSdk11Clipboard.java - (EmacsSdk11Clipboard, ownsClipboard): Improve clipboard handling - and documentation. + (ownsClipboard): Enhance the treatment of the clipboard and the + documentation addressing that subject. 2023-02-20 Po Lu - Fix crash inside font-list-family * src/androidfont.c (androidfont_list_family): Don't unconditionally initialize the Android font driver. - Merge remote-tracking branch 'origin/master' into feature/android - - Improve SFNT driver lookup efficiency * src/fontset.c (fontset_find_font): Add compatibility test to registry strangeness case. + * src/sfnt.c (sfnt_read_cmap_table): Don't read subtable data if DATA is NULL. + * src/sfntfont.c (struct sfnt_font_desc): New field `registry'. (sfnt_registry_for_subtable): New function. (sfntfont_identify_cmap): Move above sfnt_grok_registry. @@ -3969,266 +3884,276 @@ (sfntfont_registry_for_desc): New function. (mark_sfntfont): Mark desc->registry. - Improve reliability of Java code rebuilds - * java/Makefile.in ($(CLASS_FILES)): Depend on the Java - compiler's internal dependency tracking. - -2023-02-19 Po Lu + * java/Makefile.in ($(CLASS_FILES)): Depend on the Java compiler's + internal dependency tracking. - Match font registry after font is opened * src/fontset.c (fontset_find_font): Work around TrueType performance problem. - Merge remote-tracking branch 'origin/master' into feature/android - * cross/Makefile.in (src/libemacs.so): Depend on libgnu.a. - More fixes to parallel Make * cross/ndk-build/ndk-build.mk.in (NDK_BUILD_MODULES) (NDK_BUILD_SHARED, NDK_BUILD_STATIC): Define group rule to build all files so that they are built within one make process. + * java/Makefile.in: Reorganize cross compilation and make sure - there is only one make subprocess for each subdirectory of - cross. - - More parallel build fixes - * cross/Makefile.in: (.PHONY): - * java/Makefile.in: (.PHONY): - * src/Makefile.in: (libemacs.so): Avoid calling ndk-build from - two places at once. Build android-emacs separately from - libemacs.so. + there is only one make subprocess for each subdirectory of cross. + + * cross/Makefile.in (.PHONY): + * java/Makefile.in (.PHONY): + * src/Makefile.in (libemacs.so): Avoid calling ndk-build from two + places at once. Build android-emacs separately from libemacs.so. - Fix parallel compilation of Android port * cross/Makefile.in ($(top_builddir)/lib/libgnu.a): - * java/Makefile.in (CROSS_LIBS): Explicitly depend on gnulib - to prevent it from being built at the same time from different - jobs. + * java/Makefile.in (CROSS_LIBS): Explicitly depend on gnulib to + prevent it from being built at the same time from different jobs. - Fix sfntfont.c build without mmap * src/sfntfont.c (sfntfont_close): Don't unlink font if mmap is not available. - Improve Android documentation * INSTALL.android: Say where building Emacs is supported. + * doc/emacs/android.texi (Android Startup): Describe how to connect via ADB. - Report both sides of the region to the input method upon setup - * java/org/gnu/emacs/EmacsNative.java (getSelection): Return - array of ints. + * java/org/gnu/emacs/EmacsNative.java (getSelection): Return array + of ints. + * java/org/gnu/emacs/EmacsView.java (onCreateInputConnection): Adjust accordingly. + * src/androidterm.c (struct android_get_selection_context): New field `mark'. (android_get_selection): Set the mark field as appropriate. (getSelection): Adjust accordingly. - Fix gamegrid.el with high resolution displays - * lisp/play/gamegrid.el (gamegrid-setup-default-font): Clamp - font size at eight. + * lisp/play/gamegrid.el (gamegrid-setup-default-font): Clamp font + size at eight. - Allow opening more files in emacsclient on Android - * java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity) - (checkReadableOrCopy): New function. - (onCreate): If the file specified is not readable from C, read - it into a temporary file and ask Emacs to open that. + * java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy): + New function. + (onCreate): If the file specified is not readable from C, read it + into a temporary file and ask Emacs to open that. - Implement `fullscreen' on Android 4.0 and later * doc/emacs/android.texi (Android Windowing): Document what new frame parameters are now supported. - * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New - field `isFullscreen'. + + * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New field + `isFullscreen'. (detachWindow, attachWindow): Sync fullscreen state. (onWindowFocusChanged): Add more logging. (onResume): Restore previous fullscreen state. (syncFullscreen): New function. - * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow) - (setFullscreen): New function. + + * java/org/gnu/emacs/EmacsWindow.java (setFullscreen): New + function. + * src/android.c (struct android_emacs_window): Add new method. (android_init_emacs_window): Look up new method. (android_set_fullscreen): New function. + * src/androidgui.h: * src/androidterm.c (android_fullscreen_hook): Implement accordingly. - Fix crashes in desktop-save-mode * lisp/subr.el (overriding-text-conversion-style, y-or-n-p): Disable text conversion when reading from minibuffer. + * src/androidfns.c (android_make_monitor_attribute_list): New function. (Fandroid_display_monitor_attributes_list): Call it to set monitor_frames, which avoids a NULL pointer dereference. Reported by Angelo Graziosi . - Merge remote-tracking branch 'origin/master' into feature/android - 2023-02-18 Po Lu * lisp/loadup.el: Fix merge typos. - Merge remote-tracking branch 'origin/master' into feature/android - - Update Android port * doc/emacs/input.texi (On-Screen Keyboards): Document `touch-screen-always-display'. + * doc/lispref/commands.texi (Misc Events): Improve documentation of text conversion events. + * java/org/gnu/emacs/EmacsDialog.java (toAlertDialog, display1): Reorder buttons to make more sense. + * lisp/elec-pair.el (electric-pair-analyze-conversion): New function. + * lisp/simple.el (analyze-text-conversion): Improve integration with electric pair modes. - * lisp/term.el (term-mode): Always display the onscreen - keyboard. + + * lisp/term.el (term-mode): Always display the onscreen keyboard. + * lisp/touch-screen.el (touch-screen-display-keyboard) (touch-screen-handle-point-up): Respect new options. + * src/textconv.c (really_set_composing_text): Stop widenining unnecessarily. - (really_delete_surrounding_text): Really delete surrounding - text. Give text conversion analyzers the buffer text. + (really_delete_surrounding_text): Really delete surrounding text. + Give text conversion analyzers the buffer text. (syms_of_textconv): Update doc string. - Notify input methods when editing fails * INSTALL.android: Clarify build instructions. + * src/textconv.c (struct complete_edit_check_context): New structure. (complete_edit_check): New function. - (handle_pending_conversion_events_1): If the window is known, - then ensure that any editing failures are reported to the input - method. + (handle_pending_conversion_events_1): If the window is known, then + ensure that any editing failures are reported to the input method. - * configure.ac: Fix typo. + * configure.ac: Fix typo. Check for madvise. - Update Android port - * configure.ac: Check for madvise. * lisp/international/fontset.el (script-representative-chars): Improve detection of CJK fonts. + * src/pdumper.c (dump_discard_mem): Use madvise if possible. + * src/sfnt.c (sfnt_map_glyf_table, sfnt_unmap_glyf_table): New functions. + * src/sfnt.h (struct sfnt_glyf_table): New field. + * src/sfntfont.c (struct sfnt_font_info, sfntfont_open) - (sfntfont_close, sfntfont_detect_sigbus): Allow mmapping fonts - if possible. + (sfntfont_close, sfntfont_detect_sigbus): Map fonts into memory if + possible. + * src/sfntfont.h: Update prototypes. + * src/sysdep.c (handle_sigbus, init_sigbus, init_signals): Initialize SIGBUS correctly. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-02-17 Po Lu - Work around race condition bug in Android 13's input manager * src/androidterm.c (android_get_selection): Use ephemeral last point. + * src/textconv.c (report_selected_window_change): Set w->ephemeral_last_point to the window's point now. - Update emacsbug and version.el for the Android port * java/Makefile.in (install_temp/assets/version): New generated file. - * lisp/loadup.el: Set emacs versions appropriately prior to + + * lisp/loadup.el: Set Emacs versions appropriately prior to dumping on Android. - * lisp/mail/emacsbug.el (emacs-build-description): Insert - Android build fingerprint. + + * lisp/mail/emacsbug.el (emacs-build-description): Insert Android + build fingerprint. + * lisp/version.el (emacs-repository-version-android) (emacs-repository-get-version, emacs-repository-get-branch): Implement for Android. - * src/androidterm.c (android_set_build_fingerprint): New - function. + + * src/androidterm.c (android_set_build_fingerprint): New function. (syms_of_androidterm): New variable `android-build-fingerprint'. * src/android.c (android_exception_check): Fix typo. + (android_exception_check): Print more detailed information. - Merge remote-tracking branch 'origin/master' into feature/android - - Improve logging of Java exceptions - * src/android.c (android_exception_check): Print more detailed - information. - - Fix crash on old versions of Android * java/org/gnu/emacs/EmacsService.java (nameKeysym): Implement stub on Android 3.0 and earlier. - Fix build and running on Android 2.2 - * INSTALL.android: Document that Android 2.2 is now supported, - with caveats. + * INSTALL.android: Document that Android 2.2 is now supported) + (with caveats. + * configure.ac (ANDROID_MIN_SDK, ANDROID_SDK_18_OR_EARLIER) (SYSTEM_TYPE, ANDROID_STUBIFY, SIZEOF_LONG): Correctly detect things missing on Android 2.2. + * java/Makefile.in (ANDROID_JAR, JARSIGNER_FLAGS): * java/debug.sh (jdb, gdbserver, line): * java/org/gnu/emacs/EmacsApplication.java (findDumpFile): * java/org/gnu/emacs/EmacsService.java (onCreate): - * java/org/gnu/emacs/EmacsThread.java (EmacsThread, run): Run - parameter initialization on main thread. + * java/org/gnu/emacs/EmacsThread.java (run): Run parameter + initialization on main thread. + * src/android-asset.h (struct android_asset_manager) (struct android_asset, AAssetManager_fromJava, AAssetManager_open) (AAsset_close, android_asset_create_stream) (android_asset_read_internal, AAsset_openFileDescriptor) (AAsset_getLength, AAsset_getBuffer, AAsset_read): New file. - * src/android.c (android_user_full_name, android_hack_asset_fd) + Write substitutes for functions that aren't present within the NDK + on Android 2.2. + + * src/android.c: Arrange to include android-asset.h if the minimum + supported Android version is 2.2. + (android_user_full_name, android_hack_asset_fd) (android_check_compressed_file): Implement for Android 2.2. + * src/process.c (Fprocess_send_eof): Don't call tcdrain if unavailable. + * src/sfntfont-android.c (system_font_directories): Fix compiler warning. + * src/sfntfont.c (sfntfont_read_cmap): Correctly test rc of emacs_open. - * src/textconv.c (handle_pending_conversion_events_1): Mark - buffer UNINIT. -2023-02-16 Po Lu - - Merge remote-tracking branch 'origin/master' into feature/android + * src/textconv.c (handle_pending_conversion_events_1): Mark buffer + UNINIT. 2023-02-16 Po Lu - Update Android port * doc/emacs/android.texi (Android Fonts): * doc/emacs/input.texi (On-Screen Keyboards): * doc/lispref/commands.texi (Misc Events): Update documentation. - * java/org/gnu/emacs/EmacsInputConnection.java (setSelection): - New function. - * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView) - (reconfigureFrontBuffer): Make bitmap references weak - references. + + * java/org/gnu/emacs/EmacsInputConnection.java (setSelection): New + function. + * java/org/gnu/emacs/EmacsSurfaceView.java + (reconfigureFrontBuffer): Make bitmap references weak references. + * java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap): Don't clear surfaceView bitmap. - * lisp/comint.el (comint-mode): + + * lisp/comint.el (comint-mode): Set text-conversion-style to + `action' so on screen keyboards' Return buttons send an actual key + press event. + * lisp/international/fontset.el (script-representative-chars) (setup-default-fontset): Improve detection of CJK fonts. + * lisp/isearch.el (set-text-conversion-style): New variable. - (isearch-mode, isearch-done): Save and restore the text - conversion style. + (isearch-mode, isearch-done): Save and restore the text conversion + style. + * lisp/minibuffer.el (minibuffer-mode): Set an appropriate text conversion style. + * lisp/simple.el (analyze-text-conversion): Run post-self-insert-hook properly. + * lisp/subr.el (read-char-from-minibuffer): Disable text conversion when reading character. - * src/androidterm.c (show_back_buffer): Don't check that F is - not garbaged. + + * src/androidterm.c (show_back_buffer): Don't check that F is not + garbaged. (android_update_selection, android_reset_conversion): Use the ephemeral last point and handle text conversion being disabled. + * src/buffer.c (syms_of_buffer): Convert old style DEFVAR. + * src/keyboard.c (kbd_buffer_get_event): Handle text conversion first. + * src/lisp.h: Update prototypes. + * src/lread.c (read_filtered_event): Temporarily disable text conversion. - * src/sfnt.c (sfnt_decompose_glyph_1, sfnt_decompose_glyph_2): - New functions. + + * src/sfnt.c (sfnt_decompose_glyph_1, sfnt_decompose_glyph_2): New + functions. (sfnt_decompose_glyph, sfnt_decompose_instructed_outline): Refactor contour decomposition to those two functions. (main): Update tests. + * src/sfntfont-android.c (system_font_directories): Add empty field. - (Fandroid_enumerate_fonts, init_sfntfont_android): Enumerate - fonts in a user fonts directory. - * src/sfntfont.c (struct sfnt_font_desc): New field - `num_glyphs'. + (Fandroid_enumerate_fonts, init_sfntfont_android): Enumerate fonts + in a user fonts directory. + + * src/sfntfont.c (struct sfnt_font_desc): New field `num_glyphs'. (sfnt_enum_font_1): Set num_glyphs and avoid duplicate fonts. (sfntfont_glyph_valid): New function. (sfntfont_lookup_char, sfntfont_list_1): Make sure glyphs found @@ -4240,34 +4165,42 @@ (handle_pending_conversion_events_1) (handle_pending_conversion_events, conversion_disabled_p) (disable_text_conversion, resume_text_conversion) - (Fset_text_conversion_style, syms_of_textconv): Update to - respect new options. - * src/textconv.h: + (Fset_text_conversion_style, syms_of_textconv): Update to respect + new options. + * src/window.h (GCALIGNED_STRUCT): New field `ephemeral_last_point'. + * src/xdisp.c (mark_window_display_accurate_1): Set it. 2023-02-15 Po Lu - Update Android port * doc/emacs/input.texi (On-Screen Keyboards): * doc/lispref/commands.texi (Misc Events): Improve documentation of text conversion stuff. + * java/org/gnu/emacs/EmacsInputConnection.java (beginBatchEdit) - (endBatchEdit, commitCompletion, commitText, deleteSurroundingText) + (endBatchEdit, commitCompletion, commitText) + (deleteSurroundingText) (finishComposingText, getSelectedText, getTextAfterCursor) (EmacsInputConnection, setComposingRegion, performEditorAction) (getExtractedText): Condition debug code on DEBUG_IC. + * java/org/gnu/emacs/EmacsService.java (EmacsService, updateIC): Likewise. + * lisp/bindings.el (global-map): * lisp/electric.el (global-map): Make `text-conversion' `analyze-text-conversion'. - * lisp/progmodes/prog-mode.el (prog-mode): Enable text - conversion in input methods. + + * lisp/progmodes/prog-mode.el (prog-mode): Enable text conversion + in input methods. + * lisp/simple.el (analyze-text-conversion): New function. + * lisp/textmodes/text-mode.el (text-conversion-style) (text-mode): Likewise. + * src/androidterm.c (android_handle_ime_event): Handle set_point_and_mark. (android_sync_edit): Give Emacs 100 ms instead. @@ -4276,14 +4209,19 @@ (getSelectedText): Implement properly. (android_update_selection): Expose mark to input methods. (android_reset_conversion): Handle `text-conversion-style'. + * src/buffer.c (init_buffer_once, syms_of_buffer): Add buffer local variable `text-conversion-style'. + * src/buffer.h (struct buffer, bset_text_conversion_style): New fields. + * src/emacs.c (android_emacs_init): Call syms_of_textconv. + * src/frame.h (enum text_conversion_operation): Rename TEXTCONV_SET_POINT. - * src/lisp.h: Export syms_of_textconv. + + * src/lisp.h (syms_of_textconv): Export syms_of_textconv. * src/marker.c (set_marker_internal): Force redisplay when the mark is set and the buffer is visible on builds that use text @@ -4304,41 +4242,42 @@ * src/textconv.h (struct textconv_interface): Update documentation. + * src/window.h (GCALIGNED_STRUCT): New field `prev_mark'. - * src/xdisp.c (mark_window_display_accurate_1): Handle - prev_mark. -2023-02-15 Po Lu + * src/xdisp.c (mark_window_display_accurate_1): Handle prev_mark. - Make debug.sh detect adb running as root * java/debug.sh: Run gdbserver directly if possible. - Fix small bugs * src/androidterm.c (android_handle_ime_event): Pacify compiler warnings. + * src/textconv.c (really_set_composing_text) (handle_pending_conversion_events, get_extracted_text): Fix reentrancy problems and uses of uninitialized values. - Merge remote-tracking branch 'origin/master' into feature/android - -2023-02-15 Po Lu - - Update Android port * configure.ac (HAVE_TEXT_CONVERSION): Define on Android. + * doc/emacs/input.texi (On-Screen Keyboards): Document ``text conversion'' slightly. + * doc/lispref/commands.texi (Misc Events): Document new `text-conversion' event. + * java/org/gnu/emacs/EmacsContextMenu.java (display): Use `syncRunnable'. + * java/org/gnu/emacs/EmacsDialog.java (display): Likewise. + * java/org/gnu/emacs/EmacsEditable.java: Delete file. + * java/org/gnu/emacs/EmacsInputConnection.java (EmacsInputConnection): Reimplement from scratch. + * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Add new functions. - * java/org/gnu/emacs/EmacsService.java (EmacsService, getEmacsView) + + * java/org/gnu/emacs/EmacsService.java (getEmacsView) (getLocationOnScreen, sync, getClipboardManager, restartEmacs): Use syncRunnable. (syncRunnable): New function. @@ -4350,7 +4289,9 @@ (setICMode, getICMode): New functions. * lisp/bindings.el (global-map): Ignore text conversion events. + * src/alloc.c (mark_frame): Mark text conversion data. + * src/android.c (struct android_emacs_service): New fields `update_ic' and `reset_ic'. (event_serial): Export. @@ -4362,18 +4303,19 @@ methods. (android_check_query, android_begin_query, android_end_query) (android_run_in_emacs_thread): - (android_update_ic, android_reset_ic): New functions for - managing synchronous queries from one thread to another. + (android_update_ic, android_reset_ic): New functions for managing + synchronous queries from one thread to another. * src/android.h: Export new functions. + * src/androidgui.h (enum android_event_type): Add input method events. (enum android_ime_operation, struct android_ime_event) (union android_event, enum android_ic_mode): New structs and enums. - * src/androidterm.c (android_window_to_frame): Allow DPYINFO to - be NULL. + * src/androidterm.c (android_window_to_frame): Allow DPYINFO to be + NULL. (android_decode_utf16, android_handle_ime_event) (handle_one_android_event, android_sync_edit) (android_copy_java_string, beginBatchEdit, endBatchEdit) @@ -4381,32 +4323,29 @@ (getSelectedtext, getTextAfterCursor, getTextBeforeCursor) (setComposingText, setComposingRegion, setSelection, getSelection) (performEditorAction, getExtractedText): New functions. - (struct android_conversion_query_context): - (android_perform_conversion_query): - (android_text_to_string): - (struct android_get_selection_context): - (android_get_selection): - (struct android_get_extracted_text_context): - (android_get_extracted_text): - (struct android_extracted_text_request_class): - (struct android_extracted_text_class): - (android_update_selection): - (android_reset_conversion): - (android_set_point): - (android_compose_region_changed): - (android_notify_conversion): + (struct android_conversion_query_context) + (android_perform_conversion_query, android_text_to_string) + (android_get_selection_context, android_get_selection) + (android_get_extracted_text_context, android_get_extracted_text) + (android_extracted_text_request_class) + (android_extracted_text_class, android_update_selection) + (android_reset_conversion, android_set_point) + (android_compose_region_changed, android_notify_conversion) (text_conversion_interface): New functions and structures. (android_term_init): Initialize text conversion. * src/coding.c (syms_of_coding): Define Qutf_16le on Android. + * src/frame.c (make_frame): Clear conversion data. (delete_frame): Reset conversion state. * src/frame.h (enum text_conversion_operation) (struct text_conversion_action, struct text_conversion_state) (GCALIGNED_STRUCT): Update structures. + * src/keyboard.c (read_char, readable_events, kbd_buffer_get_event) (syms_of_keyboard): Handle text conversion events. + * src/lisp.h: * src/process.c: Fix includes. @@ -4426,78 +4365,81 @@ * src/textconv.h (struct textconv_interface) (TEXTCONV_SKIP_CONVERSION_REGION): Update prototype. + * src/xdisp.c (mark_window_display_accurate_1): * src/xfns.c (xic_string_conversion_callback): * src/xterm.c (init_xterm): Adjust accordingly. 2023-02-12 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * doc/emacs/android.texi (Android Environment): Mention that Emacs + also requests the notifications permission. - Merge remote-tracking branch 'origin/master' into feature/android + * java/org/gnu/emacs/EmacsEditable.java: + * java/org/gnu/emacs/EmacsInputConnection.java: New files. + + * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Load library + dependencies in a less verbose fashion. - Update Android port - * doc/emacs/android.texi (Android Environment): Document - notifications permission. - * java/org/gnu/emacs/EmacsEditable.java (EmacsEditable): - * java/org/gnu/emacs/EmacsInputConnection.java - (EmacsInputConnection): New files. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Load - library dependencies in a less verbose fashion. * java/org/gnu/emacs/EmacsView.java (EmacsView): Make imManager public. (onCreateInputConnection): Set InputType to TYPE_NULL for now. - * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, onKeyDown) - (onKeyUp, getEventUnicodeChar): Correctly handle key events with - strings. + + * java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp) + (getEventUnicodeChar): Correctly handle key events with strings. + * lisp/term/android-win.el (android-clear-preedit-text) (android-preedit-text): New special event handlers. + * src/android.c (struct android_emacs_window): Add function lookup_string. (android_init_emacs_window): Adjust accordingly. (android_wc_lookup_string): New function. - * src/androidgui.h (struct android_key_event): Improve - commentary. + + * src/androidgui.h (struct android_key_event): Improve commentary. (enum android_lookup_status): New enum. + * src/androidterm.c (handle_one_android_event): Synchronize IM lookup code with X. + * src/coding.c (from_unicode_buffer): Implement on Android. + * src/coding.h: * src/sfnt.c: Fix commentary. 2023-02-11 Po Lu - Fix displaying popup menus from a menu entry on Android - * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity, onDestroy) + * java/org/gnu/emacs/EmacsActivity.java (onDestroy) (onWindowFocusChanged): Keep track of the last focused activity. - * java/org/gnu/emacs/EmacsDialog.java (display1): Use it if - there is no current focus. - Merge remote-tracking branch 'origin/master' into feature/android + * java/org/gnu/emacs/EmacsDialog.java (display1): Use it if there + is no current focus. 2023-02-10 Po Lu - Improve appearance of the Android preferences screen * .gitignore: Add org/gnu/emacs/R.java. + * cross/Makefile.in (top_builddir): Include verbose.mk. Rewrite rules to print nice looking statements. + * doc/emacs/android.texi (Android, Android Startup) (Android Environment, Android Windowing, Android Fonts): * doc/emacs/emacs.texi (Top): Add an extra ``Android Troubleshooting'' node and move troubleshooting details there. + * java/Makefile.in: Generate R.java; improve appearance by using verbose.mk. - * java/org/gnu/emacs/EmacsPreferencesActivity.java: Reimplement - in terms of PreferencesActivity. + * java/org/gnu/emacs/EmacsPreferencesActivity.java: Reimplement in + terms of PreferencesActivity. + * java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap): Avoid flicker. + * java/res/xml/preferences.xml: New file. - * src/verbose.mk.in (AM_V_AAPT, AM_V_SILENT): New variables. -2023-02-10 Po Lu + * src/verbose.mk.in (AM_V_AAPT, AM_V_SILENT): New variables. - Implement more features for the Emacs ``documents provider'' * java/org/gnu/emacs/EmacsDocumentsProvider.java (queryRoots): Implement isChild. (getNotificationUri, notifyChange): New functions. @@ -4509,64 +4451,52 @@ * java/org/gnu/emacs/EmacsCopyArea.java (perform): Fix typo. - Merge remote-tracking branch 'origin/master' into feature/android - - Fix buffer swapping on Android 7.1 and earlier * java/org/gnu/emacs/EmacsSurfaceView.java (reconfigureFrontBuffer): Don't use function only present on Android 8.0 and later. - Update Android port * doc/emacs/android.texi (Android Windowing): Remove yet another limitation. + * java/debug.sh: Make this work on systems which prohibit attaching to app processes from adbd. - * java/org/gnu/emacs/EmacsCopyArea.java (perform): Avoid - creating copies whenever possible. + + * java/org/gnu/emacs/EmacsCopyArea.java (perform): Avoid creating + copies whenever possible. + * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView): Remove SurfaceView based implementation and use manual double buffering with invalidate instead. + * java/org/gnu/emacs/EmacsView.java (EmacsView, handleDirtyBitmap) (raise, lower, onDetachedFromWindow): Adjust accordingly. + * java/org/gnu/emacs/EmacsWindow.java (windowUpdated): Remove function. - * src/sfntfont.c (sfntfont_open): Set font->max_width correctly. - -2023-02-10 Po Lu - Fix IUP for contours which start past end - Found with Droid Sans Mono hinted with ttfautohint 1.8.4. + * src/sfntfont.c (sfntfont_open): Set font->max_width correctly. * src/sfnt.c (IUP_SINGLE_PAIR): If i is initially more than end, make it start. (sfnt_verbose): Handle cases where interpreter->glyph_zone is NULL. (main): Update tests. - -2023-02-10 Po Lu - - Fix typo - * src/sfnt.c (sfnt_read_cmap_table): Fix typo. + (sfnt_read_cmap_table): Fix typo. (main): Update tests. 2023-02-09 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * java/AndroidManifest.xml.in: Declare the new documents provider. - Allow other text editors to edit files in Emacs' home directory - * java/AndroidManifest.xml.in: Declare the new documents - provider. * java/README: Describe the meaning of files in res/values. - * java/org/gnu/emacs/EmacsDocumentsProvider.java - (EmacsDocumentsProvider): New file. + + * java/org/gnu/emacs/EmacsDocumentsProvider.java: New file. + * java/res/values-v19/bool.xml: * java/res/values/bool.xml: New files. * src/sfnt.c (main): Update tests. -2023-02-09 Po Lu - - Implement instructing compound glyphs * src/sfnt.c (sfnt_read_simple_glyph, sfnt_read_compound_glyph) (sfnt_read_glyph): Take size_t offsets. (struct sfnt_compound_glyph_context) @@ -4593,76 +4523,64 @@ 2023-02-08 Po Lu - Update Android port * src/sfnt.c (SCFS): Fix order of arguments. (sfnt_normalize_vector): Make sure vx and vy are within a reasonable range. (sfnt_move): Don't move when vectors are orthogonal. (main): Update. - Update Android port * doc/emacs/android.texi (Android Startup): Fix typos. + * src/sfnt.c (sfnt_interpret_msirp): Fix order in which operands to MSIRP are popped. (main): Reduce ppem values. - Merge remote-tracking branch 'origin/master' into feature/android - -2023-02-08 Po Lu - - Update Android port * doc/lispref/frames.texi (On-Screen Keyboards): Describe return value of `frame-toggle-on-screen-keyboard'. + * java/org/gnu/emacs/EmacsSurfaceView.java (surfaceChanged) - (surfaceCreated, EmacsSurfaceView): Remove unuseful - synchronization code. The framework doesn't seem to look at - this at all. + (surfaceCreated): Remove purposeless synchronization code. The + framework doesn't seem to consult this at all. - * java/org/gnu/emacs/EmacsView.java (EmacsView): - (onLayout): Lay out the window after children. + * java/org/gnu/emacs/EmacsView.java (onLayout): Lay out the window + after children. (swapBuffers): Properly implement `force'. (windowUpdated): Delete function. - * lisp/frame.el (frame-toggle-on-screen-keyboard): Return - whether or not the on screen keyboard might've been displayed. + * lisp/frame.el (frame-toggle-on-screen-keyboard): Return whether + or not the on screen keyboard might've been displayed. - * lisp/minibuffer.el (minibuffer-on-screen-keyboard-timer): - (minibuffer-on-screen-keyboard-displayed): - (minibuffer-setup-on-screen-keyboard): + * lisp/minibuffer.el (minibuffer-on-screen-keyboard-timer) + (minibuffer-on-screen-keyboard-displayed) + (minibuffer-setup-on-screen-keyboard) (minibuffer-exit-on-screen-keyboard): Improve OSK dismissal when there are consecutive minibuffers. * lisp/touch-screen.el (touch-screen-window-selection-changed): New function. - (touch-screen-handle-point-up): Register it as a window - selection changed function. + (touch-screen-handle-point-up): Register it as a window selection + changed function. * src/android.c (struct android_emacs_window) - (android_init_emacs_window): Remove references to - `windowUpdated'. + (android_init_emacs_window): Remove references to `windowUpdated'. (android_window_updated): Delete function. + * src/android.h (struct android_output): Remove `last_configure_serial'. + * src/androidterm.c (handle_one_android_event) (android_frame_up_to_date): + * src/androidterm.h (struct android_output): Remove frame synchronization, as that does not work on Android. -2023-02-08 Po Lu - - Fix graphics state when instructing glyphs * src/sfntfont.c (sfntfont_get_glyph_outline): Take new argument STATE and restore it prior to instructing the glyph. (sfntfont_measure_instructed_pcm, sfntfont_measure_pcm) (sfntfont_draw): Adjust accordingly. - - Correctly round bearing values while computing pcm - * src/sfntfont.c (sfntfont_measure_instructed_pcm) + (sfntfont_measure_instructed_pcm) (sfntfont_measure_pcm): Ceil rbearing value. -2023-02-08 Po Lu - - Improve text display on Android port * src/sfnt.c (sfnt_build_glyph_outline): Clear build_outline_context. (sfnt_poly_coverage): Extend coverage map. @@ -4670,39 +4588,32 @@ increase in coverage makes this hack unnecessary. (sfnt_build_outline_edges): Likewise. (sfnt_compare_edges): Remove function. - (sfnt_edge_sort): New function. Since edges are already - partially sorted, and there are not many, insertion sort - suffices. + (sfnt_edge_sort): New function. Since edges are already partially + sorted, and there are not many, insertion sort suffices. (sfnt_poly_edges): Use sfnt_edge_sort. (sfnt_fill_span): Stop rounding x0 and x1 to the grid, and make coverage computation static. - (sfnt_lookup_glyph_metrics): Fix return code for unscaled - metrics. + (sfnt_lookup_glyph_metrics): Fix return code for unscaled metrics. (sfnt_scale_metrics): New function. (SFNT_ENABLE_HINTING): Remove define. (struct sfnt_cvt_table, struct sfnt_fpgm_table) (struct sfnt_prep_table): Move to sfnt.h. - (sfnt_read_cvt_table): - (sfnt_read_fpgm_table, sfnt_read_prep_table): Make TEST_STATIC. + (sfnt_read_cvt_table, sfnt_read_fpgm_table, sfnt_read_prep_table): + Make TEST_STATIC. (struct sfnt_unit_vector, struct sfnt_interpreter_definition) (struct sfnt_interpreter_zone, struct sfnt_graphics_state): (struct sfnt_interpreter): Move to sfnt.h. (sfnt_make_interpreter): Make TEST_STATIC. (POP, PUSH, DELTAP1, DELTAP2, DELTAP3): When TEST, define to regular push and pop. - (sfnt_deltac): - (sfnt_deltap): Fix order of arguments. + (sfnt_deltac, sfnt_deltap): Fix order of arguments. (IUP_SINGLE_PAIR): Fix interpolation loop wraparound. - (sfnt_interpret_font_program): + (sfnt_interpret_font_program) (sfnt_interpret_control_value_program): Make TEST_STATIC. (struct sfnt_instructed_outline): Move to sfnt.h. (sfnt_build_instructed_outline): Make TEST_STATIC. - (sfnt_interpret_simple_glyph): - (sfnt_x_raster): - (sfnt_test_raster): - (all_tests): - (sfnt_verbose): - (main): Improve test code. + (sfnt_interpret_simple_glyph, sfnt_x_raster, sfnt_test_raster) + (all_tests, sfnt_verbose, main): Improve test code. * src/sfnt.h (SFNT_ENABLE_HINTING, struct sfnt_cvt_table) (struct sfnt_fpgm_table, struct sfnt_prep_table) @@ -4710,8 +4621,10 @@ (struct sfnt_interpreter_zone, struct sfnt_graphics_state) (struct sfnt_interpreter, struct sfnt_instructed_outline) (PROTOTYPE): New definitions. + * src/sfntfont-android.c (sfntfont_android_put_glyphs): Make coordinate generation more straightforward. + * src/sfntfont.c (sfntfont_get_glyph_outline): New arguments INTERPRETER and METRICS. (struct sfnt_font_info): New tables. @@ -4725,20 +4638,13 @@ 2023-02-07 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Remove junk from instruction table - * src/sfnt.c (sfnt_name_instruction): Do so. - - Remove bresenham stuff - * src/sfnt.c (sfnt_step_edge, sfnt_step_edge_n) + * src/sfnt.c (sfnt_name_instruction): Remove junk from instruction + table. + (sfnt_step_edge, sfnt_step_edge_n) (sfnt_build_outline_edges, sfnt_test_edge, main): * src/sfnt.h (struct sfnt_edge): Stop using error corrected line drawing, as it's actually slower. -2023-02-07 Po Lu - - Update Android port * INSTALL.android: Describe patches for BoringSSL on ARM. * src/sfnt.c (sfnt_build_glyph_outline): Remove redundant @@ -4755,21 +4661,19 @@ (sfnt_large_integer_add): New function. (sfnt_mul_f26dot6_fixed): Round product. (sfnt_make_interpreter): Remove redundant multiplication. - - (CHECK_STACK_ELEMENTS, POP_UNCHECKED, PUSH_UNCHECKED): New - macros. + (CHECK_STACK_ELEMENTS, POP_UNCHECKED, PUSH_UNCHECKED): New macros. (MOVE, POP, SWAP, CINDEX, RS, RCVT, LT, LTEQ, GT, GTEQ, EQ, NEQ) (EVEN, AND, OR, NOT, ADD, SUB, DIV, MUL, ABS, NEG, FLOOR, CEILING) - (GETINFO, ROLL, _MAX, _MIN, ROUND, NROUND, GC, MD): Don't check - SP redundantly, especially when pushing an element right after + (GETINFO, ROLL, _MAX, _MIN, ROUND, NROUND, GC, MD): Don't check SP + redundantly, especially when pushing an element right after popping one. (sfnt_move_glyph_zone): Don't touch points by passing NULL as flags. - (sfnt_direct_move_zp2): Touch P in the directions of the - movement. + (sfnt_direct_move_zp2): Touch P in the directions of the movement. (sfnt_interpret_scfs): Fix coding style. (sfnt_interpret_simple_glyph): Don't round Y coordinates. - (sfnt_test_span, sfnt_test_edges, sfnt_debug_edges, sfnt_test_edge) + (sfnt_test_span, sfnt_test_edges, sfnt_debug_edges) + (sfnt_test_edge) (sfnt_x_raster, sfnt_test_raster, rcvt_test_args) (deltac1_test_args, deltac2_test_args, deltac3_test_args) (roll_1_test_args, sfnt_run_hook, sfnt_identify_instruction) @@ -4779,19 +4683,16 @@ 2023-02-06 Po Lu - Port emacsclient wrapper to Android 7.1 and earlier - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Load every - native library on which Emacs depends prior to loading libemacs - itself. + * java/org/gnu/emacs/EmacsNative.java + (EmacsNative) : Load every native library on + which Emacs depends prior to loading libemacs itself. * java/org/gnu/emacs/EmacsOpenActivity.java (readEmacsClientLog) - (EmacsOpenActivity, startEmacsClient): Don't use redirectError - on Android 7.1 and earlier. - -2023-02-06 Po Lu + (startEmacsClient): Don't use redirectError on Android 7.1 and + earlier. - Adjust ndk-build implementation for old NDK versions * configure.ac: Pass ANDROID_CFLAGS to ndk_INIT. + * cross/ndk-build/Makefile.in (NDK_BUILD_CFLAGS): * cross/ndk-build/ndk-build-shared-library.mk ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): @@ -4799,13 +4700,10 @@ * cross/ndk-build/ndk-build-static-library.mk ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): ($$(error Unsupported suffix): Use NDK_BUILD_CFLAGS. + * m4/ndk-build.m4 (ndk_INIT): Accept cflags. (ndk_CONFIG_FILES): Export NDK_BUILD_CFLAGS. - Merge remote-tracking branch 'origin/master' into feature/android - -2023-02-06 Po Lu - Update Android port * java/AndroidManifest.xml.in: Prevent the Emacs activity from being overlayed by the emacsclient wrapper. @@ -4815,13 +4713,9 @@ * java/org/gnu/emacs/EmacsWindow.java (onTouchEvent): Handle ACTION_CANCEL correctly. -2023-02-06 Po Lu - - Update Android port * src/sfnt.c (struct sfnt_build_glyph_outline_context) (sfnt_build_glyph_outline, sfnt_fill_span): Improve glyph appearance by rounding coordinate values. - (struct sfnt_interpreter): New fields `twilight_original_x', `twilight_original_y'. (sfnt_make_interpreter): Set new fields. @@ -4831,13 +4725,15 @@ callers changed. (sfnt_address_zp2, sfnt_address_zp1, sfnt_address_zp0): Obtain original positions in the twilight zone as well. - (sfnt_check_zp1, sfnt_interpret_fliprgoff, sfnt_interpret_fliprgon) + (sfnt_check_zp1, sfnt_interpret_fliprgoff) + (sfnt_interpret_fliprgon) (sfnt_interpret_flippt, sfnt_interpret_scfs, sfnt_interpret_miap) (sfnt_interpret_alignrp, sfnt_line_to_vector, P) (sfnt_interpret_msirp, sfnt_interpret_ip, sfnt_interpret_call) (load_point, sfnt_interpret_iup_1, sfnt_interpret_iup) (sfnt_interpret_run, struct sfnt_scaled_outline) - (struct sfnt_instructed_outline, sfnt_decompose_instructed_outline) + (struct sfnt_instructed_outline) + (sfnt_decompose_instructed_outline) (sfnt_build_instructed_outline, sfnt_compute_phantom_points) (sfnt_interpret_simple_glyph, all_tests, sfnt_setup_debugger) (sfnt_name_instruction, sfnt_draw_debugger, sfnt_run_hook) @@ -4847,16 +4743,20 @@ 2023-02-05 Po Lu - Update Android port * INSTALL.android: Explain how to build selinux. + * configure.ac: Enable selinux on Android. - * cross/ndk-build/ndk-build-shared-library.mk: ($(call - objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error - Unsupported suffix)::(NDK_CFLAGS_$(LOCAL_MODULE)): - * cross/ndk-build/ndk-build-static-library.mk: ($(call - objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error - Unsupported suffix)::(NDK_CFLAGS_$(LOCAL_MODULE)): Correctly - handle files with a .cc suffix, and clang-specific asflags. + + * cross/ndk-build/ndk-build-shared-library.mk + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))) + ($$(error Unsupported suffix)) + (NDK_CFLAGS_$(LOCAL_MODULE)): + * cross/ndk-build/ndk-build-static-library.mk + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))) + ($$(error Unsupported suffix)) + (NDK_CFLAGS_$(LOCAL_MODULE)): Correctly handle files with a .cc + suffix, and clang-specific asflags. + * cross/ndk-build/ndk-clear-vars.mk: Handle AOSP extensions LOCAL_ADDITIONAL_DEPENDENCIES, LOCAL_CLANG_ASFLAGS_$(NDK_BUILD_ARCH) and LOCAL_IS_HOST_MODULE. @@ -4866,12 +4766,12 @@ * java/org/gnu/emacs/EmacsView.java (EmacsView): New flag `isCurrentlyTextEditor'. - (showOnScreenKeyboard, hideOnScreenKeyboard): Set as - appropriate. + (showOnScreenKeyboard, hideOnScreenKeyboard): Set as appropriate. (onCheckIsTextEditor): Return its value. * lisp/touch-screen.el (touch-screen-handle-scroll): Don't ding at buffer limits. + * m4/ndk-build.m4: Improve doc. * src/Makefile.in (LIBSELINUX_CFLAGS): New variable. @@ -4879,173 +4779,97 @@ 2023-02-05 Po Lu - Update from gnulib - * admin/merge-gnulib (avoided_flags): - * cross/lib/cdefs.h (__bos): - (__glibc_unsigned_or_positive): - (__glibc_unsafe_len): - (__glibc_fortify): - (__glibc_fortify_n): - * cross/lib/isnan.c: - * cross/lib/libc-config.h: - * cross/lib/openat-proc.c (openat_proc_name): - * cross/lib/vasnprintf.c (VASNPRINTF): - * cross/lib/verify.h (_Static_assert): - (_GL_SA3): - * lib/gnulib.mk.in (HAVE_GRANTPT): - (HAVE_SPAWN_H): - (NEXT_AS_FIRST_DIRECTIVE_LIMITS_H): - (NEXT_LIMITS_H): - (REPLACE_GETSUBOPT): - (REPLACE_ILOGB): - (SYSTEM_TYPE): - (BUILT_SOURCES): - * lib/isnan.c: - * lib/vasnprintf.c (VASNPRINTF): - * lib/verify.h (_GL_SA3): - * m4/gnulib-common.m4 (gl_COMMON_BODY): - * m4/gnulib-comp.m4 (gl_INIT): Update from gnulib. - - Merge remote-tracking branch 'origin/master' into feature/android + * m4, lib: Update from Gnulib. - Update Android port - * src/sfnt.c (struct sfnt_graphics_state): - (LOOPCALL): - (DELTAC3): - (PROJECT): - (SHPIX): - (sfnt_save_projection_vector): - (sfnt_check_zp0): - (sfnt_dual_project_vector): - (sfnt_interpret_scfs): - (sfnt_round_symmetric): - (sfnt_interpret_miap): - (sfnt_interpret_alignrp_1): - (sfnt_interpret_alignrp): - (sfnt_measure_distance): - (sfnt_interpret_msirp): - (sfnt_interpret_ip): - (sfnt_interpret_mdap): - (sfnt_deltap): - (sfnt_dual_project_onto_any_vector): - (sfnt_validate_gs): - (sfnt_set_projection_vector): - (sfnt_interpret_shp): - (sfnt_interpret_run): - (sfnt_check_sloop): - (main): Check in more WIP font code. + * src/sfnt.c (struct sfnt_graphics_state, LOOPCALL, DELTAC3) + (PROJECT, SHPIX, sfnt_save_projection_vector, sfnt_check_zp0) + (sfnt_dual_project_vector, sfnt_interpret_scfs) + (sfnt_round_symmetric, sfnt_interpret_miap) + (sfnt_interpret_alignrp_1, sfnt_interpret_alignrp) + (sfnt_measure_distance, sfnt_interpret_msirp, sfnt_interpret_ip) + (sfnt_interpret_mdap, sfnt_deltap) + (sfnt_dual_project_onto_any_vector, sfnt_validate_gs) + (sfnt_set_projection_vector, sfnt_interpret_shp) + (sfnt_interpret_run, sfnt_check_sloop, main): Check in more WIP + font code. 2023-02-04 Po Lu - Add emacsclient desktop file equivalent on Android * doc/emacs/android.texi (Android File System): + * java/AndroidManifest.xml.in: Update with new activity. Remove Android 10 restrictions through a special flag. * java/org/gnu/emacs/EmacsNative.java (getProcName): New function. - * java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity): - New file. + + * java/org/gnu/emacs/EmacsOpenActivity.java: New file. + * java/org/gnu/emacs/EmacsService.java (getLibraryDirection): Remove unused annotation. + * lib-src/emacsclient.c (decode_options): Set alt_display on Android. - * src/android.c (android_proc_name): New function. - (NATIVE_NAME): Export via JNI. - -2023-02-04 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * src/android.c (android_proc_name): New function. + (getProcName): Export via JNI. - Add additional permissions to Android port * doc/emacs/android.texi (Android Environment): + * java/AndroidManifest.xml.in: Add network state permissions. - Update Android port - * src/sfnt.c (sfnt_multiply_divide_signed): - (struct sfnt_interpreter_zone): - (struct sfnt_graphics_state): - (struct sfnt_interpreter): - (sfnt_mul_f2dot14): - (sfnt_interpret_trap): - (WCVTF): - (ALIGNPTS): - (sfnt_scale_by_freedom_vector): - (sfnt_interpret_utp): - (sfnt_address_zp2): - (sfnt_address_zp1): - (sfnt_address_zp0): - (sfnt_check_zp2): - (sfnt_move_zp0): - (sfnt_move_zp1): - (sfnt_move_glyph_zone): - (sfnt_move_twilight_zone): - (sfnt_direct_move_zp2): - (sfnt_interpret_alignpts): - (sfnt_interpret_isect): - (sfnt_line_to_vector): - (sfnt_deltac): - (sfnt_interpret_mdap): - (sfnt_interpret_call): - (sfnt_dot_fix_14): - (sfnt_move_x): - (sfnt_move_y): - (sfnt_move): - (sfnt_validate_gs): - (sfnt_interpret_shz): - (sfnt_interpret_shc): - (sfnt_interpret_shp): - (sfnt_interpret_iup_1): - (sfnt_interpret_iup): - (sfnt_interpret_run): - (sfnt_interpret_font_program): - (sfnt_interpret_control_value_program): - (sfnt_interpret_simple_glyph): - (jrot_test_args): - (jrof_test_args): - (all_tests): - (main): Check in more WIP code. + * src/sfnt.c (sfnt_multiply_divide_signed) + (struct sfnt_interpreter_zone, struct sfnt_graphics_state) + (struct sfnt_interpreter, sfnt_mul_f2dot14) + (sfnt_interpret_trap, WCVTF) + (ALIGNPTS, sfnt_scale_by_freedom_vector, sfnt_interpret_utp) + (sfnt_address_zp2, sfnt_address_zp1, sfnt_address_zp0) + (sfnt_check_zp2, sfnt_move_zp0, sfnt_move_zp1) + (sfnt_move_glyph_zone, sfnt_move_twilight_zone) + (sfnt_direct_move_zp2, sfnt_interpret_alignpts) + (sfnt_interpret_isect, sfnt_line_to_vector, sfnt_deltac) + (sfnt_interpret_mdap, sfnt_interpret_call, sfnt_dot_fix_14) + (sfnt_move_x, sfnt_move_y, sfnt_move, sfnt_validate_gs) + (sfnt_interpret_shz, sfnt_interpret_shc, sfnt_interpret_shp) + (sfnt_interpret_iup_1, sfnt_interpret_iup, sfnt_interpret_run) + (sfnt_interpret_font_program) + (sfnt_interpret_control_value_program) + (sfnt_interpret_simple_glyph, jrot_test_args, jrof_test_args) + (all_tests, main): Check in more WIP code. 2023-02-02 Po Lu - Add Emacs icon for Android package * java/AndroidManifest.xml.in: Add new icon. + * java/Makefile.in (srcdir): New variable. (JAVA_FILES, RESOURCE_FILES): Update variables. (emacs.apk-in): Apply resources. + * java/README: Describe directory tree. - Add Emacs icon for Android * java/res/drawable/emacs.png: New file. - Update Android port * src/android.c (android_get_current_api_level): New function. - * src/android.h: Export it. - * src/sfntfont-android.c (init_sfntfont_android): Make device - API level detection always work. - Clean up compiler warnings - * src/sfnt.c (sfnt_multiply_divide_signed): Add MAYBE_UNUSED. + * src/android.h: Export it. - Merge remote-tracking branch 'origin/master' into feature/android + * src/sfntfont-android.c (init_sfntfont_android): Make device API + level detection always work. -2023-02-02 Po Lu + * src/sfnt.c (sfnt_multiply_divide_signed): Add MAYBE_UNUSED. - Update Android port - * src/sfnt.c (xmalloc, xrealloc): Improve behavior upon - allocation failures during test. + * src/sfnt.c (xmalloc, xrealloc): Improve behavior upon allocation + failures during test. (sfnt_table_names): Add prep. (sfnt_transform_coordinates): Allow applying offsets during coordinate transform. (sfnt_decompose_compound_glyph): Defer offset computation until any component compound glyph is loaded, then apply it during the transform process. - (sfnt_multiply_divide): Make available everywhere. Implement on 64 bit systems. (sfnt_multiply_divide_signed): New function. (sfnt_mul_fixed): Fix division overflow. - (sfnt_curve_to_and_build_1, sfnt_build_glyph_outline): Remove outdated comment. (sfnt_build_outline_edges): Fix coding style. @@ -5063,128 +4887,52 @@ `move', `vector_dot_product'. Rename to `sfnt_graphics_state'. (struct sfnt_interpreter, sfnt_mul_f26dot6): Stop doing rounding division. - (sfnt_init_graphics_state): - (sfnt_make_interpreter): - (MOVE): - (SSW): - (RAW): - (SDS): - (ADD): - (SUB): - (ABS): - (NEG): - (WCVTF): - (_MIN): - (S45ROUND): - (SVTCAx): - (sfnt_set_srounding_state): - (sfnt_skip_code): - (sfnt_interpret_unimplemented): - (sfnt_interpret_fdef): - (sfnt_interpret_idef): - (sfnt_interpret_if): - (sfnt_interpret_else): - (sfnt_round_none): - (sfnt_round_to_grid): - (sfnt_round_to_double_grid): - (sfnt_round_down_to_grid): - (sfnt_round_up_to_grid): - (sfnt_round_to_half_grid): - (sfnt_round_super): - (sfnt_validate_gs): - (sfnt_interpret_run): - (sfnt_interpret_font_program): - (struct sfnt_test_dcontext): - (sfnt_test_move_to): - (sfnt_test_line_to): - (sfnt_test_curve_to): - (sfnt_test_get_glyph): - (sfnt_test_free_glyph): - (sfnt_test_span): - (sfnt_test_edge_ignore): - (sfnt_test_edge): - (sfnt_test_raster): - (test_interpreter_profile): - (test_cvt_values): - (test_interpreter_cvt): - (test_interpreter_head): - (sfnt_make_test_interpreter): - (struct sfnt_interpreter_test): - (sfnt_run_interpreter_test): - (struct sfnt_generic_test_args): - (sfnt_generic_check): - (sfnt_check_srp0): - (sfnt_check_szp0): - (sfnt_check_sloop): - (struct sfnt_rounding_test_args): - (sfnt_check_rounding): - (sfnt_check_smd): - (sfnt_check_scvtci): - (sfnt_check_sswci): - (sfnt_check_ssw): - (sfnt_check_flipon): - (sfnt_check_flipoff): - (npushb_test_args): - (npushw_test_args): - (pushb_test_args): - (pushw_test_args): - (stack_overflow_test_args): - (stack_underflow_test_args): - (rtg_test_args): - (rtg_symmetric_test_args): - (rtg_1_test_args): - (rtg_1_symmetric_test_args): - (rthg_test_args): - (rthg_1_test_args): - (rtdg_test_args): - (rtdg_1_test_args): - (rtdg_2_test_args): - (rtdg_3_test_args): - (else_test_args): - (jmpr_test_args): - (dup_test_args): - (pop_test_args): - (clear_test_args): - (swap_test_args): - (depth_test_args): - (cindex_test_args): - (mindex_test_args): - (raw_test_args): - (loopcall_test_args): - (call_test_args): - (fdef_test_args): - (fdef_1_test_args): - (endf_test_args): - (ws_test_args): - (rs_test_args): - (wcvtp_test_args): - (rcvt_test_args): - (mppem_test_args): - (mps_test_args): - (debug_test_args): - (lt_test_args): - (all_tests): - (main): Implement more instructions. - - * src/sfnt.h (enum sfnt_table, struct sfnt_glyph_metrics): Add - new tables. Add comment. - -2023-01-30 Po Lu - - Merge remote-tracking branch 'origin/master' into feature/android - - Merge remote-tracking branch 'origin/master' into feature/android + (sfnt_init_graphics_state, sfnt_make_interpreter, MOVE, SSW, RAW) + (SDS, ADD, SUB, ABS, NEG, WCVTF, _MIN, S45ROUND, SVTCAx) + (sfnt_set_srounding_state, sfnt_skip_code) + (sfnt_interpret_unimplemented, sfnt_interpret_fdef) + (sfnt_interpret_idef, sfnt_interpret_if, sfnt_interpret_else) + (sfnt_round_none, sfnt_round_to_grid, sfnt_round_to_double_grid) + (sfnt_round_down_to_grid, sfnt_round_up_to_grid) + (sfnt_round_to_half_grid, sfnt_round_super, sfnt_validate_gs) + (sfnt_interpret_run, sfnt_interpret_font_program) + (struct sfnt_test_dcontext, sfnt_test_move_to, sfnt_test_line_to) + (sfnt_test_curve_to, sfnt_test_get_glyph, sfnt_test_free_glyph) + (sfnt_test_span, sfnt_test_edge_ignore, sfnt_test_edge) + (sfnt_test_raster, test_interpreter_profile, test_cvt_values) + (test_interpreter_cvt, test_interpreter_head) + (sfnt_make_test_interpreter, struct sfnt_interpreter_test) + (sfnt_run_interpreter_test, struct sfnt_generic_test_args) + (sfnt_generic_check, sfnt_check_srp0, sfnt_check_szp0) + (sfnt_check_sloop, struct sfnt_rounding_test_args) + (sfnt_check_rounding, sfnt_check_smd, sfnt_check_scvtci) + (sfnt_check_sswci, sfnt_check_ssw, sfnt_check_flipon) + (sfnt_check_flipoff, npushb_test_args, npushw_test_args) + (pushb_test_args, pushw_test_args, stack_overflow_test_args) + (stack_underflow_test_args, rtg_test_args) + (rtg_symmetric_test_args, rtg_1_test_args) + (rtg_1_symmetric_test_args, rthg_test_args, rthg_1_test_args) + (rtdg_test_args, rtdg_1_test_args, rtdg_2_test_args) + (rtdg_3_test_args, else_test_args, jmpr_test_args, dup_test_args) + (pop_test_args, clear_test_args, swap_test_args, depth_test_args) + (cindex_test_args, mindex_test_args, raw_test_args) + (loopcall_test_args, call_test_args, fdef_test_args) + (fdef_1_test_args, endf_test_args, ws_test_args, rs_test_args) + (wcvtp_test_args, rcvt_test_args, mppem_test_args, mps_test_args) + (debug_test_args, lt_test_args, all_tests, main): Implement more + instructions. - Merge remote-tracking branch 'origin/master' into feature/android + * src/sfnt.h (enum sfnt_table, struct sfnt_glyph_metrics): Add new + tables. Add comment. 2023-01-30 Po Lu - Update Android port - * cross/ndk-build/ndk-build-shared-library.mk: ($(call - objname,$(LOCAL_MODULE),$(basename $(1)))): - * cross/ndk-build/ndk-build-static-library.mk: ($(call - objname,$(LOCAL_MODULE),$(basename $(1)))): Revert broken typo - fixes. + * cross/ndk-build/ndk-build-shared-library.mk + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): + * cross/ndk-build/ndk-build-static-library.mk + ($(call objname,$(LOCAL_MODULE),$(basename $(1)))): Revert broken + typo fixes. + * src/sfnt.c (TEST_STATIC): Define ARRAYELTS. (sfnt_table_names): New CVT and FPGM tables. (sfnt_decompose_compound_glyph, sfnt_decompose_glyph) @@ -5237,43 +4985,43 @@ 2023-01-29 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Check in missing files - * .gitignore: - * cross/lib/_Noreturn.h (_Noreturn): Add missing gnulib files. + * .gitignore: Add missing gnulib files. - Update Android port * INSTALL.android (module_target): Clarify documentation. + * cross/ndk-build/ndk-build-shared-library.mk: - * cross/ndk-build/ndk-build-static-library.mk: Fix building Neon objects. + * cross/ndk-build/ndk-build-static-library.mk: Fix building Neon + objects. + * java/AndroidManifest.xml.in: Add a version code. 2023-01-28 Po Lu - Implement `restart-emacs' on Android * java/org/gnu/emacs/EmacsService.java (restartEmacs): New function. + * src/android.c (struct android_emacs_service) (android_init_emacs_service): Add new method. (android_restart_emacs): New function. + * src/android.h: Update prototypes. + * src/emacs.c (Fkill_emacs): Call android_restart_emacs whenever appropriate. -2023-01-28 Po Lu - - Add libtiff support to Android port * INSTALL.android: Document how to build with libtiff. * build-aux/ndk-build-helper-1.mk (NDK_SO_NAME): * build-aux/ndk-build-helper-2.mk (NDK_A_NAME): * build-aux/ndk-build-helper-4.mk: Decrease number of duplicate dependencies found. + * configure.ac (ANDROID_SDK_18_OR_EARLIER, XCONFIGURE, PNG_CFLAGS) (HAVE_TIFF): Allow using libtiff on Android. + * cross/ndk-build/ndk-clear-vars.mk: Undefine additional variables. + * cross/ndk-build/ndk-resolve.mk: Split CFLAGS resolution from a-name resolution, and do not recursively add archive or shared object names for dependencies of shared libraries. @@ -5285,154 +5033,135 @@ * src/image.c (syms_of_image): Fix typo. -2023-01-28 Po Lu + * doc/emacs/android.texi (Android File System): Describe an easier + way to disable scoped storage. - Update Android port - * doc/emacs/android.texi (Android File System): Describe an - easier way to disable scoped storage. * java/AndroidManifest.xml.in: Add new permission to allow that. + * java/README: Add more text describing Java. + * java/org/gnu/emacs/EmacsContextMenu.java (Item): New fields `isCheckable' and `isChecked'. (EmacsContextMenu, addItem): New arguments. (inflateMenuItems): Set checked status as appropriate. * java/org/gnu/emacs/EmacsCopyArea.java (perform): Disallow - operations where width and height are less than or equal to - zero. + operations where width and height are less than or equal to zero. + * lisp/menu-bar.el (menu-bar-edit-menu): Make execute-extended-command available as a menu item. + * src/androidmenu.c (android_init_emacs_context_menu) - (android_menu_show): - * src/menu.c (have_boxes): Implement menu check boxes. + (android_menu_show): Implement menu check boxes. + + * src/menu.c (have_boxes): Treat Android builds as providing menu + checkboxes. 2023-01-28 Po Lu - Set up fontset stuff on Android - * lisp/term/android-win.el (window-system-initialization): - Create default fontset. - - Fix file descriptor leaks - * src/sfntfont.c (sfntfont_read_cmap): - (sfntfont_open): Fix leaks of file descriptors. - - Update from gnulib - * cross/lib/stdalign.in.h (_GL_STDALIGN_H): - (_): - (__alignof_is_defined): - * cross/lib/vasnprintf.c: - * lib/gnulib.mk.in (ANDROID_MIN_SDK): - (HAVE_SPAWN_H): - (LIBGCCJIT_LIBS): - (NATIVE_COMPILATION_AOT): - (NEXT_AS_FIRST_DIRECTIVE_LIMITS_H): - (NEXT_LIMITS_H): - (SIZEOF_LONG): - (stdalign.h): - * ../../../../dev/null: - * lib/stdalign.in.h (_GL_STDALIGN_H): - (_): - (__alignof_is_defined): - * lib/vasnprintf.c: - * m4/gnulib-common.m4 (gl_COMMON_BODY): - * m4/stdalign.m4 (gl_ALIGNASOF): - * m4/stddef_h.m4: Update from gnulib. + * lisp/term/android-win.el (window-system-initialization): Create + default fontset. - Merge remote-tracking branch 'origin/master' into feature/android + * src/sfntfont.c (sfntfont_read_cmap, sfntfont_open): Fix leaks of + file descriptors. -2023-01-28 Po Lu + * m4, lib: Update from Gnulib. - Update Android port * INSTALL.android: Document support for gnutls and libgmp. + * build-aux/ndk-build-helper-1.mk (NDK_SO_NAMES, NDK_INCLUDES) (SYSTEM_LIBRARIES): * build-aux/ndk-build-helper-2.mk: Recursively resolve and add shared library dependencies; even those of static libraries. + * build-aux/ndk-module-extract.awk: Fix makefile_imports code. + * configure.ac (ANDROID_SDK_18_OR_EARLIER, XCONFIGURE) (LIBGMP_CFLAGS): Enable GMP and gnutls on Android. * cross/ndk-build/Makefile.in (LOCAL_EXPORT_C_INCLUDES): - * cross/ndk-build/ndk-build-shared-library.mk: ($(call - objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error - Unsupported suffix)::($(LOCAL_MODULE_FILENAME)): - * cross/ndk-build/ndk-build-static-library.mk: ($(call - objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error - Unsupported suffix): + * cross/ndk-build/ndk-build-shared-library.mk: * cross/ndk-build/ndk-clear-vars.mk: * cross/ndk-build/ndk-resolve.mk (NDK_SYSTEM_LIBRARIES): (NDK_LOCAL_EXPORT_C_INCLUDES_$(LOCAL_MODULE)): - (NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): - Implement ``LOCAL_ASM_RULE'' and ``LOCAL_C_ADDITIONAL_FLAGS'' - extensions for libgmp. + (NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Implement ``LOCAL_ASM_RULE'' + and ``LOCAL_C_ADDITIONAL_FLAGS'' extensions for libgmp. * doc/emacs/input.texi (Touchscreens): Document how to horizontally scroll. + * java/org/gnu/emacs/EmacsActivity.java (attachWindow): Give the view focus again if necessary. (onPause): Call right super function. + * java/org/gnu/emacs/EmacsPreferencesActivity.java (onClick): - Clear dumpFileName lest Emacs try to load a nonexistent dump - file. + Clear dumpFileName lest Emacs try to load a nonexistent dump file. + * java/org/gnu/emacs/EmacsView.java (onDetachedFromWindow) (onAttachedToWindow): Call super functions. - (onCreateInputConnection): Make sure the IME never obscures - Emacs. - * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, onKeyDown) - (onKeyUp): Improve tracking of quit keys. + (onCreateInputConnection): Make sure the IME never obscures Emacs. + + * java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): + Improve tracking of quit keys. + + * lisp/isearch.el (isearch-mode): Bring up the onscreen keyboard. - * lisp/isearch.el (isearch-mode): Bring up the onscreen - keyboard. * lisp/touch-screen.el (touch-screen-current-tool): Add three fields. (touch-screen-handle-scroll): Allow hscrolling as well. (touch-screen-handle-touch): Add additional fields to `touch-screen-current-tool'. - * src/Makefile.in (LIBGMP_CFLAGS, EMACS_CFLAGS): Add new - variable. - * src/android.c (android_run_select_thread): - (android_write_event): Use pthread_cond_broadcast because - pthread_cond_signal does nothing on some Android - versions/devices? -2023-01-26 Po Lu + * src/Makefile.in (LIBGMP_CFLAGS, EMACS_CFLAGS): Add new variable. - Merge remote-tracking branch 'origin/master' into feature/android + * src/android.c (android_run_select_thread, android_write_event): + Use pthread_cond_broadcast because pthread_cond_signal does + nothing on some Android versions/devices? + +2023-01-26 Po Lu * doc/emacs/input.texi (On-Screen Keyboards): Fix typo. - Update Android port - * INSTALL.android: Describe that apksigner is also required. - * configure.ac: Correctly add cross/Makefile to - SUBDIR_MAKEFILES. - * cross/Makefile.in: (config.status): Depend on + * INSTALL.android: Mention that apksigner is also required. + + * configure.ac: Correctly add cross/Makefile to SUBDIR_MAKEFILES. + + * cross/Makefile.in (config.status): Depend on $(top_srcdir)/config.status. - * doc/emacs/input.texi (On-Screen Keyboards): Document how to - quit without a physical keyboard. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New - function `quit'. + + * doc/emacs/input.texi (On-Screen Keyboards): Document how to quit + without a physical keyboard. + + * java/org/gnu/emacs/EmacsNative.java (quit): New function `quit'. + * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): New field `lastVolumeButtonPress'. (onKeyDown): Quit if necessary. - * m4/ndk-build.m4 (ndk_where_cc): Fix search if CC is not a - single word. + + * m4/ndk-build.m4 (ndk_where_cc): Fix search if CC is not a single + word. + * src/android.c (android_open): Remove unused variable. (quit): New function. + * src/androidmenu.c (android_process_events_for_menu): Allow quitting the menu. + * src/xterm.c (handle_one_xevent, x_term_init, syms_of_xterm): - Implement features described above, so they work on free + Implement features illustrated above, so they work on free operating systems. + * src/xterm.h (struct x_display_info): New fields `quit_keysym', `quit_keysym_time'. 2023-01-26 Po Lu - Update Android port * INSTALL.android: Document how to install sqlite3. + * build-aux/ndk-build-helper-1.mk (SYSTEM_LIBRARIES): * build-aux/ndk-build-helper-2.mk (SYSTEM_LIBRARIES): Add liblog and libandroid. + * configure.ac (SQLITE3_LIBS, HAVE_SQLITE3) (HAVE_SQLITE3_LOAD_EXTENSION): Support on Android. (APKSIGNER): Look for this new required binary. @@ -5443,38 +5172,43 @@ * cross/ndk-build/ndk-build.mk.in (NDK_BUILD_SHARED): Fix definition. - * cross/ndk-build/ndk-resolve.mk: - (NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Handle new system - libraries. + + * cross/ndk-build/ndk-resolve.mk + (NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Handle new system libraries. * doc/emacs/android.texi (Android File System): Document Android 10 system restriction. - * java/AndroidManifest.xml.in: Target Android 33, not 28. + * java/AndroidManifest.xml.in: Target Android API 33, not 28. + * java/Makefile.in (SIGN_EMACS_V2, APKSIGNER): New variables. - ($(APK_NAME)): Make sure to apply a ``version 2 signature'' to - the package as well. + ($(APK_NAME)): Make sure to apply a ``version 2 signature'' to the + package as well. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New argument apiLevel. + * java/org/gnu/emacs/EmacsNoninteractive.java (main): * java/org/gnu/emacs/EmacsThread.java (run): Pass API level. + * m4/ndk-build.m4 (ndk_package_mape): Add package mapping for sqlite3. + * src/Makefile.in (SQLITE3_CFLAGS): New substition. (EMACS_CFLAGS): Add that variable. * src/android.c (android_api_level): New variable. (initEmacs): Set it. (android_file_access_p): Make static. - (android_hack_asset_fd): Adjust for restrictions in Android 29 - and later. + (android_hack_asset_fd): Adjust for restrictions in Android 29 and + later. (android_close_on_exec): New function. (android_open): Adjust to not duplicate file descriptor even if CLOEXEC. (android_faccessat): Use fstatat at-func emulation. * src/android.h: Update prototypes. + * src/dired.c (file_name_completion_dirp): * src/fileio.c (file_access_p, Faccess_file): Now that sys_faccessat takes care of everything, stop calling @@ -5482,9 +5216,10 @@ 2023-01-26 Po Lu - Update Android port * .gitignore: Ignore lib/math.h. + * INSTALL.android: Update accordingly. + * build-aux/ndk-build-helper-1.mk: * build-aux/ndk-build-helper-2.mk: * build-aux/ndk-build-helper.mk: @@ -5502,11 +5237,13 @@ version for actual popup menus. * lib/math.h: Delete file. - * m4/ndk-build.m4 (ndk_SEARCH_MODULE, ndk_CHECK_MODULES): Look - for nasm and C++ libraries. + * m4/ndk-build.m4 (ndk_SEARCH_MODULE, ndk_CHECK_MODULES): Look for + nasm and C++ libraries. * src/android.c (faccessat): Rename to `android_faccessat'. + * src/android.h: Update prototypes. + * src/dired.c (file_name_completion_dirp): * src/fileio.c (file_access_p, Faccess_file, file_directory_p): * src/lisp.h: @@ -5516,26 +5253,26 @@ 2023-01-26 Po Lu - Remove unused file * cross/ndk-build/ndk-build.in: Delete unused file. 2023-01-25 Po Lu - Update Android port - * java/org/gnu/emacs/EmacsDrawLine.java: Fix this again. Gosh, - how does Android do this. + * java/org/gnu/emacs/EmacsDrawLine.java: Fix this again. + * java/org/gnu/emacs/EmacsNoninteractive.java (main): Port to Android 2.3.3. - * java/org/gnu/emacs/EmacsSdk11Clipboard.java - (EmacsSdk11Clipboard): Port to Android 4.0.3. - * java/org/gnu/emacs/EmacsService.java (getClipboardManager): - New function. + * java/org/gnu/emacs/EmacsSdk11Clipboard.java: Port to Android + 4.0.3. + + * java/org/gnu/emacs/EmacsService.java (getClipboardManager): New + function. * src/alloc.c (find_string_data_in_pure): Fix Android alignment issue. * src/android-emacs.c (main): Port to Android 4.4. + * src/android.c (initEmacs): Align stack to 32 bytes, so it ends up aligned to 16 even though gcc thinks the stack is already aligned to 16 bytes. @@ -5543,23 +5280,15 @@ * src/callproc.c (init_callproc): Use /system/bin/sh instead of /bin/sh by default. -2023-01-25 Po Lu - - Remove extra header * cross/lib/math.h: Delete header. - Minor fixes to Android port - * java/Makefile.in: (emacs.apk-in): Don't call cp with empty - args. + * java/Makefile.in (emacs.apk-in): Don't call cp with empty args. + * java/org/gnu/emacs/EmacsDrawLine.java (perform): Fix for PostScript filling semantics. - * src/Makefile.in (android-emacs): Build android-emacs directly. - - Merge remote-tracking branch 'origin/master' into feature/android -2023-01-25 Po Lu + * src/Makefile.in (android-emacs): Build android-emacs directly. - Update Android port * doc/emacs/android.texi (Android Startup, Android Environment): Document that restrictions on starting Emacs have been lifted. @@ -5572,48 +5301,57 @@ * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Update function declarations. - * java/org/gnu/emacs/EmacsNoninteractive.java - (EmacsNoninteractive): New class. - * java/org/gnu/emacs/EmacsService.java (EmacsService, getApkFile) + * java/org/gnu/emacs/EmacsNoninteractive.java: New class. + + * java/org/gnu/emacs/EmacsService.java (getApkFile) (onCreate): Pass classpath to setEmacsParams. - * java/org/gnu/emacs/EmacsThread.java (EmacsThread): Make run an - override. + + * java/org/gnu/emacs/EmacsThread.java (run): Label as an + @Override. + * lisp/loadup.el: Don't dump on Android when noninteractive. + * lisp/shell.el (shell--command-completion-data): Handle inaccessible directories. - * src/Makefile.in (android-emacs): Link with gnulib. - * src/android-emacs.c (main): Implement to launch app-process - and then EmacsNoninteractive. + + * src/Makefile.in (android-emacs): Link with Gnulib. + + * src/android-emacs.c (main): Implement to launch app-process and + then EmacsNoninteractive. + * src/android.c (setEmacsParams): New argument `class_path'. Don't set stuff up when running noninteractive. + * src/android.h (initEmacs): Likewise. + * src/androidfont.c (init_androidfont): - * src/androidselect.c (init_androidselect): Don't initialize - when running noninteractive. + * src/androidselect.c (init_androidselect): Don't initialize when + running noninteractive. + * src/emacs.c (load_pdump): New argument `dump_file'. (android_emacs_init): Give new argument `dump_file' to `load_pdump'. - * src/sfntfont-android.c (init_sfntfont_android): Don't - initialize when running noninteractive. -2023-01-25 Po Lu + * src/sfntfont-android.c (init_sfntfont_android): Don't initialize + when running noninteractive. + + * admin/merge-gnulib (GNULIB_MODULES): Add printf-posix and + vasprintf-posix. - Import gnulib modules printf-posix and vasprintf-posix - These are neccessary because Android's printf is missing basic format - modifiers such as t. + * m4, lib: Update from Gnulib. - * admin/merge-gnulib (GNULIB_MODULES): Add printf-posix and - vasprintf-posix. Update from gnulib. * configure.ac (CFLAGS): Add -DHAVE_CONFIG_H. 2023-01-24 Po Lu - Make binaries distributed with Emacs work on Android * doc/lispref/processes.texi (Subprocess Creation): Document variables containing program names. + * etc/NEWS: Document new variables. + * java/Makefile.in (CROSS_BINS): Add missing etags binary. + * lisp/cedet/semantic/db-ebrowse.el (semanticdb-create-ebrowse-database): * lisp/gnus/mail-source.el (mail-source-movemail-program): @@ -5627,24 +5365,26 @@ * lisp/speedbar.el (speedbar-fetch-etags-command): * lisp/textmodes/reftex-global.el (reftex-create-tags-file): Use new variables. - * src/callproc.c (syms_of_callproc): New variables naming - binaries redistributed with Emacs. -2023-01-24 Po Lu + * src/callproc.c (syms_of_callproc): Introduce new variables + naming binaries redistributed with Emacs. - Enable libjpeg on Android * INSTALL.android: Update documentation. + * build-aux/ndk-build-helper-1.mk: When building shared libraries, do not link libemacs.so with dependent archive files. - * build-aux/ndk-build-helper-2.mk: Add whole archive - dependencies as well. + + * build-aux/ndk-build-helper-2.mk: Add whole archive dependencies + as well. * configure.ac (HAVE_JPEG): Enable on Android. * cross/ndk-build/ndk-build-shared-library.mk: Link the shared object with archive file dependencies. + * cross/ndk-build/ndk-build-static-library.mk: Build all code position-independently. + * cross/ndk-build/ndk-resolve.mk: Separately resolve a names of archive and whole archive dependencies. @@ -5653,10 +5393,12 @@ 2023-01-24 Po Lu - Update Android port * INSTALL.android: Update. + * build-aux/ndk-build-helper-1.mk: Fix typo. + * configure.ac: Enable --with-json on Android. + * cross/ndk-build/ndk-build-shared-library.mk: (NDK_CFLAGS_$(LOCAL_MODULE)): (LOCAL_MODULE_FILENAME): @@ -5665,29 +5407,36 @@ (LOCAL_MODULE_FILENAME): Recursively resolve dependencies. * cross/ndk-build/ndk-resolve.mk: New function. - * doc/emacs/android.texi (Android Startup): Document how Emacs - is dumped during initial startup. + * doc/emacs/android.texi (Android Startup): Document how Emacs is + dumped during initial startup. * java/Makefile.in (filename): Fix build with multiple shared libraries. + * java/README: Improve commentary. + * java/org/gnu/emacs/EmacsApplication.java (onCreate): Look and set dump file. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New + + * java/org/gnu/emacs/EmacsNative.java (getFingerprint): New function getFingerprint. + * java/org/gnu/emacs/EmacsPreferencesActivity.java (onCreate): Add option to erase the dump file. - * java/org/gnu/emacs/EmacsService.java (browseUrl): New - function. - * java/org/gnu/emacs/EmacsThread.java (run): Specify dump file - if found. + + * java/org/gnu/emacs/EmacsService.java (browseUrl): New function. + + * java/org/gnu/emacs/EmacsThread.java (run): Specify dump file if + found. + * lisp/loadup.el: Always dump during loadup on Android. - * lisp/net/browse-url.el (browse-url--browser-defcustom-type): - (browse-url-default-browser): - (browse-url-default-android-browser): New browse url type. + * lisp/net/browse-url.el (browse-url--browser-defcustom-type) + (browse-url-default-browser, browse-url-default-android-browser): + New browse url type. * m4/ndk-build.m4 (ndk_package_map): Map jansson to libjansson. + * src/android.c (struct android_emacs_service): New method `browse_url'. (getFingerprint): New function. @@ -5699,37 +5448,29 @@ * src/androidselect.c (Fandroid_browse_url): New function. (syms_of_androidselect): Define it. - * src/emacs.c (load_pdump): Don't look in fancy places on - Android. + * src/emacs.c (load_pdump): Eschew excessively elaborate dump file + location code on on Android. + * src/pdumper.c (Fdump_emacs_portable): Allow dumping while interactive on Android. (syms_of_pdumper): New variable `pdumper-fingerprint'. - * src/sfntfont-android.c (sfntfont_android_composite_bitmap): - Fix unused variables. + * src/sfntfont-android.c (sfntfont_android_composite_bitmap): Fix + unused variables. 2023-01-24 Po Lu - Update from gnulib - Update from gnulib. In addition, - * admin/merge-gnulib: Fix paths for rename. -2023-01-24 Po Lu - - Improve lib-src/Makefile.in - * lib-src/Makefile.in (DONT_INSTALL): - (clean): Correctly define asset-directory-tool. - - Merge remote-tracking branch 'origin/master' into feature/android + * lib-src/Makefile.in (DONT_INSTALL, clean): Correctly define + asset-directory-tool. - Fix distclean target * cross/Makefile.in (distclean bootstrap-clean): Remove Makefile. 2023-01-24 Po Lu - Update Android port * .gitignore: Update with new files. Do not ignore std*.in.h. + * INSTALL.android: Explain how to build Emacs with external dependencies. @@ -5738,49 +5479,55 @@ * README: Document new directories. - * build-aux/ndk-build-helper-1.mk (build_kind, NDK_SO_NAMES): - * build-aux/ndk-build-helper-2.mk (build_kind, NDK_SO_NAMES): - * build-aux/ndk-build-helper-3.mk (build_kind): + * build-aux/ndk-build-helper-1.mk: + * build-aux/ndk-build-helper-2.mk: + * build-aux/ndk-build-helper-3.mk: * build-aux/ndk-build-helper-4.mk: * build-aux/ndk-build-helper.mk (NDK_BUILD_DIR, my-dir): * build-aux/ndk-module-extract.awk: New files. - * configure.ac: Set up libgif, libwebp, and libpng for - ndk-build. - * cross/ndk-build/Makefile.in (srcdir, NDK_BUILD_ANDROID_MK): + * configure.ac: Set up libgif, libwebp, and libpng for ndk-build. + + * cross/ndk-build/Makefile.in: * cross/ndk-build/ndk-build-executable.mk: - * cross/ndk-build/ndk-build-shared-library.mk (eq, objname): - * cross/ndk-build/ndk-build-static-library.mk (eq, objname): - * cross/ndk-build/ndk-build.in (NDK_BUILD_MODULES): - * cross/ndk-build/ndk-build.mk.in (NDK_BUILD_MODULES) - (NDK_BUILD_SHARED): + * cross/ndk-build/ndk-build-shared-library.mk: + * cross/ndk-build/ndk-build-static-library.mk: + * cross/ndk-build/ndk-build.in: + * cross/ndk-build/ndk-build.mk.in: * cross/ndk-build/ndk-clear-vars.mk: * cross/ndk-build/ndk-prebuilt-shared-library.mk: * cross/ndk-build/ndk-prebuilt-static-library.mk: New files. - * doc/emacs/android.texi (Android, Android Environment): - Document clipboard support on Android. + + * doc/emacs/android.texi (Android, Android Environment): Document + clipboard support on Android. + * doc/emacs/emacs.texi (Top): Update menus. + * etc/MACHINES: Document Android. - * java/AndroidManifest.xml.in: Respect new - `--with-android-debug' option. + + * java/AndroidManifest.xml.in: Respect new `--with-android-debug' + option. + * java/Makefile.in (CROSS_BINS, CROSS_LIBS): Adjust for rename. - Include ndk-build.mk.:(emacs.apk-in): Depend on shared - libraries. Then, package shared libraries. - * java/org/gnu/emacs/EmacsClipboard.java (EmacsClipboard): New - class. + Include ndk-build.mk. + (emacs.apk-in): Depend on shared libraries. Then, package shared + libraries. + + * java/org/gnu/emacs/EmacsClipboard.java: New file. + * java/org/gnu/emacs/EmacsFontDriver.java: Update comment to say this is unused. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New - function `sendExpose'. - * java/org/gnu/emacs/EmacsSdk11Clipboard.java - (EmacsSdk11Clipboard): - * java/org/gnu/emacs/EmacsSdk8Clipboard.java - (EmacsSdk8Clipboard): New classes. - * java/org/gnu/emacs/EmacsView.java (EmacsView, handleDirtyBitmap) + + * java/org/gnu/emacs/EmacsNative.java (sendExpose): New function + `sendExpose'. + + * java/org/gnu/emacs/EmacsSdk11Clipboard.java: + * java/org/gnu/emacs/EmacsSdk8Clipboard.java: New files. + + * java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap) (onDetachedFromWindow): When window is reattached, expose the frame. - * lib/Makefile.in (VPATH): - (ALL_CFLAGS): Adjust for rename. + * lib/Makefile.in (VPATH, ALL_CFLAGS): Adjust for rename. * lisp/term/android-win.el (android-clipboard-exists-p) (android-get-clipboard, android-set-clipboard) @@ -5792,11 +5539,10 @@ functions. * m4/ndk-build.m4: New file. + * src/Makefile.in (GIF_CFLAGS, ANDROID_LDFLAGS): New variables. - (EMACS_CFLAGS): Add GIF_CFLAGS. Include - ndk-build.mk. - (libemacs.so): Depend on and link with required - libraries. + (EMACS_CFLAGS): Add GIF_CFLAGS. Include ndk-build.mk. + (libemacs.so): Depend on and link with required libraries. * src/android.c (android_check_compressed_file): New function. (android_open): Work around Android platform bug. @@ -5807,32 +5553,23 @@ (struct android_expose_event, union android_event): Add expose events. - * src/androidselect.c (struct android_emacs_clipboard) - (android_init_emacs_clipboard, Fandroid_clipboard_owner_p) - (Fandroid_set_clipboard, Fandroid_get_clipboard) - (Fandroid_clipboard_exists_p, init_androidselect) - (syms_of_androidselect): New file. + * src/androidselect.c: New file. - * src/androidterm.c (handle_one_android_event): Handle - exposures. - * src/androidterm.h: Update prototypes. - * src/emacs.c (android_emacs_init): Initialize androidselect. + * src/androidterm.c (handle_one_android_event) : + Handle exposures. -2023-01-24 Po Lu + * src/androidterm.h: Update prototypes. - Update android port - * xcompile: Move to cross. - * cross: New directory. + * src/emacs.c (android_emacs_init): Initialize androidselect. - Update android port * xcompile: Move to cross. * cross: New directory. 2023-01-21 Po Lu - Improve touch-screen support * doc/lispref/commands.texi (Touchscreen Events): Document changes. + * lisp/touch-screen.el (touch-screen-current-tool): Update doc string. (touch-screen-precision-scroll): New user option. @@ -5848,18 +5585,19 @@ * src/fileio.c (Fverify_visited_file_modtime): Fix fs check. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-01-21 Po Lu - Update Android port * doc/emacs/android.texi (Android File System): Document that ls-lisp is now used by default. + * java/org/gnu/emacs/EmacsThread.java (EmacsThread): Name the thread something meaningful. + * lisp/loadup.el (featurep): Load ls-lisp on Android. - * lisp/ls-lisp.el (ls-lisp-use-insert-directory-program): - Default to off on Android. + + * lisp/ls-lisp.el (ls-lisp-use-insert-directory-program): Default + to off on Android. + * src/android.c (android_is_directory): New fucntion. (android_fstatat): Handle directories created by `android_opendir'. @@ -5871,6 +5609,7 @@ (android_lookup_asset_directory_fd): New function. * src/android.h: Update prototypes. + * src/androidfont.c (androidfont_check_init): New function. (androidfont_list, androidfont_match, androidfont_draw) (androidfont_open_font, androidfont_close_font) @@ -5894,75 +5633,81 @@ * src/sfntfont-android.c (GET_SCANLINE_BUFFER) (sfntfont_android_u255to256, sfntfont_android_over_8888_1) (sfntfont_android_over_8888, sfntfont_android_composite_bitmap): - Optimize on 64-bit ARM devices. - (sfntfont_android_put_glyphs): Optimize away memset if - background need not be filled. + Optimize for 64-bit ARM devices. + (sfntfont_android_put_glyphs): Optimize away memset if background + need not be filled. 2023-01-20 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Update Android port * src/android.c (android_run_select_thread, android_select) (android_ftruncate): - * src/android.h (ftruncate): Fix compilation on Android 16 and - up. + * src/android.h (ftruncate): Fix compilation on Android 16 and up. - Update Android port * src/android.c (android_run_select_thread, android_init_events) (android_select): Add alternative android_select implementation for API 16 and lower. + * src/androidterm.c (handle_one_android_event): Fix use-after-frees. - Remove unused file * xcompile/lib/gnulib.mk.in: Delete. 2023-01-20 Po Lu - Update Android port * .gitignore: Don't ignore verbose.mk.android. + * doc/emacs/Makefile.in (EMACSSOURCES): Add android.texi and input.texi. + * doc/emacs/android.texi (Android): Document support for the on-screen keyboard. - (Android Startup): Document how to start Emacs with -Q on - Android. - (Android Environment): Document how Emacs works around the - system ``task killer''. Document changes to frame deletion - behavior. + (Android Startup): Document how to start Emacs with -Q on Android. + (Android Environment): Document how Emacs circumvents the system + ``task killer''. Document changes to frame deletion behavior. + * doc/emacs/emacs.texi (Top): - * doc/emacs/input.texi (Other Input Devices, On-Screen - Keyboards): Document how to use Emacs with virtual keyboards. - * doc/lispref/commands.texi (Touchscreen Events): Document - changes to `touch-screen-track-drag'. - * doc/lispref/frames.texi (Frames, On-Screen Keyboards): New - node. + * doc/emacs/input.texi (Other Input Devices) + (On-Screen Keyboards): Document how to use Emacs with virtual + keyboards. + + * doc/lispref/commands.texi (Touchscreen Events): Document changes + to `touch-screen-track-drag'. + + * doc/lispref/frames.texi (Frames, On-Screen Keyboards): New node. + * java/AndroidManifest.xml.in: Add settings activity and appropriate OSK adjustment mode. - * java/org/gnu/emacs/EmacsActivity.java (onCreate): Allow - creating Emacs with -Q. + + * java/org/gnu/emacs/EmacsActivity.java (onCreate): Allow creating + Emacs with -Q. (onDestroy): Don't remove if killed by the system. - * java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems): - Fix context menus again. + + * java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems): Fix + context menus again. + * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Make all event sending functions return long. - * java/org/gnu/emacs/EmacsPreferencesActivity.java - (EmacsPreferencesActivity): New class. + + * java/org/gnu/emacs/EmacsPreferencesActivity.java: New fle. + * java/org/gnu/emacs/EmacsService.java (EmacsService) (onStartCommand, onCreate, startEmacsService): Start as a foreground service if necessary to bypass system restrictions. + * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView): - * java/org/gnu/emacs/EmacsThread.java (EmacsThread, run): - * java/org/gnu/emacs/EmacsView.java (EmacsView, onLayout) + * java/org/gnu/emacs/EmacsThread.java (run): + * java/org/gnu/emacs/EmacsView.java (onLayout) (onDetachedFromWindow): - * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, viewLayout): - Implement frame resize synchronization.. + * java/org/gnu/emacs/EmacsWindow.java (viewLayout): + Implement frame resize synchronization. + * java/org/gnu/emacs/EmacsWindowAttachmentManager.java - (EmacsWindowAttachmentManager, removeWindowConsumer): Adjust - accordingly for changes to frame deletion behavior. + (removeWindowConsumer): Adjust accordingly for changes to frame + deletion behavior. + * lisp/frame.el (android-toggle-on-screen-keyboard) - (frame-toggle-on-screen-keyboard): New function. + (frame-toggle-on-screen-keyboard): New functions. + * lisp/minibuffer.el (minibuffer-setup-on-screen-keyboard) (minibuffer-exit-on-screen-keyboard): New functions. (minibuffer-setup-hook, minibuffer-exit-hook): Add new functions @@ -5976,13 +5721,16 @@ (touch-screen-drag-mode-line-1, touch-screen-drag-mode-line): Refactor to use `no-drag'. - * src/android.c (struct android_emacs_window): New methods. - Make all event sending functions return the event serial. + * src/android.c (struct android_emacs_window): New methods. Make + all event sending functions return the event serial. (android_toggle_on_screen_keyboard, android_window_updated): New functions. + * src/android.h: Update prototypes. + * src/androidfns.c (Fandroid_toggle_on_screen_keyboard) - (syms_of_androidfns): New function. + (syms_of_androidfns): New functions. + * src/androidgui.h (struct android_any_event) (struct android_key_event, struct android_configure_event) (struct android_focus_event, struct android_window_action_event) @@ -5993,27 +5741,24 @@ * src/androidterm.c (handle_one_android_event) (android_frame_up_to_date): + * src/androidterm.h (struct android_output): Implement frame resize synchronization. -2023-01-20 Po Lu - - Check in missing file * xcompile/verbose.mk.android: New file. 2023-01-19 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android + * .gitignore: Add new files. -2023-01-19 Po Lu + * INSTALL.android: Explain how to build Emacs for ancient versions + of Android. - Update Android port - * .gitignore: Add new files. - * INSTALL.android: Explain how to build Emacs for ancient - versions of Android. * admin/merge-gnulib (GNULIB_MODULES): Add getdelim. + * build-aux/config.guess (timestamp, version): * build-aux/config.sub (timestamp, version): Autoupdate. + * configure.ac (BUILD_DETAILS, ANDROID_MIN_SDK): (ANDROID_STUBIFY): Allow specifying CFLAGS via ANDROID_CFLAGS. Add new configure tests for Android API version when not @@ -6023,14 +5768,21 @@ Input Devices''. (Android File System): Remove restrictions on directory-files on the assets directory. + * doc/emacs/emacs.texi (Top): Add Other Input Devices to menu. + * doc/emacs/input.texi (Other Input Devices): New node. + * doc/lispref/commands.texi (Touchscreen Events): Document changes to touchscreen input events. + * doc/lispref/frames.texi (Pop-Up Menus): Likewise. + * etc/NEWS: Announce changes. + * java/Makefile.in: Use lib-src/asset-directory-tool to generate an `directory-tree' file placed in /assets. + * java/debug.sh: Large adjustments to support Android 2.2 and later. @@ -6042,11 +5794,11 @@ * java/org/gnu/emacs/EmacsDrawable.java (EmacsDrawable): * java/org/gnu/emacs/EmacsFillPolygon.java (perform): * java/org/gnu/emacs/EmacsFillRectangle.java (perform): - * java/org/gnu/emacs/EmacsGC.java (EmacsGC): - * java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): - (destroyHandle): + * java/org/gnu/emacs/EmacsGC.java: + * java/org/gnu/emacs/EmacsPixmap.java (destroyHandle): * java/org/gnu/emacs/EmacsSdk7FontDriver.java (draw): Avoid redundant canvas saves and restores. + * java/org/gnu/emacs/EmacsService.java (run): * java/org/gnu/emacs/EmacsView.java (EmacsView): (handleDirtyBitmap): @@ -6054,33 +5806,32 @@ (EmacsWindow): Make compatible with Android 2.2 and later. * lib-src/Makefile.in (DONT_INSTALL): Add asset-directory-tool - on Android.:(asset-directory-tool{EXEEXT}): New target. + on Android. + (asset-directory-tool${EXEEXT}): New target. + * lib-src/asset-directory-tool.c (struct directory_tree, xmalloc) (main_1, main_2, main): New file. * lib, m4: Merge from gnulib. This will be reverted before merging to master. - * lisp/button.el (button-map): - (push-button): + * lisp/button.el (button-map, push-button): * lisp/frame.el (display-popup-menus-p): Improve touchscreen support. - * lisp/subr.el (event-start): - (event-end): Handle touchscreen events. - * lisp/touch-screen.el (touch-screen-handle-timeout): - (touch-screen-handle-point-update): - (touch-screen-handle-point-up): - (touch-screen-track-tap): - (touch-screen-track-drag): - (touch-screen-drag-mode-line-1): - (touch-screen-drag-mode-line): New functions. - ([mode-line touchscreen-begin]): + + * lisp/subr.el (event-start, event-end): Handle touchscreen + events. + + * lisp/touch-screen.el (touch-screen-handle-timeout) + (touch-screen-handle-point-update, touch-screen-handle-point-up) + (touch-screen-track-tap, touch-screen-track-drag) + (touch-screen-drag-mode-line-1, touch-screen-drag-mode-line): New + function + ([mode-line touchscreen-begin]) ([bottom-divider touchscreen-begin]): Bind new events. - * lisp/wid-edit.el (widget-event-point): - (widget-keymap): - (widget-event-start): - (widget-button--check-and-call-button): + * lisp/wid-edit.el (widget-event-point, widget-keymap) + (widget-event-start, widget-button--check-and-call-button) (widget-button-click): Improve touchscreen support. * src/alloc.c (make_lisp_symbol): Avoid ICE on Android NDK GCC. @@ -6102,18 +5853,25 @@ (android_opendir, android_readdir, android_closedir): Likewise. (android_four_corners_bilinear): Fix coding style. (android_ftruncate): New function. + * src/android.h: Update prototypes. Replace ftruncate with android_ftruncate when necessary. * src/androidterm.c (handle_one_android_event): Pacify GCC. Fix touch screen tool bar bug. + * src/emacs.c (using_utf8): Fix compilation error. + * src/fileio.c (Ffile_system_info): Return Qnil when fsusage.o is not built. + * src/filelock.c (BOOT_TIME_FILE): Fix definition for Android. + * src/frame.c (Fx_parse_geometry): Fix uninitialized variable uses. + * src/keyboard.c (lispy_function_keys): Fix `back'. + * src/menu.c (x_popup_menu_1): Handle touch screen events. (Fx_popup_menu): Document changes. @@ -6123,8 +5881,9 @@ minor problem. (init_sfntfont_android): Check for HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL. - * src/sfntfont.c (struct sfnt_font_desc): New fields `adstyle' - and `languages'. + + * src/sfntfont.c (struct sfnt_font_desc): New fields `adstyle' and + `languages'. (sfnt_parse_style): Append tokens to adstyle. (sfnt_parse_languages): New function. (sfnt_enum_font_1): Parse supported languages and adstyle. @@ -6134,28 +5893,31 @@ 2023-01-17 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - -2023-01-17 Po Lu + * doc/emacs/android.texi (Android Fonts): Document that TTC format + fonts are now supported. - Update Android port - * doc/emacs/android.texi (Android Fonts): Document that TTC - format fonts are now supported. * doc/emacs/emacs.texi (Top): Fix menus. + * doc/lispref/commands.texi (Touchscreen Events) (Key Sequence Input): Document changes to touchscreen events. + * etc/DEBUG: Describe how to debug 64 bit binaries on Android. * java/org/gnu/emacs/EmacsCopyArea.java (perform): Explicitly recycle copy bitmap. + * java/org/gnu/emacs/EmacsDialog.java (EmacsDialog): New class. + * java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Use 5 - point PolyLine like X, because Android behaves like Postscript - on some devices and X elsewhere. - * java/org/gnu/emacs/EmacsFillRectangle.java (perform): - Explicitly recycle copy bitmap. - * java/org/gnu/emacs/EmacsPixmap.java (destroyHandle): - Explicitly recycle bitmap and GC if it is big. + point PolyLine like X, because Android behaves like Postscript on + some devices and X elsewhere. + + * java/org/gnu/emacs/EmacsFillRectangle.java (perform): Explicitly + recycle copy bitmap. + + * java/org/gnu/emacs/EmacsPixmap.java (destroyHandle): Explicitly + recycle bitmap and GC if it is big. + * java/org/gnu/emacs/EmacsView.java (EmacsView): Make `bitmapDirty' a boolean. (handleDirtyBitmap): Reimplement in terms of that boolean. @@ -6169,11 +5931,13 @@ * src/android.c (android_run_select_thread, android_select): Really fix android_select. (android_build_jstring): New function. + * src/android.h: Update prototypes. + * src/androidmenu.c (android_process_events_for_menu): Totally unblock input before process_pending_signals. - (android_menu_show): Remove redundant unblock_input and - debugging code. + (android_menu_show): Remove redundant unblock_input and debugging + code. (struct android_emacs_dialog, android_init_emacs_dialog) (android_dialog_show, android_popup_dialog, init_androidmenu): Implement popup dialogs on Android. @@ -6183,70 +5947,75 @@ tapping tool bar items. (android_create_terminal): Add dialog hook. (android_wait_for_event): Adjust call to android_select. + * src/androidterm.h (struct android_touch_point): New field `tool_bar_p'. + * src/keyboard.c (read_key_sequence, head_table) (syms_of_keyboard): Prefix touchscreen events with posn. + * src/keyboard.h (EVENT_HEAD): Handle touchscreen events. + * src/process.c (wait_reading_process_output): Adjust call to android_select. - * src/sfnt.c (sfnt_read_table_directory): If the first long - turns out to be ttcf, return -1. + + * src/sfnt.c (sfnt_read_table_directory): If the first long turns + out to be ttcf, return -1. (sfnt_read_ttc_header): New function. (main): Test TTC support. * src/sfnt.h (struct sfnt_ttc_header): New structure. (enum sfnt_ttc_tag): New enum. - * src/sfntfont-android.c (struct - sfntfont_android_scanline_buffer): New structure. + * src/sfntfont-android.c + (struct sfntfont_android_scanline_buffer): New structure. (GET_SCANLINE_BUFFER): New macro. Try to avoid so much malloc upon accessing the scanline buffer. - (sfntfont_android_put_glyphs): Do not use SAFE_ALLOCA to - allocate the scaline buffer. + (sfntfont_android_put_glyphs): Do not use SAFE_ALLOCA to allocate + the scaline buffer. (Fandroid_enumerate_fonts): Enumerate ttc fonts too. * src/sfntfont.c (struct sfnt_font_desc): New field `offset'. (sfnt_enum_font_1): Split out enumeration code from sfnt_enum_font. - (sfnt_enum_font): Read TTC tables and enumerate each font - therein. + (sfnt_enum_font): Read TTC tables and enumerate each font therein. (sfntfont_open): Seek to the offset specified. * xcompile/Makefile.in (maintainer-clean): Fix depends here. 2023-01-16 Po Lu - Fix display of glyphs with word-sized component offsets on Android - * src/sfnt.c (sfnt_decompose_compound_glyph): Handle correctly + * src/sfnt.c (sfnt_decompose_compound_glyph): Correct treatment of the Y offset in components with ARG_1_AND_2_ARE_WORDS. (main): Update debugging code. - Merge remote-tracking branch 'origin/master' into feature/android - -2023-01-16 Po Lu - - Update Android port * doc/emacs/android.texi (Android, Android Environment): Improve documentation. - * doc/lispref/commands.texi (Touchscreen Events): Document - changes to touchscreen support. + + * doc/lispref/commands.texi (Touchscreen Events): Document changes + to touchscreen support. + * doc/lispref/display.texi (Defining Faces, Window Systems): - * doc/lispref/frames.texi (Frame Layout, Font and Color - Parameters): + * doc/lispref/frames.texi (Frame Layout) + (Font and Color Parameters): * doc/lispref/os.texi (System Environment): Document Android in various places. * java/org/gnu/emacs/EmacsWindow.java (figureChange): Fix crash. - * lisp/loadup.el: ("touch-screen"): Load touch-screen.el. + + * lisp/loadup.el ("touch-screen"): Load touch-screen.el. + * lisp/pixel-scroll.el: Autoload two functions. + * lisp/term/android-win.el: Add require 'touch-screen. + * lisp/touch-screen.el (touch-screen-current-tool) (touch-screen-current-timer, touch-screen-delay) (touch-screen-relative-xy, touch-screen-handle-scroll) (touch-screen-handle-timeout, touch-screen-handle-point-update) (touch-screen-handle-point-up, touch-screen-handle-touch) (global-map, touch-screen): New file. + * src/android.c (android_run_debug_thread): Fix build on 64 bit systems. (JNICALL, android_put_pixel): Likewise. @@ -6254,12 +6023,16 @@ (android_fetch_pixel_bilinear, android_project_image_bilinear) (android_fetch_pixel_nearest_24, android_fetch_pixel_nearest_1) (android_project_image_nearest): New functions. + * src/androidgui.h (struct android_transform): New structure. - * src/androidterm.c (android_note_mouse_movement): Remove - obsolete TODO. + + * src/androidterm.c (android_note_mouse_movement): Remove obsolete + TODO. (android_get_scale_factor): New function. (android_draw_underwave): Scale underwave correctly. + * src/dispextern.h: Support native image transforms on Android. + * src/image.c (matrix_identity, matrix_rotate) (matrix_mirror_horizontal, matrix_translate): New functions. (image_set_transform): Implement native image transforms on @@ -6267,64 +6040,77 @@ (Fimage_transforms_p): Implement on Android. * src/keyboard.c (make_lispy_event, syms_of_keyboard): Handle - touch screen- menu bar events. + touch screen menu bar events. + * src/sfnt.c: Fix typo in comment. + * src/sfntfont-android.c (sfntfont_android_blend, U255TO256) - (sfntfont_android_put_glyphs): Avoid redundant swizzling. + (sfntfont_android_put_glyphs): Prevent redundant swizzling. + * src/sfntfont.c (sfntfont_lookup_char): Fix build on 64 bit systems. 2023-01-15 Po Lu - Implement submenus on Android * java/org/gnu/emacs/EmacsActivity.java (onCreate): Set the default theme to Theme.DeviceDefault.NoActionBar if possible. (onContextMenuClosed): Add hack for Android bug. + * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu) (onMenuItemClick): Set flag upon submenu selection. (inflateMenuItems): Set onClickListener for submenus as well. (display1): Clear new flag. + * java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Fix rectangle bounds. - * java/org/gnu/emacs/EmacsNative.java (EmacsNative): + + * java/org/gnu/emacs/EmacsNative.java (setEmacsParams): New + argument for the cache directory. + * java/org/gnu/emacs/EmacsService.java (onCreate): Pass cache directory. (sync): New function. - * src/android.c (struct android_emacs_service): New method - `sync'. + + * src/android.c (struct android_emacs_service): New method `sync'. (setEmacsParams, initEmacs): Handle cache directory. (android_init_emacs_service): Initialize new method `sync'. (android_sync): New function. + * src/androidfns.c (Fx_show_tip): Call both functions. + * src/androidgui.h: Update prototypes. + * src/androidmenu.c (struct android_menu_subprefix) (android_free_subprefixes, android_menu_show): Handle submenu prefixes correctly. + * src/androidterm.c (handle_one_android_event): Clear help echo on MotionNotify like on X. - * src/menu.c (single_menu_item): Enable submenus on Android. - Merge remote-tracking branch 'origin/master' into feature/android + * src/menu.c (single_menu_item): Enable submenus on Android. 2023-01-15 Po Lu - Implement toolkit menus on Android * java/org/gnu/emacs/EmacsActivity.java (onContextMenuClosed): New function. - * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu): - New field `itemAlreadySelected'. + + * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu): New + field `itemAlreadySelected'. (onMenuItemClick): New function. (inflateMenuItems): Attach onClickListener as appropriate. (display1): Clear itemAlreadySelected. (display): Fix runnable synchronization. + * java/org/gnu/emacs/EmacsNative.java (sendContextMenu): New function. + * java/org/gnu/emacs/EmacsView.java (popupMenu): (cancelPopupMenu): Set popupactive correctly. * src/android.c (android_run_select_thread): Fix android_select again. (android_wait_event): New function. + * src/android.h: Update prototypes. * src/androidgui.h (enum android_event_type): New `ANDROID_CONTEXT_MENU' event. @@ -6343,54 +6129,55 @@ * src/androidterm.c (handle_one_android_event): Handle context menu events. + * src/androidterm.h (struct android_display_info): New field for menu item ID. + * src/emacs.c (android_emacs_init): Call syms_of_androidmenu. - * src/xdisp.c (note_mouse_highlight): Return if popup_activated - on Android as well. + + * src/xdisp.c (note_mouse_highlight): Return if popup_activated on + Android as well. 2023-01-14 Po Lu - Fix android_select * src/android.c (android_run_select_thread, android_select): Handle EINTR in sem_wait and fix sigsets. - Add temporary gnulib patch * xcompile/lib/fpending.c (__fpending): Fix gnulib problem. - Drop unneeded changes to gnulib * xcompile/lib/fpending.c (__fpending): * xcompile/lib/open.c: * xcompile/lib/unistd.c (_GL_UNISTD_INLINE): Remove Android patches. - Merge remote-tracking branch 'origin/master' into feature/android - 2023-01-14 Po Lu - Update Android port - * java/Makefile.in (clean): Fix distclean and bootstrap-clean rules. - * java/debug.sh (jdb_port): - (attach_existing): - (num_pids): - (line): Add new options to upload a gdbserver binary to the device. + * java/Makefile.in (clean): Fix distclean and bootstrap-clean + rules. + * java/debug.sh (jdb_port, attach_existing, num_pids, line): Add + new options to upload a gdbserver binary to the device. * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): Make focusedActivities public. - * java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu): - New class. + + * java/org/gnu/emacs/EmacsContextMenu.java: New file. + * java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Fix bounds computation. - * java/org/gnu/emacs/EmacsGC.java (markDirty): Set stroke width - explicitly. - * java/org/gnu/emacs/EmacsService.java (EmacsService) - (getLocationOnScreen, nameKeysym): New functions. - * java/org/gnu/emacs/EmacsView.java (EmacsView): Disable focus + + * java/org/gnu/emacs/EmacsGC.java (markDirty): Expressly provide + stroke width. + + * java/org/gnu/emacs/EmacsService.java (getLocationOnScreen) + (nameKeysym): New functions. + + * java/org/gnu/emacs/EmacsView.java (): Disable focus highlight. - (onCreateContextMenu, popupMenu, cancelPopupMenu): New - functions. - * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Implement a - kind of ``override redirect'' window for tooltips. + (onCreateContextMenu, popupMenu, cancelPopupMenu): New functions. + + * java/org/gnu/emacs/EmacsWindow.java: Implement a kind of + ``override redirect'' window for tooltips. + * src/android.c (struct android_emacs_service): New method `name_keysym'. (android_run_select_thread, android_init_events): @@ -6401,6 +6188,7 @@ (android_move_resize_window, android_map_raised) (android_translate_coordinates, android_get_keysym_name) (android_build_string, android_exception_check): New functions. + * src/android.h: Update prototypes. * src/androidfns.c (android_set_parent_frame, Fx_create_frame) @@ -6434,42 +6222,46 @@ 2023-01-14 Po Lu - Improve reliability of Android build system * .gitignore: Add new files. + * INSTALL.android: New file. + * Makefile.in (clean_dirs): Clean xcompile as well. - * admin/merge-gnulib (avoided_flags): Import gnulib into Android + + * admin/merge-gnulib (avoided_flags): Import Gnulib into Android directory as well. + * doc/emacs/android.texi (Android): * doc/emacs/emacs.texi (Top): New node `Android'. - * java/org/gnu/emacs/EmacsThread.java (run): Use right - executable name. + + * java/org/gnu/emacs/EmacsThread.java (run): Use right executable + name. + * lib/Makefile.in (ANDROID_CFLAGS): Use better way to refer to /src. (vpath): Delete ugly block of vpath statements. (mostlyclean): Remove Makefile.android. + * lib/fpending.c (__fpending): * lib/open.c: * lib/unistd.c (_GL_UNISTD_INLINE): Revert changes to gnulib in lib/. + * src/android.h: * src/androidterm.c: Fix build. - * xcompile/Makefile.in (LIB_SRCDIR): - (LIBSRC_BINARIES, src/verbose.mk): - (PRE_BUILD_DEPS, PHONY): Use gnulib in xcompile/lib/ as opposed - to lib/. + * xcompile/Makefile.in (LIB_SRCDIR, LIBSRC_BINARIES) + (src/verbose.mk, PRE_BUILD_DEPS, PHONY): Use gnulib in + xcompile/lib/ as opposed to lib/. + * xcompile/README: Adjust README. - Check in gnulib with Android patches - * xcompile/lib: Check-in gnulib with patches for Android. + * xcompile/lib: Check-in Gnulib with patches for Android. 2023-01-13 Po Lu - Merge remote-tracking branch 'origin/master' into feature/android - - Fix crashes in Android port * java/org/gnu/emacs/EmacsService.java (queryTree): Fix NULL pointer dereference. + * src/android.c (android_query_tree): Set *nchildren_return. * .gitignore: Add AndroidManifest.xml. @@ -6478,9 +6270,6 @@ * src/frame.c (make_monitor_attribute_list): Allow source to be NULL. -2023-01-13 Po Lu - - Update Android port * configure.ac (ANDROID_MIN_SDK): New variable. (DX): Remove and replace with D8. (XCONFIGURE): Check for the minimum version of Android the cross @@ -6493,34 +6282,36 @@ * java/Makefile.in (top_srcdir, version): New variables. (DX, D8): Replace with D8. (ANDROID_MIN_SDK, APK_NAME): New variables. - (.PHONY): - (.PRECIOUS): - (classes.dex): - (emacs.apk): Generate $(APK_NAME) instead of `emacs.apk'. + (.PHONY, .PRECIOUS, classes.dex, emacs.apk): Generate $(APK_NAME) + rather than `emacs.apk'. * java/debug.sh: New option --attach-existing. Attach to an existing Emacs instance when specified. - * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New - field `isPaused'. + * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): New field + `isPaused'. (invalidateFocus1): Fix infinite recursion. (detachWindow): Deiconify window. (attachWindow): Iconify the window if the activity is paused. (onCreate): Use the ``no title bar'' theme. (onPause, onResume): New functions. + * java/org/gnu/emacs/EmacsNative.java (sendTouchUp, sendTouchDown) (sendTouchMove, sendWheel, sendIconified, sendDeiconified): New functions. + * java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7Typeface): (list): Remove logging for code that is mostly going to be unused. + * java/org/gnu/emacs/EmacsService.java (ringBell, queryTree) (getScreenWidth, getScreenHeight, detectMouse): New functions. + * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView) (surfaceChanged, surfaceCreated, surfaceDestroyed): Add extra debug logging. Avoid deadlock in surfaceCreated. - * java/org/gnu/emacs/EmacsView.java (EmacsView): Try very hard - to make the SurfaceView respect Z order. It didn't work. + * java/org/gnu/emacs/EmacsView.java (EmacsView): Try very hard to + make the SurfaceView respect Z order. It didn't work. (handleDirtyBitmap): Copy over the contents from the old bitmap. (explicitlyDirtyBitmap): New function. (onLayout): Don't dirty bitmap if unnecessary. @@ -6542,6 +6333,7 @@ (reparentTo, makeInputFocus, raise, lower, getWindowGeometry) (noticeIconified, noticeDeiconified, setDontAcceptFocus) (setDontFocusOnMap, getDontFocusOnMap): New functions. + * java/org/gnu/emacs/EmacsWindowAttachmentManager.java (registerWindow, detachWindow): Synchronize. (noticeIconified, noticeDeiconified): New functions. @@ -6552,10 +6344,9 @@ (frame-list-z-order, frame-restack, display-mouse-p) (display-monitor-attributes-list): Implement on Android. - * lisp/mwheel.el (mouse-wheel-down-event): - (mouse-wheel-up-event): - (mouse-wheel-left-event): - (mouse-wheel-right-event): Define on Android. + * lisp/mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event) + (mouse-wheel-left-event, mouse-wheel-right-event): Define on + Android. * src/android.c (struct android_emacs_service): New methods `ringBell', `queryTree', `getScreenWidth', `getScreenHeight', @@ -6570,7 +6361,8 @@ (android_bell, android_set_input_focus, android_raise_window) (android_lower_window, android_query_tree, android_get_geometry) (android_get_screen_width, android_get_screen_height) - (android_get_mm_width, android_get_mm_height, android_detect_mouse) + (android_get_mm_width, android_get_mm_height) + (android_detect_mouse) (android_set_dont_focus_on_map, android_set_dont_accept_focus): New functions. (struct android_dir): New structure. @@ -6611,8 +6403,8 @@ handlers. (syms_of_androidfns): Update appropriately. - * src/androidfont.c (androidfont_draw): Use - FRAME_ANDROID_DRAWABLE instead of FRAME_ANDROID_WINDOW. + * src/androidfont.c (androidfont_draw): Use FRAME_ANDROID_DRAWABLE + instead of FRAME_ANDROID_WINDOW. * src/androidgui.h (enum android_event_type): New events. (struct android_touch_event, struct android_wheel_event) @@ -6622,10 +6414,10 @@ * src/androidterm.c (android_clear_frame): Use FRAME_ANDROID_DRAWABLE instead of FRAME_ANDROID_WINDOW. (android_flash, android_ring_bell): Implement bell ringing. - (android_toggle_invisible_pointer): Don't TODO function that - can't be implemented. - (show_back_buffer, android_flush_dirty_back_buffer_on): Check if - a buffer flip is required before doing the flip. + (android_toggle_invisible_pointer): Don't TODO function that can't + be implemented. + (show_back_buffer, android_flush_dirty_back_buffer_on): Check if a + buffer flip is required before doing the flip. (android_lower_frame, android_raise_frame): Implement functions. (android_update_tools, android_find_tool): New functions. (handle_one_android_event): Handle new iconification, wheel and @@ -6652,8 +6444,8 @@ (android_draw_glyph_string, android_clear_frame_area) (android_clear_under_internal_border, android_draw_hollow_cursor) (android_draw_bar_cursor, android_draw_vertical_window_border) - (android_draw_window_divider): Use FRAME_ANDROID_DRAWABLE - instead of FRAME_ANDROID_WINDOW for drawing operations. + (android_draw_window_divider): Use FRAME_ANDROID_DRAWABLE instead + of FRAME_ANDROID_WINDOW for drawing operations. * src/androidterm.h (struct android_touch_point): New structure. (struct android_output): New fields. @@ -6661,9 +6453,8 @@ * src/dired.c (emacs_readdir, open_directory) (directory_files_internal_unwind, read_dirent) - (directory_files_internal, file_name_completion): Add - indirection over readdir and opendir. Use android variants on - Android. + (directory_files_internal, file_name_completion): Add indirection + over readdir and opendir. Use android variants on Android. * src/dispnew.c (Fopen_termscript): * src/fileio.c (fclose_unwind): Use emacs_fclose. @@ -6671,8 +6462,9 @@ (file_accessible_directory_p): Append right suffix to Android assets directory. (do_auto_save_unwind): Use emacs_fclose. - * src/keyboard.c (lispy_function_keys): Use right function key - for page up and page down. + + * src/keyboard.c (lispy_function_keys): Use right function key for + page up and page down. (Fopen_dribble_file): Use emacs_fclose. * src/lisp.h: New prototype emacs_fclose. @@ -6682,34 +6474,29 @@ * src/sfnt.c (sfnt_curve_is_flat): Fix area-squared computation. (sfnt_prepare_raster): Compute raster width and height consistently with outline building. - (sfnt_build_outline_edges): Use the same offsets used to set - offy and offx. + (sfnt_build_outline_edges): Use the same offsets used to set offy + and offx. (main): Adjust debug code. * src/sfntfont-android.c (sfntfont_android_saturate32): Delete function. (sfntfont_android_blend, sfntfont_android_blendrgb): Remove unnecessary debug code. - (sfntfont_android_composite_bitmap): Prevent out of bounds - write. + (sfntfont_android_composite_bitmap): Prevent out of bounds write. (sfntfont_android_put_glyphs): Use FRAME_ANDROID_DRAWABLE. (init_sfntfont_android): Initialize Monospace Serif font to something sensible. + * src/sfntfont.c (sfntfont_text_extents): Clear glyph metrics before summing up pcm. (sfntfont_draw): Use s->font instead of s->face->font. * src/sysdep.c (emacs_fclose): Wrap around android_fclose on - android. + Android. - * src/term.c (Fsuspend_tty): - (delete_tty): Use emacs_fclose. + * src/term.c (Fsuspend_tty, delete_tty): Use emacs_fclose. * src/verbose.mk.in (AM_V_DX): Replace with D8 version. -2023-01-11 Po Lu - - Merge remote-tracking branch 'origin/master' into feature/android - 2023-01-11 Po Lu Bring up the sfnt-android font driver commit 24886a2cc4814612ede558d82858a001ba6e8308 Author: Po Lu Date: Wed Aug 16 11:12:44 2023 +0800 Remove get_boot_time from msdos.c * src/msdos.c (get_boot_time): That all of the actual locking in filelock.c is under #ifndef MSDOS escaped my notice. Remove this unused function. diff --git a/src/msdos.c b/src/msdos.c index 20af5353e70..1b7f2d4ae21 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -4286,12 +4286,6 @@ init_gettimeofday (void) } #endif -int -get_boot_time (struct timespec *p_boot_time) -{ - return -1; -} - static void msdos_abort (void) { commit 6dacf5bce4e55f216561c3f38561b5479f8ba640 Author: Po Lu Date: Wed Aug 16 11:02:55 2023 +0800 Fix display of compound glyphs that employ simple transforms * src/sfnt.c (sfnt_transform_coordinates): Always compute an affine transform matrix except if no scale is provided at all. Unconditionally apply x_off and y_off. (sfnt_decompose_compound_glyph): Delete arguments OF_X and OFF_Y. Apply component offsets after writing simple glyph contours. (sfnt_decompose_glyph): Modify for new calling convention. (sfnt_transform_f26dot6): Modify analogously to sfnt_decompose_compound_glyph. Also correct anchor offset computation to scale the unscaled component anchor coordinates by the interpreter scale. (sfnt_interpret_compound_glyph_1): Also modify for new calling convention. * src/sfnt.h (struct sfnt_compound_glyph_component): : Make scale fields signed. diff --git a/src/sfnt.c b/src/sfnt.c index 71e7ecfde47..5cea2613ddb 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -2442,11 +2442,7 @@ sfnt_free_glyph (struct sfnt_glyph *glyph) the array of points of length NUM_COORDINATES given as X and Y. Also, apply the fixed point offsets X_OFF and Y_OFF to each X and Y - coordinate. - - See sfnt_decompose_compound_glyph for an explanation of why offsets - might be applied here, and not while reading the subglyph - itself. */ + coordinate after transforms within COMPONENT are effected. */ static void sfnt_transform_coordinates (struct sfnt_compound_glyph_component *component, @@ -2460,56 +2456,59 @@ sfnt_transform_coordinates (struct sfnt_compound_glyph_component *component, if (component->flags & 010) /* WE_HAVE_A_SCALE */ { - for (i = 0; i < num_coordinates; ++i) - { - x[i] *= component->u.scale / 16384.0; - y[i] *= component->u.scale / 16384.0; - x[i] += x_off; - y[i] += y_off; - } + m1 = component->u.scale / 16384.0; + m2 = m3 = m4 = 0; + m5 = component->u.scale / 16384.0; + m6 = 0; } else if (component->flags & 0100) /* WE_HAVE_AN_X_AND_Y_SCALE */ { - for (i = 0; i < num_coordinates; ++i) - { - x[i] *= component->u.a.xscale / 16384.0; - y[i] *= component->u.a.yscale / 16384.0; - x[i] += x_off; - y[i] += y_off; - } + m1 = component->u.a.xscale / 16384.0; + m2 = m3 = m4 = 0; + m5 = component->u.a.yscale / 16384.0; + m6 = 0; } else if (component->flags & 0200) /* WE_HAVE_A_TWO_BY_TWO */ { - /* Apply the specified affine transformation. - A transform looks like: - - M1 M2 M3 X - M4 M5 M6 * Y - - = - - M1*X + M2*Y + M3*1 = X1 - M4*X + M5*Y + M6*1 = Y1 - - (In most transforms, there is another row at the bottom for - mathematical reasons. Since Z1 is always 1.0, the row is - simply implied to be 0 0 1, because 0 * x + 0 * y + 1 * 1 = - 1.0. See the definition of matrix3x3 in image.c for some - more explanations about this.) */ m1 = component->u.b.xscale / 16384.0; m2 = component->u.b.scale01 / 16384.0; m3 = 0; m4 = component->u.b.scale10 / 16384.0; m5 = component->u.b.yscale / 16384.0; m6 = 0; - + } + else /* No scale, just apply x_off and y_off. */ + { for (i = 0; i < num_coordinates; ++i) - { - x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; - y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; - x[i] += x_off; - y[i] += y_off; - } + x[i] += x_off, y[i] += y_off; + + return; + } + + m3 = x_off; + m6 = y_off; + + /* Apply the specified affine transformation. + A transform looks like: + + M1 M2 M3 X + M4 M5 M6 * Y + + = + + M1*X + M2*Y + M3*1 = X1 + M4*X + M5*Y + M6*1 = Y1 + + (In most transforms, there is another row at the bottom for + mathematical reasons. Since Z1 is always 1.0, the row is simply + implied to be 0 0 1, because 0 * x + 0 * y + 1 * 1 = 1.0. See + the definition of matrix3x3 in image.c for some more explanations + about this.) */ + + for (i = 0; i < num_coordinates; ++i) + { + x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; + y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; } } @@ -2629,10 +2628,9 @@ sfnt_round_fixed (int32_t number) /* Decompose GLYPH, a compound glyph, into an array of points and contours. - CONTEXT should be zeroed and put on the stack. OFF_X and OFF_Y - should be zero, as should RECURSION_COUNT. GET_GLYPH and - FREE_GLYPH, along with DCONTEXT, mean the same as in - sfnt_decompose_glyph. + CONTEXT should be zeroed and put on the stack. RECURSION_COUNT + should be initialized to 0. GET_GLYPH and FREE_GLYPH, along with + DCONTEXT, mean the same as in sfnt_decompose_glyph. Value is 1 upon failure, else 0. */ @@ -2641,7 +2639,6 @@ sfnt_decompose_compound_glyph (struct sfnt_glyph *glyph, struct sfnt_compound_glyph_context *context, sfnt_get_glyph_proc get_glyph, sfnt_free_glyph_proc free_glyph, - sfnt_fixed off_x, sfnt_fixed off_y, int recursion_count, void *dcontext) { @@ -2822,16 +2819,14 @@ sfnt_decompose_compound_glyph (struct sfnt_glyph *glyph, for (i = 0; i <= last_point; ++i) { - x_base[i] = ((subglyph->simple->x_coordinates[i] * 65536) - + off_x + x); - y_base[i] = ((subglyph->simple->y_coordinates[i] * 65536) - + off_y + y); + x_base[i] = (subglyph->simple->x_coordinates[i] * 65536); + y_base[i] = (subglyph->simple->y_coordinates[i] * 65536); flags_base[i] = subglyph->simple->flags[i]; } /* Apply the transform to the points. */ sfnt_transform_coordinates (component, x_base, y_base, - last_point + 1, 0, 0); + last_point + 1, x, y); /* Copy over the contours. */ for (i = 0; i < number_of_contours; ++i) @@ -2847,8 +2842,6 @@ sfnt_decompose_compound_glyph (struct sfnt_glyph *glyph, context, get_glyph, free_glyph, - off_x + x, - off_y + y, recursion_count + 1, dcontext); @@ -3276,7 +3269,7 @@ sfnt_decompose_glyph (struct sfnt_glyph *glyph, if (sfnt_decompose_compound_glyph (glyph, &context, get_glyph, free_glyph, - 0, 0, 0, dcontext)) + 0, dcontext)) { xfree (context.x_coordinates); xfree (context.y_coordinates); @@ -11347,11 +11340,8 @@ sfnt_interpret_simple_glyph (struct sfnt_glyph *glyph, Treat X and Y as arrays of 26.6 fixed point values. Also, apply the 26.6 fixed point offsets X_OFF and Y_OFF to each X - and Y coordinate. - - See sfnt_decompose_compound_glyph for an explanation of why offsets - might be applied here, and not while reading the subglyph - itself. */ + and Y coordinate after the transforms in COMPONENT are + effected. */ static void sfnt_transform_f26dot6 (struct sfnt_compound_glyph_component *component, @@ -11365,56 +11355,59 @@ sfnt_transform_f26dot6 (struct sfnt_compound_glyph_component *component, if (component->flags & 010) /* WE_HAVE_A_SCALE */ { - for (i = 0; i < num_coordinates; ++i) - { - x[i] *= component->u.scale / 16384.0; - y[i] *= component->u.scale / 16384.0; - x[i] += x_off; - y[i] += y_off; - } + m1 = component->u.scale / 16384.0; + m2 = m3 = m4 = 0; + m5 = component->u.scale / 16384.0; + m6 = 0; } else if (component->flags & 0100) /* WE_HAVE_AN_X_AND_Y_SCALE */ { - for (i = 0; i < num_coordinates; ++i) - { - x[i] *= component->u.a.xscale / 16384.0; - y[i] *= component->u.a.yscale / 16384.0; - x[i] += x_off; - y[i] += y_off; - } + m1 = component->u.a.xscale / 16384.0; + m2 = m3 = m4 = 0; + m5 = component->u.a.yscale / 16384.0; + m6 = 0; } else if (component->flags & 0200) /* WE_HAVE_A_TWO_BY_TWO */ { - /* Apply the specified affine transformation. - A transform looks like: - - M1 M2 M3 X - M4 M5 M6 * Y - - = - - M1*X + M2*Y + M3*1 = X1 - M4*X + M5*Y + M6*1 = Y1 - - (In most transforms, there is another row at the bottom for - mathematical reasons. Since Z1 is always 1.0, the row is - simply implied to be 0 0 1, because 0 * x + 0 * y + 1 * 1 = - 1.0. See the definition of matrix3x3 in image.c for some - more explanations about this.) */ m1 = component->u.b.xscale / 16384.0; m2 = component->u.b.scale01 / 16384.0; m3 = 0; m4 = component->u.b.scale10 / 16384.0; m5 = component->u.b.yscale / 16384.0; m6 = 0; - + } + else /* No scale, just apply x_off and y_off. */ + { for (i = 0; i < num_coordinates; ++i) - { - x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; - y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; - x[i] += x_off; - y[i] += y_off; - } + x[i] += x_off, y[i] += y_off; + + return; + } + + m3 = x_off; + m6 = y_off; + + /* Apply the specified affine transformation. + A transform looks like: + + M1 M2 M3 X + M4 M5 M6 * Y + + = + + M1*X + M2*Y + M3*1 = X1 + M4*X + M5*Y + M6*1 = Y1 + + (In most transforms, there is another row at the bottom for + mathematical reasons. Since Z1 is always 1.0, the row is simply + implied to be 0 0 1, because 0 * x + 0 * y + 1 * 1 = 1.0. See + the definition of matrix3x3 in image.c for some more explanations + about this.) */ + + for (i = 0; i < num_coordinates; ++i) + { + x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; + y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; } } @@ -11617,7 +11610,6 @@ sfnt_interpret_compound_glyph_2 (struct sfnt_glyph *glyph, /* Internal helper for sfnt_interpret_compound_glyph. RECURSION_COUNT is the number of times this function has called itself. - OFF_X and OFF_Y are the offsets to apply to the glyph outline. METRICS are the unscaled metrics of this compound glyph. @@ -11636,7 +11628,6 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, struct sfnt_hhea_table *hhea, struct sfnt_maxp_table *maxp, struct sfnt_glyph_metrics *metrics, - sfnt_fixed off_x, sfnt_fixed off_y, int recursion_count, void *dcontext) { @@ -11672,7 +11663,7 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, maximum valid value of `max_component_depth', which is 16. */ if (recursion_count > 16) - return "Overly deep recursion in compound glyph data"; + return "Excessive recursion in compound glyph data"; /* Pacify -Wmaybe-uninitialized. */ point = point2 = 0; @@ -11762,7 +11753,7 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, if (need_free) free_glyph (subglyph, dcontext); - return "Invalid anchor point"; + return "Invalid anchor reference point"; } if (!subglyph->compound) @@ -11772,14 +11763,25 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, if (need_free) free_glyph (subglyph, dcontext); - return "Invalid anchored point"; + return "Invalid component anchor point"; } /* Get the points and use them to compute the offsets. */ xtemp = context->x_coordinates[point]; ytemp = context->y_coordinates[point]; - x = (xtemp - subglyph->simple->x_coordinates[point2] * 64); - y = (ytemp - subglyph->simple->y_coordinates[point2] * 64); + + /* Convert the unscaled coordinates within + SIMPLE->x_coordinates to device space. */ + x = subglyph->simple->x_coordinates[point2]; + y = subglyph->simple->y_coordinates[point2]; + x = sfnt_mul_f26dot6_fixed (x * 64, interpreter->scale); + y = sfnt_mul_f26dot6_fixed (y * 64, interpreter->scale); + + /* Derive the X and Y offsets from the difference + between the reference point's position and the anchor + point's. */ + x = xtemp - x; + y = ytemp - y; } else { @@ -11870,8 +11872,8 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, for (i = 0; i < last_point; ++i) { - x_base[i] = value->x_points[i] + off_x + x; - y_base[i] = value->y_points[i] + off_y + y; + x_base[i] = value->x_points[i]; + y_base[i] = value->y_points[i]; flags_base[i] = value->flags[i]; } @@ -11884,7 +11886,7 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, /* Apply the transform to the points. */ sfnt_transform_f26dot6 (component, x_base, y_base, - last_point, 0, 0); + last_point, x, y); } } else @@ -11897,7 +11899,6 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph, context, get_glyph, free_glyph, hmtx, hhea, maxp, &sub_metrics, - off_x + x, off_y + y, recursion_count + 1, dcontext); @@ -12028,8 +12029,7 @@ sfnt_interpret_compound_glyph (struct sfnt_glyph *glyph, state, &context, get_glyph, free_glyph, hmtx, hhea, maxp, - metrics, 0, 0, 0, - dcontext); + metrics, 0, dcontext); /* If an error occurs, free the data in the context and return. */ diff --git a/src/sfnt.h b/src/sfnt.h index 48d22aa8d29..6f93393c1d3 100644 --- a/src/sfnt.h +++ b/src/sfnt.h @@ -623,16 +623,16 @@ #define sfnt_coerce_fixed(fixed) ((sfnt_fixed) (fixed) / 65535.0) /* Various scale formats. */ union { - uint16_t scale; + int16_t scale; struct { - uint16_t xscale; - uint16_t yscale; + int16_t xscale; + int16_t yscale; } a; struct { - uint16_t xscale; - uint16_t scale01; - uint16_t scale10; - uint16_t yscale; + int16_t xscale; + int16_t scale01; + int16_t scale10; + int16_t yscale; } b; } u; }; commit 612f25c24ff08b9343ec8897c8dbcfc02d9b0d07 Author: Bob Rogers Date: Wed Aug 16 04:19:50 2023 +0300 Don't use the too-new command 'git get-url' * lisp/vc/vc-git.el (vc-git-repository-url): Don't use the too-new command 'git get-url' (bug#65315). diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index dfca944dc74..a7763360795 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1342,8 +1342,10 @@ vc-git-conflicted-files (defun vc-git-repository-url (file-or-dir &optional remote-name) (let ((default-directory (vc-git-root file-or-dir))) (with-temp-buffer - (vc-git-command (current-buffer) 0 nil "remote" "get-url" - (or remote-name "origin")) + ;; The "get-url" subcommand of "git remote" was new in git 2.7.0; + ;; "git config" also works in older versions. -- rgr, 15-Aug-23. + (let ((opt-name (concat "remote." (or remote-name "origin") ".url"))) + (vc-git-command (current-buffer) 0 (list "config" "--get" opt-name))) (buffer-substring-no-properties (point-min) (1- (point-max)))))) ;; Everywhere but here, follows vc-git-command, which uses vc-do-command commit 98af493e0f1db56489b291298089ed128652d247 Author: F. Jason Park Date: Sun Aug 6 22:05:26 2023 -0700 Add line-wise movement commands for erc-fill-wrap * lisp/erc/erc-fill.el (erc-fill-line-spacing): Revise doc string. (erc-fill--wrap-escape-hidden-speaker): New helper function to move point to beginning of visible text. (erc-fill--wrap-beginning-of-line): Factor out adjustment for hidden speakers. (erc-fill--wrap-previous-line, erc-fill--wrap-next-line): Add commands for moving to previous and next line in a manner consistent with the value of `erc-fill--wrap-visual-keys'. (erc-fill-wrap-mode-map): Add remap bindings for `next-line' and `previous-line'. (erc-fill-wrap-mode): Revise doc string. (erc-fill-wrap-nudge): Fix vertical anchoring so that point's line remains steadier throughout the adjustment. (Bug#60936) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index e2a82582a3f..f4835f71278 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -137,9 +137,8 @@ erc-fill-wrap-margin-side (defcustom erc-fill-line-spacing nil "Extra space between messages on graphical displays. -This may need adjusting depending on how your faces are -configured. Its value should be larger than that of the variable -`line-spacing', if set. If unsure, try 0.5." +Its value should be larger than that of the variable +`line-spacing', if set. When unsure, start with 0.5." :package-version '(ERC . "5.6") ; FIXME sync on release :type '(choice (const nil) number)) @@ -262,6 +261,14 @@ erc-fill--wrap-kill-line ;; `kill-line' anyway so that users can see the error. (erc-fill--wrap-move #'kill-line #'kill-visual-line arg)) +(defun erc-fill--wrap-escape-hidden-speaker () + "Move to start of message text when left of speaker. +Basically mimic what `move-beginning-of-line' does with invisible text." + (when-let ((erc-fill-wrap-merge) + (prop (get-text-property (point) 'display)) + ((or (equal prop "") (eq 'margin (car-safe (car-safe prop)))))) + (goto-char (text-property-not-all (point) (pos-eol) 'display prop)))) + (defun erc-fill--wrap-beginning-of-line (arg) "Defer to `move-beginning-of-line' or `beginning-of-visual-line'." (interactive "^p") @@ -271,10 +278,22 @@ erc-fill--wrap-beginning-of-line (if (get-text-property (point) 'erc-prompt) (goto-char erc-input-marker) ;; Mimic what `move-beginning-of-line' does with invisible text. - (when-let ((erc-fill-wrap-merge) - (prop (get-text-property (point) 'display)) - ((or (equal prop "") (eq 'margin (car-safe (car-safe prop)))))) - (goto-char (text-property-not-all (point) (pos-eol) 'display prop))))) + (erc-fill--wrap-escape-hidden-speaker))) + +(defun erc-fill--wrap-previous-line (&optional arg try-vscroll) + "Move to ARGth previous logical or screen line." + (interactive "^p\np") + (if erc-fill--wrap-visual-keys + (with-no-warnings (previous-line arg try-vscroll)) + (prog1 (previous-logical-line arg try-vscroll) + (erc-fill--wrap-escape-hidden-speaker)))) + +(defun erc-fill--wrap-next-line (&optional arg try-vscroll) + "Move to ARGth next logical or screen line." + (interactive "^p\np") + (if erc-fill--wrap-visual-keys + (with-no-warnings (next-line arg try-vscroll)) + (next-logical-line arg try-vscroll))) (defun erc-fill--wrap-end-of-line (arg) "Defer to `move-end-of-line' or `end-of-visual-line'." @@ -320,6 +339,8 @@ erc-fill-wrap-mode-map " " #'erc-fill--wrap-end-of-line " " #'erc-fill--wrap-beginning-of-line " " #'erc-fill-wrap-toggle-truncate-lines + " " #'erc-fill--wrap-next-line + " " #'erc-fill--wrap-previous-line "C-c a" #'erc-fill-wrap-cycle-visual-movement ;; Not sure if this is problematic because `erc-bol' takes no args. " " #'erc-fill--wrap-beginning-of-line) @@ -359,28 +380,38 @@ erc-fill--wrap-ensure-dependencies ;;;###autoload(put 'fill-wrap 'erc--feature 'erc-fill) (define-erc-module fill-wrap nil "Fill style leveraging `visual-line-mode'. -This local module displays nicks overhanging leftward to a common -offset, as determined by the option `erc-fill-static-center'. It -depends on the `fill', `stamp', and `button' modules and assumes -users who've defined their own `erc-insert-timestamp-function' -have also customized the option `erc-fill-wrap-margin-side' to an -explicit side. To use this module, either include `fill-wrap' in -`erc-modules' or set `erc-fill-function' to `erc-fill-wrap'. -Manually invoking one of the minor-mode toggles is not -recommended. +This module displays nicks overhanging leftward to a common +offset, as determined by the option `erc-fill-static-center'. To +use it, either include `fill-wrap' in `erc-modules' or set +`erc-fill-function' to `erc-fill-wrap'. Most users will want to +enable the `scrolltobottom' module as well. Once active, use +\\[erc-fill-wrap-nudge] to adjust the width of the indent and the +stamp margin, and use \\[erc-fill-wrap-toggle-truncate-lines] for +cycling between logical- and screen-line oriented command +movement. Also see related options `erc-fill-line-spacing' and +`erc-fill-wrap-merge'. This module imposes various restrictions on the appearance of timestamps. Most notably, it insists on displaying them in the margins. Users preferring left-sided stamps may notice that ERC also displays the prompt in the left margin, possibly truncating -or padding it to constrain it to the margin's width. When stamps +or padding it to constrain it to the margin's width. +Additionally, this module assumes that users providing their own +`erc-insert-timestamp-function' have also customized the option +`erc-fill-wrap-margin-side' to an explicit side. When stamps appear in the right margin, which they do by default, users may find that ERC actually appends them to copy-as-killed messages without an intervening space. This normally poses at most a minor inconvenience, however users of the `log' module may prefer a workaround provided by `erc-stamp-prefix-log-filter', which strips trailing stamps from logged messages and instead prepends -them to every line." +them to every line. + +As a so-called \"local\" module, `fill-wrap' depends on the +global modules `fill', `stamp', and `button'; it activates them +as needed when initializing. Please note that enabling and +disabling this module by invoking one of its minor-mode toggles +is not recommended." ((erc-fill--wrap-ensure-dependencies) (erc--restore-initialize-priors erc-fill-wrap-mode erc-fill--wrap-visual-keys erc-fill-wrap-visual-keys @@ -548,8 +579,8 @@ erc-fill-wrap-nudge (user-error "Command called in an undisplayed buffer")) (let* ((total (erc-fill--wrap-nudge arg)) (leftp erc-stamp--margin-left-p) - (win-ratio (/ (float (- (window-point) (window-start))) - (- (window-end nil t) (window-start))))) + ;; Anchor current line vertically. + (line (count-screen-lines (window-start) (window-point)))) (when (zerop arg) (setq arg 1)) (erc-compat-call @@ -564,7 +595,7 @@ erc-fill-wrap-nudge (lambda () (interactive) (cl-incf total (erc-fill--wrap-nudge a)) - (recenter (round (* win-ratio (window-height)))))))) + (recenter line))))) (dolist (key '(?\) ?_ ?+)) (let ((a (pcase key (?\) 0) @@ -575,7 +606,7 @@ erc-fill-wrap-nudge (interactive) (erc-stamp--adjust-margin (- a) (zerop a)) (when leftp (erc-stamp--refresh-left-margin-prompt)) - (recenter (round (* win-ratio (window-height)))))))) + (recenter line))))) map) t (lambda () @@ -584,7 +615,7 @@ erc-fill-wrap-nudge (if leftp left-margin-width right-margin-width))) "Use %k for further adjustment" 1) - (recenter (round (* win-ratio (window-height)))))) + (recenter line))) (defun erc-fill-regarding-timestamp () "Fills a text such that messages start at column `erc-fill-static-center'." commit 4b17cc314771532fa1a6a617c3961f44bd2a5e7f Author: F. Jason Park Date: Mon Aug 7 03:35:56 2023 -0700 Deprecate erc-button-nickname-callback-function * lisp/erc/erc-button.el (erc-button-nickname-callback-function): Deprecate this function-valued variable, first introduced in ERC 5.6 and Emacs 30, to dissuade consumers of the old `erc-button-alist' nickname interface from meddling with the on-click callback of buttonized nicks. If necessary, third parties can instead add their own propertizing logic in something like `erc-insert-modify-hook'. Also change default callback to a wrapper that discards all but the first arg. This effectively declares that `erc-data' values for nicknames may contain more than one element in the near future. (erc-button--perform-nick-popup): New default nick-button callback function wrapping `erc-nick-popup' in order to adapt it to the `erc-button-nickname-callback-function' interface. (Bug#60933) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 89a6cd131c0..bfaf4fa821a 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -279,8 +279,13 @@ erc-button-setup " entries are deprecated. Either use a variable or a function" " that conditionally calls `erc-button-add-button'."))))) -(defvar erc-button-nickname-callback-function #'erc-nick-popup - "Escape hatch for those needing a different nickname callback.") +(defvar erc-button-nickname-callback-function #'erc-button--perform-nick-popup + "Escape hatch for users needing a non-standard nick-button callback. +Value should be a function accepting a NICK and any number of +trailing arguments that are as yet unspecified. Runs when +clicking \\`' or hitting \\`RET' atop a nickname button.") +(make-obsolete-variable 'erc-button-nickname-callback-function + "default provides essential functionality" "30.1") (defun erc-button-add-buttons () "Find external references in the current buffer and make buttons of them. @@ -745,6 +750,10 @@ erc-nick-popup (funcall code nick) (eval code `((nick . ,nick))))))) +(defun erc-button--perform-nick-popup (nick &rest _) + "Call `erc-nick-popup' with NICK." + (erc-nick-popup nick)) + ;;; Callback functions (defun erc-button-describe-symbol (symbol-name) "Describe SYMBOL-NAME. commit 35a670a2f6ca7aae97b7c5c11e57c732c5b31c36 Author: F. Jason Park Date: Mon Jul 31 22:20:01 2023 -0700 ; Relax timeouts on some ERC tests There have been three failures (all on native-comp-speed2-master) over the last three weeks pointing to these tests, which haven't changed in the year-plus they've existed in tree. No test appears in multiple failures, and all continue to pass daily on commercial GitLab (GCP) runners using the same EMBA container image. They also pass locally with "make check" and "make -j -C test SELECTOR=t check-lisp-erc". If these tweaks don't fix the problem, they can be branded :unstable. * test/lisp/erc/erc-scenarios-base-renick.el: Extend timeouts. * test/lisp/erc/resources/base/netid/bouncer/barnet.eld: Extend timeouts. * test/lisp/erc/resources/base/netid/bouncer/foonet.eld: Extend timeouts. * test/lisp/erc/resources/base/reconnect/options.eld: Extend timeouts. * test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld: Extend timeouts. * test/lisp/erc/resources/base/renick/queries/bouncer-foonet.eld: Extend timeouts. * test/lisp/erc/resources/erc-scenarios-common.el: Extend timeout. * test/lisp/erc/resources/services/auth-source/libera.eld: Extend timeouts. diff --git a/test/lisp/erc/erc-scenarios-base-renick.el b/test/lisp/erc/erc-scenarios-base-renick.el index f1723200533..2bf3ef46257 100644 --- a/test/lisp/erc/erc-scenarios-base-renick.el +++ b/test/lisp/erc/erc-scenarios-base-renick.el @@ -275,8 +275,8 @@ erc-scenarios-base-renick-queries-bouncer (funcall expect 3 "I never saw her before") (erc-scenarios-common-say "You aren't with Wage?"))) - (erc-d-t-wait-for 3 (get-buffer "frenemy@foonet")) - (erc-d-t-wait-for 3 (get-buffer "frenemy@barnet")) + (erc-d-t-wait-for 10 (get-buffer "frenemy@foonet")) + (erc-d-t-wait-for 10 (get-buffer "frenemy@barnet")) (should-not (get-buffer "rando@foonet")) (should-not (get-buffer "rando@barnet")) diff --git a/test/lisp/erc/resources/base/netid/bouncer/barnet.eld b/test/lisp/erc/resources/base/netid/bouncer/barnet.eld index d0fe3af8ea4..204d01fef77 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/barnet.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/barnet.eld @@ -1,7 +1,7 @@ ;; -*- mode: lisp-data; -*- -((pass 3 "PASS :barnet:changeme")) -((nick 3 "NICK tester")) -((user 3 "USER user 0 * :tester") +((pass 10 "PASS :barnet:changeme")) +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :tester") (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") (0 ":irc.barnet.org 003 tester :This server was created Wed, 12 May 2021 07:41:08 UTC") @@ -17,19 +17,19 @@ (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") (0 ":irc.barnet.org 422 tester :MOTD File is missing")) -((mode-user 10.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") ;; No mode answer ^ (0 ":irc.znc.in 306 tester :You have been marked as being away") (0 ":irc.barnet.org 305 tester :You are no longer marked as being away")) -((join 1 "JOIN #chan") +((join 10 "JOIN #chan") (0 ":tester!~u@awyxgybtkx7uq.irc JOIN #chan") (0 ":irc.barnet.org 353 tester = #chan :@joe mike tester") (0 ":irc.barnet.org 366 tester #chan :End of NAMES list") (0.1 ":joe!~u@awyxgybtkx7uq.irc PRIVMSG #chan :tester, welcome!") (0 ":mike!~u@awyxgybtkx7uq.irc PRIVMSG #chan :tester, welcome!")) -((mode 3 "MODE #chan") +((mode 10 "MODE #chan") (0 ":irc.barnet.org 324 tester #chan +nt") (0 ":irc.barnet.org 329 tester #chan 1620805269") (0.1 ":mike!~u@awyxgybtkx7uq.irc PRIVMSG #chan :joe: But you have outfaced them all.") diff --git a/test/lisp/erc/resources/base/netid/bouncer/foonet.eld b/test/lisp/erc/resources/base/netid/bouncer/foonet.eld index b0964fb9537..4445350ca0c 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/foonet.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/foonet.eld @@ -1,7 +1,7 @@ ;; -*- mode: lisp-data; -*- -((pass 3 "PASS :foonet:changeme")) -((nick 3 "NICK tester")) -((user 3 "USER user 0 * :tester") +((pass 10 "PASS :foonet:changeme")) +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :tester") (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") (0 ":irc.foonet.org 003 tester :This server was created Wed, 12 May 2021 07:41:09 UTC") @@ -17,19 +17,19 @@ (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") (0 ":irc.foonet.org 422 tester :MOTD File is missing")) -((mode-user 4.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") ;; No mode answer ^ (0 ":irc.znc.in 306 tester :You have been marked as being away") (0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) -((join 1 "JOIN #chan") +((join 10 "JOIN #chan") (0 ":tester!~u@ertp7idh9jtgi.irc JOIN #chan") (0 ":irc.foonet.org 353 tester = #chan :@alice bob tester") (0 ":irc.foonet.org 366 tester #chan :End of NAMES list") (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :tester, welcome!") (0 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :tester, welcome!")) -((mode 3 "MODE #chan") +((mode 10 "MODE #chan") (0 ":irc.foonet.org 324 tester #chan +nt") (0 ":irc.foonet.org 329 tester #chan 1620805271") (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: He cannot be heard of. Out of doubt he is transported.") diff --git a/test/lisp/erc/resources/base/reconnect/options.eld b/test/lisp/erc/resources/base/reconnect/options.eld index 3b305d85594..e0952a2aece 100644 --- a/test/lisp/erc/resources/base/reconnect/options.eld +++ b/test/lisp/erc/resources/base/reconnect/options.eld @@ -1,7 +1,7 @@ ;; -*- mode: lisp-data; -*- -((pass 1 "PASS :changeme")) -((nick 1 "NICK tester")) -((user 1 "USER user 0 * :tester") +((pass 10 "PASS :changeme")) +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :tester") (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") @@ -18,7 +18,7 @@ (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") (0 ":irc.foonet.org 422 tester :MOTD File is missing")) -((mode-user 3.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") (0 ":irc.foonet.org 221 tester +i") (0 ":irc.foonet.org NOTICE tester :This server is in debug mode.") @@ -26,7 +26,7 @@ (0 ":irc.foonet.org 353 tester = #chan :alice tester @bob") (0 ":irc.foonet.org 366 tester #chan :End of NAMES list")) -((mode-chan 4 "MODE #chan") +((mode-chan 10 "MODE #chan") (0 ":irc.foonet.org 324 tester #chan +nt") (0 ":irc.foonet.org 329 tester #chan 1620104779") (0.1 ":bob!~u@rz2v467q4rwhy.irc PRIVMSG #chan :tester, welcome!") diff --git a/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld b/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld index 0c8cdac0379..c9080cf39e9 100644 --- a/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld +++ b/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld @@ -1,7 +1,7 @@ ;; -*- mode: lisp-data; -*- -((pass 3 "PASS :barnet:changeme")) -((nick 3 "NICK tester")) -((user 3 "USER user 0 * :tester") +((pass 10 "PASS :barnet:changeme")) +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :tester") (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") (0 ":irc.barnet.org 003 tester :This server was created Tue, 01 Jun 2021 07:49:23 UTC") @@ -17,7 +17,7 @@ (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") (0 ":irc.barnet.org 422 tester :MOTD File is missing")) -((mode-user 3.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") ;; No mode answer (0 ":irc.znc.in 306 tester :You have been marked as being away") (0 ":tester!~u@286u8jcpis84e.irc JOIN #chan") @@ -32,18 +32,18 @@ (0 ":irc.barnet.org NOTICE tester :[09:13:24] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") (0 ":irc.barnet.org 305 tester :You are no longer marked as being away")) -((mode 5 "MODE #chan") +((mode 10 "MODE #chan") (0 ":irc.barnet.org 324 tester #chan +nt") (0 ":irc.barnet.org 329 tester #chan 1622538742") (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: By favors several which they did bestow.") (0.1 ":mike!~u@286u8jcpis84e.irc PRIVMSG #chan :joe: You, Roderigo! come, sir, I am for you.")) -((privmsg-a 5 "PRIVMSG rando :Linda said you were gonna kill me.") +((privmsg-a 10 "PRIVMSG rando :Linda said you were gonna kill me.") (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: Play, music, then! Nay, you must do it soon.") (0.1 ":rando!~u@95i756tt32ym8.irc PRIVMSG tester :Linda said? I never saw her before I came up here.") (0.1 ":mike!~u@286u8jcpis84e.irc PRIVMSG #chan :joe: Of arts inhibited and out of warrant.")) -((privmsg-b 3 "PRIVMSG rando :You aren't with Wage?") +((privmsg-b 10 "PRIVMSG rando :You aren't with Wage?") (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: But most of all, agreeing with the proclamation.") (0.1 ":rando!~u@95i756tt32ym8.irc PRIVMSG tester :I think you screwed up, Case.") (0.1 ":mike!~u@286u8jcpis84e.irc PRIVMSG #chan :joe: Good gentleman, go your gait, and let poor volk pass. An chud ha' bin zwaggered out of my life, 'twould not ha' bin zo long as 'tis by a vortnight. Nay, come not near th' old man; keep out, che vor ye, or ise try whether your costard or my ballow be the harder. Chill be plain with you.") diff --git a/test/lisp/erc/resources/base/renick/queries/bouncer-foonet.eld b/test/lisp/erc/resources/base/renick/queries/bouncer-foonet.eld index 162e8bf9655..2421651ebe8 100644 --- a/test/lisp/erc/resources/base/renick/queries/bouncer-foonet.eld +++ b/test/lisp/erc/resources/base/renick/queries/bouncer-foonet.eld @@ -1,7 +1,7 @@ ;; -*- mode: lisp-data; -*- -((pass 1 "PASS :foonet:changeme")) -((nick 1 "NICK tester")) -((user 1 "USER user 0 * :tester") +((pass 10 "PASS :foonet:changeme")) +((nick 10 "NICK tester")) +((user 10 "USER user 0 * :tester") (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") (0 ":irc.foonet.org 003 tester :This server was created Tue, 01 Jun 2021 07:49:22 UTC") @@ -17,7 +17,7 @@ (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") (0 ":irc.foonet.org 422 tester :MOTD File is missing")) -((mode-user 5.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") ;; No mode answer (0 ":irc.znc.in 306 tester :You have been marked as being away") (0 ":tester!~u@u4mvbswyw8gbg.irc JOIN #chan") @@ -38,12 +38,12 @@ (0.1 ":bob!~u@u4mvbswyw8gbg.irc PRIVMSG #chan :alice: When there is nothing living but thee, thou shalt be welcome. I had rather be a beggar's dog than Apemantus.") (0.1 ":alice!~u@u4mvbswyw8gbg.irc PRIVMSG #chan :bob: You have simply misused our sex in your love-prate: we must have your doublot and hose plucked over your head, and show the world what the bird hath done to her own nest.")) -((privmsg-a 6 "PRIVMSG rando :I here") +((privmsg-a 10 "PRIVMSG rando :I here") (0.1 ":bob!~u@u4mvbswyw8gbg.irc PRIVMSG #chan :alice: And I will make thee think thy swan a crow.") (0.1 ":rando!~u@bivkhq8yav938.irc PRIVMSG tester :u are dumb") (0.1 ":alice!~u@u4mvbswyw8gbg.irc PRIVMSG #chan :bob: Lie not, to say mine eyes are murderers.")) -((privmsg-b 3 "PRIVMSG rando :not so") +((privmsg-b 10 "PRIVMSG rando :not so") (0.1 ":bob!~u@u4mvbswyw8gbg.irc PRIVMSG #chan :alice: Commit myself, my person, and the cause.") ;; Nick change (0.1 ":rando!~u@bivkhq8yav938.irc NICK frenemy") diff --git a/test/lisp/erc/resources/erc-scenarios-common.el b/test/lisp/erc/resources/erc-scenarios-common.el index 32e7556d602..972faa5c73f 100644 --- a/test/lisp/erc/resources/erc-scenarios-common.el +++ b/test/lisp/erc/resources/erc-scenarios-common.el @@ -288,7 +288,7 @@ erc-scenarios-common--base-network-id-bouncer (erc-d-t-search-for 1 "") (erc-d-t-absent-for 0.1 "") (should (eq erc-server-process erc-server-process-foo)) - (erc-d-t-search-for 10 "ape is dead") + (erc-d-t-search-for 15 "ape is dead") (erc-d-t-wait-for 5 (not (erc-server-process-alive))))) (ert-info ("#chan@ is exclusive to barnet") diff --git a/test/lisp/erc/resources/services/auth-source/libera.eld b/test/lisp/erc/resources/services/auth-source/libera.eld index c8dbc9d425a..dfc25221508 100644 --- a/test/lisp/erc/resources/services/auth-source/libera.eld +++ b/test/lisp/erc/resources/services/auth-source/libera.eld @@ -1,6 +1,6 @@ ;; -*- mode: lisp-data; -*- -((nick 1 "NICK tester")) -((user 1 "USER user 0 * :tester") +((nick 10 "NICK tester")) +((user 5 "USER user 0 * :tester") (0.26 ":zirconium.libera.chat NOTICE * :*** Checking Ident") (0.01 ":zirconium.libera.chat NOTICE * :*** Looking up your hostname...") (0.01 ":zirconium.libera.chat NOTICE * :*** No Ident response") @@ -35,15 +35,15 @@ (0.01 ":zirconium.libera.chat 372 tester :- Email: support@libera.chat") (0.00 ":zirconium.libera.chat 376 tester :End of /MOTD command.")) -((mode-user 1.2 "MODE tester +i") +((mode-user 10 "MODE tester +i") (0.02 ":tester MODE tester :+Zi") (0.02 ":NickServ!NickServ@services.libera.chat NOTICE tester :This nickname is registered. Please choose a different nickname, or identify via \2/msg NickServ IDENTIFY tester \2")) -((privmsg 2 "PRIVMSG NickServ :IDENTIFY changeme") +((privmsg 10 "PRIVMSG NickServ :IDENTIFY changeme") (0.96 ":NickServ!NickServ@services.libera.chat NOTICE tester :You are now identified for \2tester\2.") (0.25 ":NickServ!NickServ@services.libera.chat NOTICE tester :Last login from: \2~tester@school.edu/tester\2 on Jun 18 01:15:56 2021 +0000.")) -((quit 5 "QUIT :\2ERC\2") +((quit 10 "QUIT :\2ERC\2") (0.19 ":tester!~user@static-198-54-131-100.cust.tzulo.com QUIT :Client Quit")) ((linger 1 LINGER)) commit cc5649bd2840de4d339b9cf4a3735d316a4a759d Author: Paul Eggert Date: Tue Aug 15 15:55:08 2023 -0700 Simplify get_boot_sec * src/filelock.c (get_boot_sec): Simplify by removing a special case for MS-DOS. * src/msdos.c (get_boot_time): New dummy that always fails. diff --git a/src/filelock.c b/src/filelock.c index f3075b93322..c2b306ab47d 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -118,16 +118,10 @@ get_boot_sec (void) if (will_dump_p ()) return 0; -#ifndef MSDOS - { - struct timespec boot_time; - boot_time.tv_sec = 0; - get_boot_time (&boot_time); - return boot_time.tv_sec; - } -#else /* MSDOS */ - return 0; -#endif /* MSDOS */ + struct timespec boot_time; + boot_time.tv_sec = 0; + get_boot_time (&boot_time); + return boot_time.tv_sec; } /* An arbitrary limit on lock contents length. 8 K should be plenty diff --git a/src/msdos.c b/src/msdos.c index 1b7f2d4ae21..20af5353e70 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -4286,6 +4286,12 @@ init_gettimeofday (void) } #endif +int +get_boot_time (struct timespec *p_boot_time) +{ + return -1; +} + static void msdos_abort (void) { commit 63d8d652298861581a7b9a7e44273164fa5aa4af Author: Paul Eggert Date: Tue Aug 15 15:46:11 2023 -0700 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/readutmp.h b/lib/readutmp.h index 3ddecf37272..fa30fa9a004 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -270,21 +270,19 @@ #define HAVE_STRUCT_XTMP_UT_HOST \ /* Macros that test (UT)->ut_type. */ #ifdef BOOT_TIME -# define UT_TYPE_BOOT_TIME(UT) UT_TYPE_EQ (UT, BOOT_TIME) +# define UT_TYPE_BOOT_TIME(UT) ((UT)->ut_type == BOOT_TIME) #else # define UT_TYPE_BOOT_TIME(UT) 0 #endif #ifdef USER_PROCESS -# define UT_TYPE_USER_PROCESS(UT) UT_TYPE_EQ (UT, USER_PROCESS) +# define UT_TYPE_USER_PROCESS(UT) ((UT)->ut_type == USER_PROCESS) #else # define UT_TYPE_USER_PROCESS(UT) 0 #endif /* Determines whether an entry *UT corresponds to a user process. */ #define IS_USER_PROCESS(UT) \ - (UT_USER (UT)[0] \ - && (UT_TYPE_USER_PROCESS (UT) \ - || (UT_TYPE_NOT_DEFINED && UT_TIME_MEMBER (UT) != 0))) + ((UT)->ut_user[0] && UT_TYPE_USER_PROCESS (UT)) /* Define if read_utmp is not just a dummy. */ #if READUTMP_USE_SYSTEMD || HAVE_UTMPX_H || HAVE_UTMP_H || defined __CYGWIN__ || defined _WIN32 commit c9fbd8950bbdece8cea426d1bcc5b764cf3b0592 Author: Stefan Kangas Date: Tue Aug 15 21:29:13 2023 +0200 Fix typo in pcomplete/sha512sum alias * lisp/pcmpl-unix.el (pcomplete/sha512sum): Rename from 'pcomplete/sha521sum'. diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index 1a77e3b248f..e6b67256a4c 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -227,7 +227,7 @@ pcomplete/md5sum ;;;###autoload(defalias 'pcomplete/sha224sum 'pcomplete/md5sum) ;;;###autoload(defalias 'pcomplete/sha256sum 'pcomplete/md5sum) ;;;###autoload(defalias 'pcomplete/sha384sum 'pcomplete/md5sum) -;;;###autoload(defalias 'pcomplete/sha521sum 'pcomplete/md5sum) +;;;###autoload(defalias 'pcomplete/sha512sum 'pcomplete/md5sum) ;;;###autoload (defun pcomplete/sort () commit 1db7e8eba961e88181879213dd5374ad9e87ac76 Author: kobarity Date: Tue Aug 15 22:27:45 2023 +0900 Fix test in python-tests.el added by bug #62092 * test/lisp/progmodes/python-tests.el (python-info-dedenter-opening-block-positions-6): Fix indentation. (python-info-dedenter-opening-block-positions-7): Add calling `should'. Add RESTORE-POINT argument when calling `python-tests-look-at'. diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 54e32cbf07b..9f935f2748c 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -5973,9 +5973,9 @@ python-info-dedenter-opening-block-positions-6 else " (python-tests-look-at "else\n") - (should - (equal (list (python-tests-look-at "if (" -1 t)) - (python-info-dedenter-opening-block-positions))))) + (should + (equal (list (python-tests-look-at "if (" -1 t)) + (python-info-dedenter-opening-block-positions))))) (ert-deftest python-info-dedenter-opening-block-positions-7 () "Test case blocks." @@ -5993,9 +5993,9 @@ python-info-dedenter-opening-block-positions-7 (python-tests-look-at "case 2:") (should-not (python-info-dedenter-opening-block-positions)) (python-tests-look-at "case 3:") - (equal (list (python-tests-look-at "case 2:" -1) - (python-tests-look-at "case 1:" -1 t)) - (python-info-dedenter-opening-block-positions)))) + (should (equal (list (python-tests-look-at "case 2:" -1 t) + (python-tests-look-at "case 1:" -1 t)) + (python-info-dedenter-opening-block-positions))))) (ert-deftest python-info-dedenter-opening-block-message-1 () "Test dedenters inside strings are ignored." commit 7ba76dc9c3efbbcdbeb47529744ec4da5dae6ada Author: Stefan Monnier Date: Tue Aug 15 10:21:51 2023 -0400 lisp/help-fns.el: Revert commit c12838c73ef161850a081f9ccea6e375b7c2f93b * lisp/help-fns.el (help-fns--describe-function-or-command-prompt): Don't allow specifying a non-existing function. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index bedc5a9e49b..81c58ba1998 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -229,11 +229,11 @@ help-fns--describe-function-or-command-prompt (lambda (f) (if want-command (commandp f) (or (fboundp f) (get f 'function-documentation)))) - ;; We use 'confirm' here, unlike in other describe-* - ;; commands, for cases like a function that is advised - ;; but not yet defined (e.g., if 'advice-add' is called - ;; before defining the function). - 'confirm nil nil + ;; We used `confirm' for a while because we may want to see the + ;; meta-info about a function even if the function itself is not + ;; defined, but this use case is too marginal and rarely tested, + ;; not worth the trouble (bug#64902). + t nil nil (and fn (symbol-name fn))))) (unless (equal val "") (setq fn (intern val))) commit 5c101b1adac2b4f3cc4e08a6492b406952c529f3 Author: Michael Albinus Date: Tue Aug 15 15:23:20 2023 +0200 Some Tramp optimizations * lisp/net/tramp-sh.el (tramp-perl-file-name-all-completions): Extend. It shall return also some basic file attributes. (tramp-bundle-read-file-names): Simplify data to be transferred. (tramp-sh-handle-file-name-all-completions): Read additional attributes. (tramp-sh-handle-expand-file-name): Check also "doas". (tramp-bundle-read-file-names): Handle changed data layout. (tramp-find-file-exists-command): Set "file-exists-p" file property. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d836fb1f387..426682ddef1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -634,16 +634,20 @@ tramp-perl-file-truename (defconst tramp-perl-file-name-all-completions "%p -e ' -opendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\"); +($dir = $ARGV[0]) =~ s#/+$##; +opendir(d, $dir) || die(\"$dir: $!\\nfail\\n\"); @files = readdir(d); closedir(d); +print \"(\\n\"; foreach $f (@files) { - if (-d \"$ARGV[0]/$f\") { - print \"$f/\\n\"; - } - else { - print \"$f\\n\"; - } + ($p = $f) =~ s/\\\"/\\\\\\\"/g; + ($q = \"$dir/$f\") =~ s/\\\"/\\\\\\\"/g; + print \"(\", + ((-d \"$q\") ? \"\\\"$p/\\\" \\\"$q\\\" t\" : \"\\\"$p\\\" \\\"$q\\\" nil\"), + ((-e \"$q\") ? \" t\" : \" nil\"), + ((-r \"$q\") ? \" t\" : \" nil\"), + \")\\n\"; } +print \")\\n\"; ' \"$1\" %n" "Perl script to produce output suitable for use with `file-name-all-completions' on the remote file system. @@ -1073,21 +1077,10 @@ tramp-bundle-read-file-names "echo \"(\" while read file; do quoted=`echo \"$file\" | sed -e \"s/\\\"/\\\\\\\\\\\\\\\\\\\"/\"` - if %s \"$file\"; then - echo \"(\\\"$quoted\\\" \\\"file-exists-p\\\" t)\" - else - echo \"(\\\"$quoted\\\" \\\"file-exists-p\\\" nil)\" - fi - if %s \"$file\"; then - echo \"(\\\"$quoted\\\" \\\"file-readable-p\\\" t)\" - else - echo \"(\\\"$quoted\\\" \\\"file-readable-p\\\" nil)\" - fi - if %s \"$file\"; then - echo \"(\\\"$quoted\\\" \\\"file-directory-p\\\" t)\" - else - echo \"(\\\"$quoted\\\" \\\"file-directory-p\\\" nil)\" - fi + echo -n \"(\\\"$quoted\\\"\" + if %s \"$file\"; then echo -n \" t\"; else echo -n \" nil\"; fi + if %s \"$file\"; then echo -n \" t\"; else echo -n \" nil\"; fi + if %s \"$file\"; then echo \" t)\"; else echo \" nil)\"; fi done echo \")\"" "Script to check file attributes of a bundle of files. @@ -1870,34 +1863,48 @@ tramp-sh-handle-file-name-all-completions ;; Get a list of directories and files, including ;; reliably tagging the directories with a trailing "/". ;; Because I rock. --daniel@danann.net - (when (tramp-send-command-and-check - v - (if (tramp-get-remote-perl v) - (progn - (tramp-maybe-send-script - v tramp-perl-file-name-all-completions - "tramp_perl_file_name_all_completions") - (format "tramp_perl_file_name_all_completions %s" - (tramp-shell-quote-argument localname))) - - (format (concat - "cd %s 2>&1 && %s -a 2>%s" - " | while IFS= read f; do" - " if %s -d \"$f\" 2>%s;" - " then echo \"$f/\"; else echo \"$f\"; fi;" - " done") - (tramp-shell-quote-argument localname) - (tramp-get-ls-command v) - (tramp-get-remote-null-device v) - (tramp-get-test-command v) - (tramp-get-remote-null-device v)))) - - ;; Now grab the output. - (with-current-buffer (tramp-get-buffer v) - (goto-char (point-max)) - (while (zerop (forward-line -1)) - (push (buffer-substring (point) (line-end-position)) result))) - result))))))))) + (if (tramp-get-remote-perl v) + (progn + (tramp-maybe-send-script + v tramp-perl-file-name-all-completions + "tramp_perl_file_name_all_completions") + (setq result + (tramp-send-command-and-read + v (format "tramp_perl_file_name_all_completions %s" + (tramp-shell-quote-argument localname)) + 'noerror)) + ;; Cached values. + (dolist (elt result) + (tramp-set-file-property + v (cadr elt) "file-directory-p" (nth 2 elt)) + (tramp-set-file-property + v (cadr elt) "file-exists-p" (nth 3 elt)) + (tramp-set-file-property + v (cadr elt) "file-readable-p" (nth 4 elt))) + ;; Result. + (mapcar #'car result)) + + ;; Do it with ls. + (when (tramp-send-command-and-check + v (format (concat + "cd %s 2>&1 && %s -a 2>%s" + " | while IFS= read f; do" + " if %s -d \"$f\" 2>%s;" + " then echo \"$f/\"; else echo \"$f\"; fi;" + " done") + (tramp-shell-quote-argument localname) + (tramp-get-ls-command v) + (tramp-get-remote-null-device v) + (tramp-get-test-command v) + (tramp-get-remote-null-device v))) + + ;; Now grab the output. + (with-current-buffer (tramp-get-buffer v) + (goto-char (point-max)) + (while (zerop (forward-line -1)) + (push + (buffer-substring (point) (line-end-position)) result))) + result)))))))))) ;; cp, mv and ln @@ -2842,7 +2849,8 @@ tramp-sh-handle-expand-file-name ;; appropriate either, because ssh and companions might ;; use a user name from the config file. (when (and (tramp-string-empty-or-nil-p uname) - (string-match-p (rx bos "su" (? "do") eos) method)) + (string-match-p + (rx bos (| "su" "sudo" "doas" "ksu") eos) method)) (setq uname user)) (when (setq hname (tramp-get-home-directory v uname)) (setq localname (concat hname fname))))) @@ -3630,17 +3638,16 @@ tramp-bundle-read-file-names (format "tramp_bundle_read_file_names <<'%s'\n%s\n%s\n" tramp-end-of-heredoc - (mapconcat #'tramp-shell-quote-argument - files - "\n") + (mapconcat #'tramp-shell-quote-argument files "\n") tramp-end-of-heredoc)) (with-current-buffer (tramp-get-connection-buffer vec) ;; Read the expression. (goto-char (point-min)) (read (current-buffer))))) - (tramp-set-file-property - vec (car elt) (cadr elt) (cadr (cdr elt)))))) + (tramp-set-file-property vec (car elt) "file-exists-p" (nth 1 elt)) + (tramp-set-file-property vec (car elt) "file-readable-p" (nth 2 elt)) + (tramp-set-file-property vec (car elt) "file-directory-p" (nth 3 elt))))) (defvar tramp-vc-registered-file-names nil "List used to collect file names, which are checked during `vc-registered'.") @@ -4256,6 +4263,7 @@ tramp-find-file-exists-command vec (format "%s %s" result nonexistent)))))) (tramp-error vec 'file-error "Couldn't find command to check if file exists")) + (tramp-set-file-property vec existing "file-exists-p" t) result)) (defun tramp-get-sh-extra-args (shell) @@ -5647,7 +5655,7 @@ tramp-get-remote-path remote-path :test #'string-equal :from-end t)) ;; Remove non-existing directories. - (let ((remote-file-name-inhibit-cache nil)) + (let (remote-file-name-inhibit-cache) (tramp-bundle-read-file-names vec remote-path) (cl-remove-if (lambda (x) (not (tramp-get-file-property vec x "file-directory-p"))) commit 425c998a1117da6ebbd1489ad2aa3f7e2f8bd594 Author: Michael Albinus Date: Tue Aug 15 12:02:03 2023 +0200 Fix test in files-tests.el * test/lisp/files-tests.el (files-tests-file-name-non-special-unhandled-file-name-directory): Fix test. diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 7fb862e7892..0e460009cea 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1226,8 +1226,8 @@ files-tests-file-name-non-special-unhandled-file-name-directory (file-name-as-directory tmpdir)))) (files-tests--with-temp-non-special-and-file-name-handler (tmpdir nospecial-dir t) - (should (equal (unhandled-file-name-directory nospecial-dir) - (file-name-as-directory tmpdir))))) + (should-not (equal (unhandled-file-name-directory nospecial-dir) + (file-name-as-directory tmpdir))))) (ert-deftest files-tests-file-name-non-special-vc-registered () (files-tests--with-temp-non-special (tmpfile nospecial)