1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00
Commit Graph

2781 Commits

Author SHA1 Message Date
Po Lu
aa872f2540 Properly run emacsclient under Android if DISPLAY is set
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Make
dimensions final, since they are never changed after the
constructor.

* lib-src/emacsclient.c (decode_options): If --display is not
provided, always set display to `android' even if DISPLAY is
provided.

* lisp/net/browse-url.el (browse-url): Cease setting DISPLAY
under Android.

* src/callproc.c (getenv_internal, make_environment_block):
Don't afford DISPLAY special treatment under Android.
2023-09-06 10:31:26 +08:00
Eric S. Raymond
fce3815921 Fix all my attributions to be correct and consistent...
...in case people are trying to track me down for questions.

.mailmap, ChangeLog.1, admin/notes/copyright, doc/emacs/ChangeLog.1,
doc/emacs/ack.texi, doc/lispref/ChangeLog.1, doc/misc/gnus.texi,
etc/ChangeLog.1, lib-src/ChangeLog.1, lisp/ChangeLog.13,
lisp/ChangeLog.14, lisp/ChangeLog.15, lisp/ChangeLog.17,
lisp/ChangeLog.3, lisp/ChangeLog.4, lisp/ChangeLog.5,
lisp/ChangeLog.6, lisp/ChangeLog.7, lisp/emacs-lisp/lisp-mnt.el,
lisp/finder.el, lisp/loadhist.el, lisp/play/cookie1.el,
lisp/progmodes/asm-mode.el, lisp/progmodes/gud.el,
lisp/progmodes/make-mode.el, lisp/term/AT386.el, src/ChangeLog.3
2023-08-08 20:07:52 -04:00
Po Lu
65b58251b1 Update Android port
* configure.ac (ANDROID_STUBIFY): Add androidvfs.o when building
libemacs.so.
* doc/emacs/android.texi (Android): Add `Android Document Providers'.
(Android Startup): Update the location of the content identifier
directory.
(Android File System): Describe access to document provider
directories.
(Android Document Providers): New node.
* doc/emacs/emacs.texi (Top): Update the menu for the Android
appendix.
* java/Makefile.in (filename, install_temp/assets/build_info): Make
directory-tree depend on build_info.
* java/org/gnu/emacs/EmacsActivity.java (onActivityResult): New
function.  When a document tree is accepted, persist access to it.
* java/org/gnu/emacs/EmacsDirectoryEntry.java (EmacsDirectoryEntry):
New struct.
* java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy): Use
EmacsService.buildContentName.
* java/org/gnu/emacs/EmacsService.java (getEmacsView, openContentUri)
(checkContentUri): Remove excessive debug logging.
(buildContentName, getDocumentAuthorities, requestDirectoryAccess)
(getDocumentTrees, decodeFileName, documentIdFromName, getTreeUri)
(statDocument, accessDocument, openDocumentDirectory, readDirectoryEntry)
(openDocument, createDocument): New functions.

* lib-src/asset-directory-tool.c: Improve commentary by illustrating
the difference between directory and ordinary files.

* src/android.c (ANDROID_THROW, enum android_fd_table_entry_flags)
(struct android_emacs_service, android_extract_long)
(android_scan_directory_tree, android_is_directory)
(android_get_asset_name, android_url_encode, android_content_name_p)
(android_get_content_name, android_check_content_access, android_fstat)
(android_fstatat, android_file_access_p, android_hack_asset_fd_fallback)
(android_detect_ashmem, android_hack_asset_fd, android_close_on_exec)
(android_open, android_close, android_fclose, android_create_lib_link)
(android_faccessat, struct android_dir, android_opendir, android_dirfd)
(android_readdir, android_closedir, android_lookup_asset_directory_fd)
(android_exception_check_3, android_get_current_api_level)
(android_open_asset, android_close_asset, android_asset_read_quit)
(android_asset_read, android_asset_lseek, android_asset_fstat): Move
content and asset related functions to androidvfs.c.
(android_init_emacs_service): Obtain handles for new JNI functions.
(initEmacsParams): Initialize the VFS layer.
(android_request_directory_access): New function.
(android_display_toast): Remove unused function.

* src/android.h (android_get_current_api_level): Assume that
this function never returns less than __ANDROID_API__.
(struct android_emacs_service): Move `struct
android_emacs_service' here.

* src/androidfns.c (Fandroid_request_directory_access): New
interactive function.
(syms_of_androidfns): Register new subr.

* src/androidvfs.c (struct android_vdir, struct android_vops)
(struct android_vnode, struct android_special_vnode)
(enum android_vnode_type, struct android_cursor_class)
(struct emacs_directory_entry_class)
(struct android_parcel_file_descriptor_class)
(android_init_cursor_class, android_init_entry_class)
(android_init_fd_class, android_vfs_canonicalize_name)
(struct android_unix_vnode, struct android_unix_vdir, unix_vfs_ops)
(android_unix_name, android_unix_vnode, android_unix_open)
(android_unix_close, android_unix_unlink, android_unix_symlink)
(android_unix_rmdir, android_unix_rename, android_unix_stat)
(android_unix_access, android_unix_mkdir, android_unix_readdir)
(android_unix_closedir, android_unix_dirfd, android_unix_opendir)
(android_extract_long, android_scan_directory_tree)
(android_is_directory, android_init_assets)
(android_hack_asset_fd_fallback, android_detect_ashmem)
(android_hack_asset_fd, struct android_afs_vnode)
(struct android_afs_vdir, struct android_afs_open_fd, afs_vfs_ops)
(android_afs_name, android_afs_initial, android_close_on_exec)
(android_afs_open, android_afs_close, android_afs_unlink)
(android_afs_symlink, android_afs_rmdir, android_afs_rename)
(android_afs_stat, android_afs_access, android_afs_mkdir)
(android_afs_readdir, android_afs_closedir, android_afs_dirfd)
(android_afs_opendir, android_afs_get_directory_name)
(struct android_content_vdir, content_vfs_ops)
(content_directory_contents, android_content_name)
(android_content_open, android_content_close)
(android_content_unlink, android_content_symlink)
(android_content_rmdir, android_content_rename)
(android_content_stat, android_content_access)
(android_content_mkdir, android_content_readdir)
(android_content_closedir, android_content_dirfd)
(android_content_opendir, android_content_get_directory_name)
(android_content_initial, android_get_content_name)
(android_check_content_access, struct android_authority_vnode)
(authority_vfs_ops, android_authority_name, android_authority_open)
(android_authority_close, android_authority_unlink)
(android_authority_symlink, android_authority_rmdir)
(android_authority_rename, android_authority_stat)
(android_authority_access, android_authority_mkdir)
(android_authority_opendir, android_authority_initial)
(struct android_saf_root_vnode, struct android_saf_root_vdir)
(saf_root_vfs_ops, android_saf_root_name, android_saf_root_open)
(android_saf_root_close, android_saf_root_unlink)
(android_saf_root_symlink, android_saf_root_rmdir)
(android_saf_root_rename, android_saf_root_stat)
(android_saf_root_access, android_saf_root_mkdir)
(android_saf_root_readdir, android_saf_root_closedir)
(android_saf_root_dirfd, android_saf_root_opendir)
(android_saf_root_initial, android_saf_root_get_directory)
(android_saf_stat, android_saf_access)
(struct android_saf_tree_vnode, struct android_saf_tree_vdir)
(saf_tree_vfs_ops, android_document_id_from_name)
(android_saf_tree_name, android_saf_tree_open)
(android_saf_tree_close, android_saf_tree_unlink)
(android_saf_tree_symlink, android_saf_tree_rmdir)
(android_saf_tree_rename, android_saf_tree_stat)
(android_saf_tree_access, android_saf_tree_mkdir)
(android_saf_tree_opendir_1, android_saf_tree_readdir)
(android_saf_tree_closedir, android_saf_tree_dirfd)
(android_saf_tree_opendir, android_saf_tree_from_name)
(android_saf_tree_get_directory, android_saf_file_vnode)
(saf_file_vfs_ops, android_saf_file_name, android_saf_file_open)
(android_saf_file_unlink, android_saf_file_rmdir)
(android_saf_file_opendir, android_close_parcel_fd)
(android_saf_new_vnode, android_saf_new_name, android_saf_new_open)
(android_saf_new_unlink, android_saf_new_symlink)
(android_saf_new_rmdir, android_saf_new_rename)
(android_saf_new_stat, android_saf_new_access)
(android_saf_new_mkdir, android_saf_new_opendir, root_vfs_ops)
(special_vnodes, android_root_name, android_name_file)
(android_vfs_init, android_open, android_unlink, android_symlink)
(android_rmdir, android_mkdir, android_renameat_noreplace)
(android_rename, android_fstat, android_fstatat_1, android_fstatat)
(android_faccessat, android_fdopen, android_close, android_fclose)
(android_open_asset, android_close_asset, android_asset_read_quit)
(android_asset_read, android_asset_lseek, android_asset_fstat)
(android_opendir, android_dirfd, android_readdir)
(android_closedir): Move file system emulation routines here.
Introduce a new ``VFS'' layer for translating between
Emacs-specific file names and the various disparate interfaces
for accessing files on Android.

* src/callproc.c (delete_temp_file):
* src/charset.c (load_charset_map_from_file):
* src/dired.c:
* src/emacs.c (Fkill_emacs):
* src/fileio.c (check_mutable_filename, Fcopy_file)
(Fmake_directory_internal, Fdelete_directory_internal)
(Fdelete_file, Frename_file, Fadd_name_to_file)
(Fmake_symbolic_link, file_accessible_directory_p, Fset_file_modes)
(Fset_file_times, write_region):
* src/filelock.c (get_boot_time, rename_lock_file)
(create_lock_file, current_lock_owner, unlock_file):
* src/image.c (slurp_file, png_load_body, jpeg_load_body):
* src/keyboard.c (Fopen_dribble_file):
* src/lisp.h:
* src/lread.c (Fload):
* src/process.c (handle_child_signal):
* src/sysdep.c (init_standard_fds, emacs_fopen, emacs_fdopen)
(emacs_unlink, emacs_symlink, emacs_rmdir, emacs_mkdir)
(emacs_renameat_noreplace, emacs_rename):
* src/term.c (Fresume_tty, init_tty): Use and add new wrappers
for fopen, fdopen, unlink, symlink, rmdir, mkdir,
renameat_norepalce and rename.
2023-07-27 17:13:39 +08:00
Po Lu
d067b2fca0 * lib-src/Makefile.in (seccomp-filter$(EXEEXT)): Link with Gnulib. 2023-06-19 16:41:58 +08:00
Po Lu
074c0268fd Merge remote-tracking branch 'origin/master' into feature/android 2023-05-18 09:04:57 +08:00
Paul Eggert
5ef169ed70 Prefer C23 ckd_* to Gnulib *_WRAPV macros
C23 has added ckd_add etc. macros with functionality equivalent to
the older Gnulib INT_ADD_WRAPV macros, so switch to the
more-standard names.
* admin/merge-gnulib (GNULIB_MODULES): Add stdckdint.
This merely makes the dependency explicit, as we were already
using this Gnulib module indirectly.
* lib-src/etags.c, src/lisp.h: Include stdckdint.h.
* lib-src/etags.c (xnmalloc, xnrealloc):
* src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string)
(mark_memory):
* src/bignum.c (emacs_mpz_pow_ui):
* src/buffer.c (record_overlay_string, overlay_strings):
* src/bytecode.c (exec_byte_code):
* src/casefiddle.c (do_casify_multibyte_string):
* src/ccl.c (ccl_driver, Fccl_execute_on_string):
* src/character.c (char_width, c_string_width)
(lisp_string_width, count_size_as_multibyte)
(string_escape_byte8):
* src/cmds.c (internal_self_insert):
* src/coding.c (coding_alloc_by_realloc, produce_chars):
* src/data.c (arith_driver):
* src/dispnew.c (realloc_glyph_pool, init_display_interactive):
* src/doprnt.c (parse_format_integer):
* src/editfns.c (Freplace_buffer_contents, str2num)
(styled_format):
* src/emacs-module.c (module_global_reference_p)
(module_make_global_ref, module_funcall):
* src/eval.c (max_ensure_room):
* src/fileio.c (blocks_to_bytes):
* src/fns.c (Ffillarray):
* src/font.c (font_intern_prop):
* src/frame.c (check_frame_pixels):
* src/gnutls.c (gnutls_hex_string, gnutls_symmetric_aead):
* src/gtkutil.c (get_utf8_string):
* src/haikuterm.c (haiku_term_init):
* src/image.c (xbm_scan, image_to_emacs_colors)
(image_detect_edges, png_load_body):
* src/keyboard.c (Frecursion_depth):
* src/keymap.c (Flookup_key, Fkey_description):
* src/lisp.h (modiff_incr, SAFE_ALLOCA_LISP_EXTRA):
* src/lread.c (read_bool_vector):
* src/pgtkterm.c (pgtk_term_init):
* src/regex-emacs.c (regex_compile):
* src/term.c (encode_terminal_code):
* src/termcap.c (tputs):
* src/textconv.c (textconv_query):
* src/timefns.c (timespec_ticks, lisp_time_hz_ticks)
(Fdecode_time, check_tm_member):
* src/tparam.c (tparam1):
* src/w32term.c (w32_initialize_display_info):
* src/xdisp.c (fill_column_indicator_column, decode_mode_spec):
* src/xselect.c (selection_data_size, x_property_data_to_lisp):
* src/xsmfns.c (smc_save_yourself_CB):
* src/xterm.c (xm_setup_dnd_targets, x_sync_get_monotonic_time)
(x_sync_current_monotonic_time, x_sync_note_frame_times)
(x_display_set_last_user_time, x_term_init):
Prefer the C23 stdckdint macros to their
Gnulib intprops.h counterparts, since C23 is standard.
2023-05-17 15:41:00 -07:00
Po Lu
a46e231a5f Merge remote-tracking branch 'origin/master' into feature/android 2023-05-15 10:38:10 +08:00
Paul Eggert
92d4bda279 Fix movemail fd leak
* lib-src/movemail.c (main) [!MAIL_USE_SYSTEM_LOCK]:
Fix file descriptor leak, found by GCC 13 -Wanalyzer-fd-leak.
2023-05-14 19:28:10 -07:00
Paul Eggert
3e3f34d71e Fix ebrowse -f buffer overflow
* lib-src/ebrowse.c (main): Fix buffer overflow when several -f
options are given.  Found by GCC 13 -Wanalyzer-allocation-size.
2023-05-14 19:28:10 -07:00
Po Lu
d7457e1ce4 Merge remote-tracking branch 'origin/master' into feature/android 2023-03-24 10:46:14 +08:00
Eli Zaretskii
e340354299 Fix compilation of lib-src/movemail
* lib-src/movemail.c: Include timespec.h.  Reported by Andreas
Schwab <schwab@linux-m68k.org>.
2023-03-22 17:26:22 +02:00
Paul Eggert
640fd9b594 Sleep less in update-game-score
This is mostly to avoid interface hassles with time/srand/rand.
* lib-src/update-game-score.c (main): Don’t use ‘srand’ or ‘time’.
(lock_file): Don’t sleep if we unlocked the lock file.  When
sleeping, always just sleep 1 s.  This avoids the need for calling
‘time’ and ‘rand’, the utility of which was dubious anyway.
2023-03-21 14:42:18 -07:00
Paul Eggert
2e8cc206f5 Avoid backwards clock in movemail timestamps
* lib-src/movemail.c (mbx_delimit_begin): Use ‘current_timespec’
instead of ‘time’ to generate the user-visible timestamp.
This works around the minor glitch caused by glibc bug 30200
<https://sourceware.org/bugzilla/show_bug.cgi?id=30200>.
2023-03-21 14:42:17 -07:00
Po Lu
8fbac937fb Port to systems without endian.h
* lib-src/asset-directory-tool.c (main_2): Port to systems
without htole32.
2023-03-15 15:38:19 +08:00
Po Lu
7c8cc9a633 Merge remote-tracking branch 'origin/master' into feature/android 2023-03-06 16:06:37 +08:00
Stefan Kangas
aad617870b Merge from origin/emacs-29
1c67e4f895 Fix c-ts-mode indentation
d724d7d678 Fix c-ts-mode indentation
7292b24c80 Fix c-ts-mode indentation
75cdc1afbe ; Change font-lock-variable-name-face to font-lock-variab...
b1b3af5b90 Update to Org 9.6.1-40-g3d817c
80e1037df4 Add string-interpolation feature to bash-ts-mode
5b8e0b3154 Fix tramp-sh-handle-insert-directory
2258ed01f4 ; Minor fix of last change
9c18af0cfa * Warn when certain primitives are redefined (bug#61880)
5af695c747 ; * lib-src/etags.c (print_help): Fix indentation.
2023-03-06 06:30:13 +01:00
Eli Zaretskii
5af695c747 ; * lib-src/etags.c (print_help): Fix indentation. 2023-03-05 08:43:03 +02:00
Po Lu
03c0cb8671 Merge remote-tracking branch 'origin/master' into feature/android 2023-02-28 18:20:25 +08:00
Stefan Kangas
c640dc9ef5 Merge from origin/emacs-29
267fc6d00c ruby-smie-rules: Fix misindentation of a method call afte...
0fde314f6f * lib-src/etags.c (process_file_name): Free malloc'ed var...
dde9d149af ; Improve documentation of loading *.eln files
7c552be89d ; Another doc fix in eglot.el
75c65fcc98 ; Fix last change
a3d15c1f74 ; Fix last change
ca79b138d4 Eglot: rename and redocument encoding-related functions (...
3e3e6d71be Eglot: support positionEncoding LSP capability (bug#61726)
b0e87e930e Eglot: use faster strategy for moving to LSP positions (b...
5b174b9683 Fix mule-tests in UTF-8 locales
5256392a7e Fix 'vertical-motion' when display strings are around
0db88d625a ; * src/treesit.c (treesit_predicate_match): Fix typo.
2023-02-27 06:30:20 +01:00
Eli Zaretskii
0fde314f6f * lib-src/etags.c (process_file_name): Free malloc'ed vars (bug#61819). 2023-02-26 20:03:20 +02:00
Po Lu
28f6add67f Merge remote-tracking branch 'origin/master' into feature/android 2023-02-26 14:11:18 +08:00
Paul Eggert
b26d0dd583 Omit no-longer-needed SEEK_END workaround
* lib-src/ebrowse.c (SEEK_END): Remove; no longer needed
on any supported SunOS version.
2023-02-25 17:13:29 -08:00
Po Lu
420533a8f9 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/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 23:32:07 +08:00
Po Lu
2b00f66926 Improve lib-src/Makefile.in
* lib-src/Makefile.in (DONT_INSTALL):
(clean): Correctly define asset-directory-tool.
2023-01-24 10:40:44 +08:00
Po Lu
a496509ced 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
explicitly specified.

* doc/emacs/android.texi (Android): Add reference to ``Other
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.

* java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems):
* java/org/gnu/emacs/EmacsCopyArea.java (perform):
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog):
* java/org/gnu/emacs/EmacsDrawLine.java (perform):
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform):
* 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/EmacsSdk7FontDriver.java (draw): Avoid
redundant canvas saves and restores.
* java/org/gnu/emacs/EmacsService.java (run):
* java/org/gnu/emacs/EmacsView.java (EmacsView):
(handleDirtyBitmap):
* java/org/gnu/emacs/EmacsWindow.java (changeWindowBackground)
(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.
* 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/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]):
([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):
(widget-button-click): Improve touchscreen support.

* src/alloc.c (make_lisp_symbol): Avoid ICE on Android NDK GCC.
(mark_pinned_symbols): Likewise.

* src/android.c (struct android_emacs_window): New struct.
(window_class): New variable.
(android_run_select_thread): Add workaround for Android platform
bug.
(android_extract_long, android_scan_directory_tree): New
functions.
(android_file_access_p): Use those functions instead.
(android_init_emacs_window): New function.
(android_init_emacs_gc_class): Update signature of `markDirty'.
(android_change_gc, android_set_clip_rectangles): Tell the GC
whether or not clip rects were dirtied.
(android_swap_buffers): Do not look up method every time.
(struct android_dir): Adjust for new directory tree lookup.
(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.

* src/sfnt.c (main): Improve tests.

* src/sfntfont-android.c (sfntfont_android_put_glyphs): Fix
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'.
(sfnt_parse_style): Append tokens to adstyle.
(sfnt_parse_languages): New function.
(sfnt_enum_font_1): Parse supported languages and adstyle.
(sfntfont_list_1): Handle new fields.
(sfntfont_text_extents): Fix uninitialized variable use.
(syms_of_sfntfont, mark_sfntfont): Adjust accordingly.
2023-01-19 22:19:06 +08:00
Po Lu
4c09b9a5a6 Merge remote-tracking branch 'origin/master' into feature/android 2023-01-08 15:43:57 +08:00
Paul Eggert
5d1e14bd8b Adjust to recent Gnulib macro renaming
Also, remove some references to unused Gnulib macros.
2023-01-07 15:32:56 -08:00
Paul Eggert
39b77970c6 Port to current Gnulib file-has-acl
* lib-src/Makefile.in (FILE_HAS_ACL_LIB): Rename from LIB_HAS_ACL,
to adjust to recent Gnulib renaming.  All uses changed.
2023-01-06 18:05:57 -08:00
Po Lu
6d823d1077 Merge remote-tracking branch 'origin/master' into feature/android 2023-01-02 21:38:37 +08:00
Eli Zaretskii
3c55fbd4ad Merge from origin/emacs-29
cae528457c ; Add 2023 to copyright years.
b394359261 Improve documentation of 'isearch-open-overlay-temporary'
ab3210e709 Document 'use-package' in the 2 main manuals

# Conflicts:
#	etc/refcards/ru-refcard.tex
#	lib/explicit_bzero.c
#	m4/explicit_bzero.m4
2023-01-01 05:47:47 -05:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Po Lu
cfbc8a5dbc Bring up the Android operating system and its window system
* .dir-locals.el (c-mode): Add ANDROID_EXPORT noise macro.
* .gitignore: Add new files to ignore.
* Makefile.in: Adjust for Android.
* admin/merge-gnulib: Add new warning.
* configure.ac: Detect Android.  Run cross-configuration for
Android when appropriate.

* etc/DEBUG: Document how to debug Emacs on Android.

* java/AndroidManifest.xml:
* java/Makefile.in:
* java/README:
* java/debug.sh:
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity):
* java/org/gnu/emacs/EmacsApplication.java (EmacsApplication):
* java/org/gnu/emacs/EmacsCopyArea.java (EmacsCopyArea):
* java/org/gnu/emacs/EmacsDrawLine.java (EmacsDrawLine):
* java/org/gnu/emacs/EmacsDrawPoint.java (EmacsDrawPoint):
* java/org/gnu/emacs/EmacsDrawRectangle.java
(EmacsDrawRectangle):
* java/org/gnu/emacs/EmacsDrawable.java (EmacsDrawable):
* java/org/gnu/emacs/EmacsFillPolygon.java (EmacsFillPolygon):
* java/org/gnu/emacs/EmacsFillRectangle.java
(EmacsFillRectangle):
* java/org/gnu/emacs/EmacsFontDriver.java (EmacsFontDriver):
* java/org/gnu/emacs/EmacsGC.java (EmacsGC):
* java/org/gnu/emacs/EmacsHandleObject.java (EmacsHandleObject):
* java/org/gnu/emacs/EmacsNative.java (EmacsNative):
* java/org/gnu/emacs/EmacsPaintQueue.java (EmacsPaintQueue):
* java/org/gnu/emacs/EmacsPaintReq.java (EmacsPaintReq):
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap):
* java/org/gnu/emacs/EmacsSdk7FontDriver.java
(EmacsSdk7FontDriver):
* java/org/gnu/emacs/EmacsService.java (class Holder<T>)
(EmacsService):
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
* java/org/gnu/emacs/EmacsThread.java (EmacsThread):
* java/org/gnu/emacs/EmacsView.java (EmacsView):
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): New files
and classes.

* lib-src/Makefile.in (srcdir):
* lib/Makefile.in (VPATH):
(HAVE_NATIVE_COMP):
(libgnu_a_SOURCES):
(DEPFLAGS): Configure correctly for cross-compiling.

* lib/faccessat.c:
* lib/fpending.c (__fpending):
* lib/open.c:
* lib/unistd.c (_GL_UNISTD_INLINE): Temporary adjustments to
gnulib.

* lisp/frame.el (display-graphic-p):
(display-screens):
(display-pixel-height):
(display-pixel-width):
(display-mm-height):
(display-mm-width):
(display-backing-store):
(display-save-under):
(display-planes):
(display-color-cells):
(display-visual-class): Adjust for new window system `android'.

* lisp/image/wallpaper.el (x-open-connection): Add declaration.
* lisp/loadup.el (featurep): Load up files for Android.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Adjust faces for android.
* lisp/term/android-win.el: New file.
* src/Makefile.in: Add new targets emacs.so and android-emacs,
then adjust for cross compilation.
* src/alloc.c (cleanup_vector): Clean up Android font entities
as well.
(garbage_collect): Mark androidterm.
* src/android-emacs.c (main):
* src/android.c (ANDROID_THROW, enum android_fd_table_entry_flags)
(struct android_emacs_service, struct android_emacs_pixmap)
(struct android_graphics_point, struct android_event_container)
(struct android_event_queue, android_run_select_thread)
(android_handle_sigusr1, android_init_events, android_pending)
(android_next_event, android_write_event, android_select)
(android_run_debug_thread, android_user_full_name)
(android_get_asset_name, android_fstat, android_fstatat)
(android_file_access_p, android_hack_asset_fd, android_open)
(android_close, JNICALL, android_init_emacs_service)
(android_init_emacs_pixmap, android_init_graphics_point)
(MAX_HANDLE, struct android_handle_entry, android_alloc_id)
(android_destroy_handle, android_resolve_handle)
(android_resolve_handle2, android_change_window_attributes)
(android_create_window, android_set_window_background)
(android_destroy_window, android_init_android_rect_class)
(android_init_emacs_gc_class, android_create_gc, android_free_gc)
(android_change_gc, android_set_clip_rectangles)
(android_reparent_window, android_lookup_method)
(android_clear_window, android_map_window, android_unmap_window)
(android_resize_window, android_move_window, android_swap_buffers)
(android_get_gc_values, android_set_foreground)
(android_fill_rectangle, android_create_pixmap_from_bitmap_data)
(android_set_clip_mask, android_set_fill_style, android_copy_area)
(android_free_pixmap, android_set_background, android_fill_polygon)
(android_draw_rectangle, android_draw_point, android_draw_line)
(android_create_pixmap, android_set_ts_origin, android_clear_area):
* src/android.h (ANDROID_EXPORT):
* src/androidfns.c (android_display_info_for_name)
(check_android_display_info, check_x_display_info, gamma_correct)
(android_defined_color, android_decode_color)
(android_implicitly_set_name, android_explicitly_set_name)
(android_set_tool_bar_lines, android_change_tool_bar_height)
(android_set_tab_bar_lines, android_change_tab_bar_height)
(android_set_scroll_bar_default_height)
(android_set_scroll_bar_default_width, android_icon_verify)
(android_icon, android_make_gc, android_free_gcs)
(unwind_create_frame, do_unwind_create_frame)
(android_default_font_parameter, android_create_frame_window)
(Fx_create_frame, Fxw_color_defined_p, Fxw_color_values)
(Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells, Fx_display_screens)
(Fx_display_mm_width, Fx_display_mm_height)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_monitor_attributes_list, Fx_frame_geometry)
(Fx_frame_list_z_order, Fx_frame_restack)
(Fx_mouse_absolute_pixel_position)
(Fx_set_mouse_absolute_pixel_position, Fandroid_get_connection)
(Fx_display_list, Fx_show_tip, Fx_hide_tip)
(android_set_background_color, android_set_border_color)
(android_set_cursor_color, android_set_cursor_type)
(android_set_foreground_color)
(android_set_child_frame_border_width)
(android_set_internal_border_width, android_set_menu_bar_lines)
(android_set_mouse_color, android_set_title, android_set_alpha)
(android_frame_parm_handlers, syms_of_androidfns):
* src/androidfont.c (struct android_emacs_font_driver)
(struct android_emacs_font_spec, struct android_emacs_font_metrics)
(struct android_emacs_font_object, struct android_integer)
(struct androidfont_info, struct androidfont_entity)
(android_init_font_driver, android_init_font_spec)
(android_init_font_metrics, android_init_integer)
(android_init_font_object, androidfont_get_cache)
(androidfont_from_lisp, androidfont_from_java, androidfont_list)
(androidfont_match, androidfont_draw, androidfont_open_font)
(androidfont_close_font, androidfont_has_char)
(androidfont_encode_char, androidfont_text_extents)
(androidfont_list_family, androidfont_driver)
(syms_of_androidfont_for_pdumper, syms_of_androidfont)
(init_androidfont, android_finalize_font_entity):
* src/androidgui.h (_ANDROID_GUI_H_, struct android_rectangle)
(struct android_point, enum android_gc_function)
(enum android_gc_value_mask, enum android_fill_style)
(enum android_window_value_mask)
(struct android_set_window_attributes, struct android_gc_values)
(struct android_gc, enum android_swap_action, enum android_shape)
(enum android_coord_mode, struct android_swap_info)
(NativeRectangle, struct android_any_event)
(struct android_key_event, struct android_configure_event)
(union android_event):
* src/androidterm.c (android_window_to_frame, android_clear_frame)
(android_ring_bell, android_toggle_invisible_pointer)
(android_update_begin, android_update_end, show_back_buffer)
(android_flush_dirty_back_buffer_on, handle_one_android_event)
(android_read_socket, android_frame_up_to_date)
(android_buffer_flipping_unblocked_hook)
(android_query_frame_background_color, android_parse_color)
(android_alloc_nearest_color, android_query_colors)
(android_mouse_position, android_get_focus_frame)
(android_focus_frame, android_frame_rehighlight)
(android_frame_raise_lower, android_make_frame_visible)
(android_make_frame_invisible)
(android_make_frame_visible_invisible, android_fullscreen_hook)
(android_iconify_frame, android_set_window_size_1)
(android_set_window_size, android_set_offset, android_set_alpha)
(android_new_font, android_bitmap_icon, android_free_pixmap_hook)
(android_free_frame_resources, android_delete_frame)
(android_delete_terminal, android_scroll_run)
(android_after_update_window_line, android_flip_and_flush)
(android_clear_rectangle, android_reset_clip_rectangles)
(android_clip_to_row, android_draw_fringe_bitmap)
(android_set_cursor_gc, android_set_mouse_face_gc)
(android_set_mode_line_face_gc, android_set_glyph_string_gc)
(android_set_glyph_string_clipping)
(android_set_glyph_string_clipping_exactly)
(android_compute_glyph_string_overhangs)
(android_clear_glyph_string_rect)
(android_draw_glyph_string_background, android_fill_triangle)
(android_make_point, android_inside_rect_p, android_clear_point)
(android_draw_relief_rect, android_draw_box_rect)
(HIGHLIGHT_COLOR_DARK_BOOST_LIMIT, android_setup_relief_color)
(android_setup_relief_colors, android_draw_glyph_string_box)
(android_draw_glyph_string_bg_rect, android_draw_image_relief)
(android_draw_image_foreground, android_draw_image_foreground_1)
(android_draw_image_glyph_string)
(android_draw_stretch_glyph_string, android_draw_underwave)
(android_draw_glyph_string_foreground)
(android_draw_composite_glyph_string_foreground)
(android_draw_glyphless_glyph_string_foreground)
(android_draw_glyph_string, android_define_frame_cursor)
(android_clear_frame_area, android_clear_under_internal_border)
(android_draw_hollow_cursor, android_draw_bar_cursor)
(android_draw_window_cursor, android_draw_vertical_window_border)
(android_draw_window_divider, android_redisplay_interface)
(frame_set_mouse_pixel_position, get_keysym_name)
(android_create_terminal, android_term_init, syms_of_androidterm)
(mark_androidterm):
* src/androidterm.h (_ANDROID_TERM_H_, struct android_display_info)
(struct android_output, FRAME_ANDROID_OUTPUT, XSCROLL_BAR): New
files.
* src/dired.c (file_attributes): Do not use openat on Android.
* src/dispextern.h (No_Cursor): Define appropriately on Android.
(struct glyph_string, struct face): Make gc field of type struct
android_gc on Android.
* src/dispnew.c (clear_current_matrices, clear_desired_matrices)
(adjust_frame_glyphs_for_window_redisplay, free_glyphs)
(update_frame, scrolling, char_ins_del_cost, update_frame_line)
(init_display_interactive): Disable text terminal support
completely on Android.  Fix non-toolkit menus for non-X systems.
* src/editfns.c (Fuser_full_name): Call android_user_full_name.
* src/emacs.c (android_emacs_init): Make main this on Android.
Prohibit argv sorting from exceeding end of argv.
* src/epaths.in: Add path definitions for Android.

* src/fileio.c (file_access_p): Call android_file_access_p.
(file_name_directory): Avoid using openat on Android.
(Fcopy_file): Adjust to call sys_fstat instead.
(file_directory_p):
(Finsert_file_contents):
(write_region): Likewise.
* src/filelock.c:
* src/fns.c (Flocale_info): Pacify warning on Android.
* src/font.c (font_make_entity_android): New function.
* src/font.h:
* src/frame.c (Fframep):
(Fwindow_system): Handle new window system `android'.  Update doc strings.
(Fmake_terminal_frame): Disable on Android.
(gui_display_get_resource): Disable get_string_resource_hook on Android.
(syms_of_frame): New defsym `android'.

* src/frame.h (GCALIGNED_STRUCT): Add new output data for
Android.
(ENUM_BF): Expand enumerator size.
(FRAME_ANDROID_P, FRAME_WINDOW_P, MOUSE_HL_INFO): Add
definitions for Android.

* src/image.c (GET_PIXEL):
(image_create_bitmap_from_file):
(image_create_x_image_and_pixmap_1):
(image_get_x_image):
(slurp_file):
(lookup_rgb_color):
(image_to_emacs_colors):
(image_from_emacs_colors):
(image_pixmap_draw_cross):
(image_disable_image):
(MaskForeground):
(gif_load): Add stubs for Android.

* src/lisp.h:
* src/lread.c (safe_to_load_version, maybe_swap_for_eln1, openp):
* src/pdumper.c (pdumper_load): Call sys_fstat instead of fstat.
* src/process.c (wait_reading_process_output): Use
android_select instead of pselect.
* src/scroll.c: Disable on Android.
* src/sysdep.c (widen_foreground_group, reset_sys_modes)
(init_signals, emacs_fstatat, sys_fstat): New function.
(emacs_open, emacs_open_noquit, emacs_close): Implement
differently on Android.
(close_output_streams): Disable what is not required on Android.

* src/term.c (OUTPUT1_IF, encode_terminal_code, string_cost)
(string_cost_one_line, per_line_cost, calculate_costs)
(struct fkey_table, tty_append_glyph, produce_glyphs)
(tty_capable_p, Fsuspend_tty, Fresume_tty, device, init_tty)
(maybe_fatal, syms_of_term): Disable text terminal support on
Android.

* src/termhooks.h (enum output_method): Add android output
method.
(GCALIGNED_STRUCT, TERMINAL_FONT_CACHE): Define for Android.

* src/terminal.c (Fterminal_live_p): Implement for Android.

* src/verbose.mk.in (AM_V_GLOBALS): Add JAVAC and DX.
* src/xdisp.c (redisplay_internal): Disable text terminals on Android.
(display_menu_bar):
(display_tty_menu_item):
(draw_row_with_mouse_face):
(expose_frame): Make the non toolkit menu bar work on Android.

* src/xfaces.c (GCGraphicsExposures):
(x_create_gc):
(x_free_gc):
(Fx_load_color_file): Define for Android.

* xcompile/Makefile.in (top_srcdir):
(top_builddir):
* xcompile/README:
* xcompile/langinfo.h (nl_langinfo): New files.
2022-12-31 18:04:18 +08:00
Po Lu
825afc84d0 ; * lib-src/etags.c (do_move_file): Fix coding style. 2022-12-17 09:49:08 +08:00
Philipp Stephani
940d9070e9 Support newer glib versions (Bug#59061)
* lib-src/seccomp-filter.c (main): Allow pidfd_open system call
2022-12-09 19:32:14 +01:00
Stefan Kangas
40af27859e ; * lib-src/etags.c (escape_shell_arg_string): Minor doc fix. 2022-12-06 18:05:08 +01:00
Mattias Engdegård
43b7e7efbf Fix etags builds on non-Windows non-MS-DOS machines
* lib-src/etags.c: In this file, MSDOS is always defined but can be
either `true` or `false`, so don't used `defined MSDOS` as a condition.
2022-12-06 17:37:22 +01:00
Eli Zaretskii
7e6d1d1c47 ; Fix last change in etags.c. 2022-12-06 18:13:41 +02:00
lu4nx
01a4035c86 Fix etags local command injection vulnerability
* lib-src/etags.c: (escape_shell_arg_string): New function.
(process_file_name): Use it to quote file names passed to the
shell.  (Bug#59817)
2022-12-06 18:07:45 +02:00
Stefan Kangas
70ecdebc92 ; Fix typos (don't abbreviate "with" or "without") 2022-12-01 16:36:09 +01:00
Po Lu
afc7ed987b Allow be-resources to fail
* lib-src/be_resources.cc (be_perror): Print additional blurb.
(main): Return 0 on failure as well, but print the blurb.
Problem reported by the Haiku packager.
2022-11-29 06:26:16 +00:00
Gregory Heytings
5f97a085be Fix incompatible -t and -r options in emacsclient
* lib-src/emacsclient.c (decode_options): Do not allow -t and -r
together.
2022-11-28 00:16:00 +01:00
Eli Zaretskii
6f0906be51 ; Fix last change in etags.c
* lib-src/etags.c (cleanup_tags_file): Renamed from
clean_matched_file_tag.

* test/manual/etags/CTAGS.good_update:
* test/manual/etags/CTAGS.good_crlf: Update to match the test.
2022-11-27 15:43:39 +02:00
lu4nx
d48bb4874b Fixed ctags local command execute vulnerability
* lib-src/etags.c:

(clean_matched_file_tag): New function
(do_move_file): New function
(readline_internal):
Add `leave_cr` parameter, if true, include the \r character

* test/manual/etags/CTAGS.good_crlf: New file
* test/manual/etags/CTAGS.good_update: New file
* test/manual/etags/crlf: New file
* test/manual/etags/Makefile: Add `ctags -u` test cases
2022-11-27 15:20:49 +02:00
Shohei YOSHIDA
bacba02e5c * lib-src/emacsclient.c (print_help_and_exit): Fix --timeout. 2022-11-27 15:17:40 +02:00
lu4nx
6e82403013 ; Clean up unused function: cuserid
* lib-src/ntlib.c (cuserid): Remove unused function.
2022-11-26 16:28:45 +02:00
lu4nx
325515f979 Support Racket programs in 'etags'
* lib-src/ctags.c (Scheme_suffixes): Add the Racket language
extension ".rkt".

Copyright-paperwork-exempt: yes
2022-11-23 20:31:18 +02:00
Stefan Kangas
5e8c62ffca ; Fix typos 2022-11-23 05:49:22 +01:00
Stefan Kangas
40539c7587 ; Fix typos 2022-11-22 02:24:20 +01:00
Eli Zaretskii
1682bd18f5 Fix encoding and display of messages sent by server to emacsclient
* lisp/server.el (server-start): Use 'locale-coding-system' to
encode messages sent back to the client.

* lib-src/emacsclient.c (main): Print '-error' messages via
'message', not directly via 'fprintf'.  This shows the error on
MS-Windows when the client is invoked as 'emacsclientw', since
stderr goes to the bit bucket in that case.
2022-11-19 21:34:07 +02:00
Jan Stranik
8a6c5be683 Support multi-line C++11 strings in Ebrowse
* lib-src/ebrowse.c (yylex): Support C++11 multi-line strings.
(bug#58847)
2022-11-17 12:07:45 +02:00