]> git.eshelyaron.com Git - emacs.git/log
emacs.git
22 months agoFix crash during androidterm init
Po Lu [Sun, 12 Mar 2023 02:45:26 +0000 (10:45 +0800)]
Fix crash during androidterm init

* src/androidterm.c (syms_of_androidterm): Initialize
Vandroid_build_fingerprint in case GC happens.

22 months ago; * src/emacs-module.c (module_reset_handlerlist): Fix macro conflict.
Po Lu [Sun, 12 Mar 2023 02:39:56 +0000 (10:39 +0800)]
; * src/emacs-module.c (module_reset_handlerlist): Fix macro conflict.

22 months agoClean up emacs-module.c
Po Lu [Sun, 12 Mar 2023 02:37:18 +0000 (10:37 +0800)]
Clean up emacs-module.c

* src/emacs-module.c (MODULE_HANDLE_NONLOCAL_EXIT)
(module_make_global_ref, module_free_global_ref)
(module_make_function, module_get_function_finalizer)
(module_set_function_finalizer, module_make_interactive)
(module_funcall, module_intern, module_type_of)
(module_extract_integer, module_make_integer, module_extract_float)
(module_make_float, module_copy_string_contents)
(module_make_string, module_make_unibyte_string)
(module_make_user_ptr, module_get_user_ptr, module_set_user_ptr)
(module_get_user_finalizer, module_set_user_finalizer)
(module_vec_set, module_vec_get, module_vec_size)
(module_process_input, module_extract_time, module_make_time)
(module_extract_big_integer, module_make_big_integer)
(module_open_channel, module_reset_handlerlist): Adjust as
recommended by Paul Eggert <eggert@cs.ucla.edu>.

22 months agoUpdate Android port
Po Lu [Sun, 12 Mar 2023 01:53:41 +0000 (09:53 +0800)]
Update Android port

* configure.ac: Take option `--with-shared-user-id' and give it
to AndroidManifest.xml.in.
* java/AndroidManifest.xml.in: Substitute that into the
application info.
* java/INSTALL (BUILDING WITH A SHARED USER ID): New section.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sat, 11 Mar 2023 11:08:24 +0000 (19:08 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoImprove default value of `with_mailutils' on Android
Po Lu [Sat, 11 Mar 2023 10:58:18 +0000 (18:58 +0800)]
Improve default value of `with_mailutils' on Android

* configure.ac: Default to off on Android.

22 months ago; * configure.ac: Fix typo.
Po Lu [Sat, 11 Mar 2023 09:43:15 +0000 (17:43 +0800)]
; * configure.ac: Fix typo.

22 months agoUpdate Android port
Po Lu [Sat, 11 Mar 2023 09:42:24 +0000 (17:42 +0800)]
Update Android port

* configure.ac (HAVE_MAILUTILS, with_mailutils)
(ANDROID_SDK_8_OR_EARLIER, XCONFIGURE): Fix POP and mailutils
configuration on Android.
* java/Makefile.in:
* src/callproc.c (syms_of_callproc): Avoid using built-in
movemail when --with-mailutils.

22 months agoRemove recursion from character escape handling in reader
Mattias Engdegård [Fri, 10 Mar 2023 16:10:30 +0000 (17:10 +0100)]
Remove recursion from character escape handling in reader

This cures a C stack overflow when reading certain long (crafted)
strings (bug#62039) and improves performance of reading escaped
characters in character and string literals.
Reported by Bruno Haible.

* src/lread.c (invalid_escape_syntax_error): New.
(read_escape): Rename to...
(read_char_escape): ...this.  Remove recursion.  Pass read-ahead char
as argument.  Improve code performance and clarity.
(read_char_literal, read_string_literal): Update calls.
* test/src/lread-tests.el (lread-char-modifiers)
(lread-many-modifiers): Add test cases.

22 months agoUpdate Android port
Po Lu [Sat, 11 Mar 2023 07:56:53 +0000 (15:56 +0800)]
Update Android port

* src/android.c (android_resolve_handle)
(android_resolve_handle2): Don't perform checking done by
CheckJNI by default.
(android_copy_area): Check for errors here because CopyArea can
perform a lot of consing.
(android_define_cursor): Remove redundant code.

22 months agoFix problems with the menu bar on large screen Android devices
Po Lu [Sat, 11 Mar 2023 03:35:59 +0000 (11:35 +0800)]
Fix problems with the menu bar on large screen Android devices

* java/org/gnu/emacs/EmacsActivity.java (onContextMenuClosed):
Process submenu closing normally if it happens more than 300 ms
after a submenu item was selected.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu)
(onMenuItemClick, display1): Give `wasSubmenuSelected' different
values depending on how the submenu was selected.

22 months ago; * lib/gnulib.mk.in: Update from gnulib.
Po Lu [Sat, 11 Mar 2023 01:58:01 +0000 (09:58 +0800)]
; * lib/gnulib.mk.in: Update from gnulib.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sat, 11 Mar 2023 01:55:05 +0000 (09:55 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoDon't use GCC extensions in src/emacs-module.c
Po Lu [Sat, 11 Mar 2023 01:53:24 +0000 (09:53 +0800)]
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.
(MODULE_INTERNAL_CLEANUP): New macro.
(module_make_global_ref, module_free_global_ref)
(module_make_function, module_get_function_finalizer)
(module_set_function_finalizer, module_make_interactive)
(module_funcall, module_intern, module_type_of)
(module_extract_integer, module_make_integer, module_extract_float)
(module_make_float, module_copy_string_contents)
(module_make_string, module_make_unibyte_string)
(module_make_user_ptr, module_get_user_ptr, module_set_user_ptr)
(module_get_user_finalizer, module_set_user_finalizer)
(module_vec_set, module_vec_get, module_vec_size)
(module_process_input, module_extract_time, module_make_time)
(module_extract_big_integer, module_make_big_integer)
(module_open_channel): Call MODULE_INTERNAL_CLEANUP prior to
returning.

22 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 11 Mar 2023 00:51:41 +0000 (16:51 -0800)]
Update from Gnulib by running admin/merge-gnulib

Run admin/merge-gnulib along with the following change:
* admin/merge-gnulib (GNULIB_MODULES): Replace ‘time’ with
‘time-h’, adjusting to a recent renaming in Gnulib modules.
Emacs doesn’t appear to need the new Gnulib ‘time’ module.

22 months agoImplement hourglass cursor on Android
Po Lu [Sat, 11 Mar 2023 00:34:57 +0000 (08:34 +0800)]
Implement hourglass cursor on Android

* lisp/term/android-win.el (x-pointer-arrow, x-pointer-left-ptr)
(x-pointer-left-side, x-pointer-sb-h-double-arrow)
(x-pointer-sb-v-double-arrow, x-pointer-watch, x-pointer-xterm)
(x-pointer-invisible): New constants.
* src/androidterm.c (android_show_hourglass)
(android_hide_hourglass): New functions.
(android_toggle_visible_pointer, android_define_frame_cursor):
Define or don't define hourglass cursor if x->hourglass.
(android_redisplay_interface): Add new functions.
* src/androidterm.h (struct android_output): New field
`hourglass'.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Fri, 10 Mar 2023 23:53:45 +0000 (07:53 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agosrc/profiler.c: Keep track of the discarded counts
Stefan Monnier [Fri, 10 Mar 2023 20:54:10 +0000 (15:54 -0500)]
src/profiler.c: Keep track of the discarded counts

When the table overflows and wh evict entries, keep track of those
counts in a global counter so we can see the proportion of
samples this represents.

* src/profiler.c (struct profiler_log): Add `discarded` field.
(evict_lower_half): Change arg to be `struct profiler_log`.
Transfer counts to the new `discarded` field.
(record_backtrace): Change arg to be `struct profiler_log`.
(add_sample): Adjust call accordingly.
(export_log): Add `discarded` counts to the result.
Onle add the GC and `discarded` counts if they're non-zero.
(syms_of_profiler): Define new symbol `Discarded Samples`.

22 months agosrc/profiler.c: Share more code between CPU and Memory profilers
Stefan Monnier [Fri, 10 Mar 2023 20:30:20 +0000 (15:30 -0500)]
src/profiler.c: Share more code between CPU and Memory profilers

* src/profiler.c (struct profiler_log): New type.
(make_log): Use it.
(cpu, memory): New vars to replace cpu_log, memory_log, cpu_gc_count,
and mem_gc_count.
(add_sample): New function, extracted from `handle_profiler_signal`.
(handle_profiler_signal, malloc_probe): Use it.
(Fprofiler_cpu_start, Fprofiler_memory_start): Adjust call to `make_log`.
(export_log): New function, extracted from `Fprofiler_cpu_log`.
(Fprofiler_cpu_log, Fprofiler_memory_log): Use it.
(syms_of_profiler, syms_of_profiler_for_pdumper): Adjust to new `cpu`
and `memory` vars.

22 months agosrc/profiler.c: Try and fix occasional assertion failures
Stefan Monnier [Fri, 10 Mar 2023 20:05:55 +0000 (15:05 -0500)]
src/profiler.c: Try and fix occasional assertion failures

Apparently the (>= match imatch) test fails sometimes in `profiler.el`.
Not sure where this comes from, but this patch should remove one
possible source.

* src/profiler.c (Fprofiler_cpu_log, Fprofiler_memory_log):
Change the special Automatic_GC backtrace to make it clear that it's
a *sibling* of the call tree (i.e. it's at the (its own) root).
(malloc_probe): Obey `size` when incrementing the gc_counter.

22 months agosrc/profiler.c: Keep track of allocations during GC
Eli Zaretskii [Fri, 10 Mar 2023 19:54:52 +0000 (14:54 -0500)]
src/profiler.c: Keep track of allocations during GC

Cargo-cult the `cpu_gc_count` code to `memory_gc_count`.

* src/profiler.c (mem_gc_count): New var.
(Fprofiler_memory_start): Initialize it.
(Fprofiler_memory_log): Increment it.
(Fprofiler_memory_log): Use it.

22 months ago* lisp/progmodes/gud.el (gud-minor-menu-map): Fix thinko in last change
Stefan Monnier [Fri, 10 Mar 2023 17:22:43 +0000 (12:22 -0500)]
* lisp/progmodes/gud.el (gud-minor-menu-map): Fix thinko in last change

22 months agoUpdate Android port
Po Lu [Fri, 10 Mar 2023 11:13:22 +0000 (19:13 +0800)]
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.
* java/org/gnu/emacs/EmacsView.java (onKeyDown, onKeyMultiple)
(onKeyUp): Check that function.
* java/org/gnu/emacs/EmacsWindow.java (defineCursor): Handle
cases where cursor is NULL.
* src/android.c (NATIVE_NAME): New function.
* src/androidfns.c (syms_of_androidfns): New variable.
* src/keyboard.c (lispy_function_keys): Add volume keys.

22 months agoImprove thing-at-point email detection
Robert Pluim [Wed, 15 Feb 2023 11:16:11 +0000 (12:16 +0100)]
Improve thing-at-point email detection

* lisp/thingatpt.el (thing-at-point-email-regexp): Allow numbers at
the start of the user portion, and disallow '.' at the start.  Also
disallow '.' at the start of the domain portion.
* test/lisp/thingatpt-tests.el (thing-at-point-test-data): Add various
email tests.

Bug#61519

22 months ago* java/org/gnu/emacs/EmacsCursor.java: New file.
Po Lu [Fri, 10 Mar 2023 07:16:13 +0000 (15:16 +0800)]
* java/org/gnu/emacs/EmacsCursor.java: New file.

22 months agoImplement mouse cursors on Android 7.0 and later
Po Lu [Fri, 10 Mar 2023 07:16:05 +0000 (15:16 +0800)]
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.
(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.

22 months ago; * java/org/gnu/emacs/EmacsNative.java: Add missing dependency.
Po Lu [Fri, 10 Mar 2023 03:39:30 +0000 (11:39 +0800)]
; * java/org/gnu/emacs/EmacsNative.java: Add missing dependency.

22 months agoAvoid using Linux sysfs APIs to access battery state on Android
Po Lu [Fri, 10 Mar 2023 02:02:36 +0000 (10:02 +0800)]
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.

22 months agoPort Android battery status to Android 4.4 and earlier
Po Lu [Fri, 10 Mar 2023 01:40:41 +0000 (09:40 +0800)]
Port Android battery status to Android 4.4 and earlier

* java/org/gnu/emacs/EmacsService.java (EmacsService)
(queryBattery19): New function.
(queryBattery): Call it on old systems.  Also, return AC line
status and temperature.
* lisp/battery.el (battery-android): Implement more format
directives.
* src/android.c (android_query_battery): Handle new status
fields.
* src/android.h (struct android_battery_state): Add `plugged'
and `temperature'.
* src/androidfns.c (Fandroid_query_battery): Return new fields.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Fri, 10 Mar 2023 00:43:13 +0000 (08:43 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agogud.el: Bring back the pseudo-tool-bar in text frames (bug#62041)
Stefan Monnier [Thu, 9 Mar 2023 21:19:16 +0000 (16:19 -0500)]
gud.el: Bring back the pseudo-tool-bar in text frames (bug#62041)

commit 8bb5c1bfec0929f2ba419e1c503f5acc01c336c2 accidentally
threw away the pseudo-tool-bar implemented in the text frames'
menu-bar of gud-minor-mode buffers.
Bring it back, and while we're at it, improve it so it also works
right when you have both text and GUI frames.

Also fix a misunderstanding in last change (`gud-mode-map` does need
to have a Gud menu, because `gud-mode` buffers already have it by
virtue of being in `gud-minor-mode` as well).

* lisp/progmodes/gud.el (gud-text-menu-bar-map): New keymap.
(gud-menu-mode-map): Rename from `gud-shared-mode-map`.
(gud-menu-map): Adjust accordingly.
(gud-minor-mode-map): Use them.
(gud-mode-map): Don't inherit from the shared/menu keymap.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Thu, 9 Mar 2023 11:57:06 +0000 (19:57 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoUpdate Android port
Po Lu [Thu, 9 Mar 2023 11:42:13 +0000 (19:42 +0800)]
Update Android port

* src/android.c (android_destroy_handle): Handle OOM errors in
android_destroy_handle.

22 months ago; * textconv.c: Remove out-of-date comment.
Po Lu [Thu, 9 Mar 2023 11:05:24 +0000 (19:05 +0800)]
; * textconv.c: Remove out-of-date comment.

22 months agoUse a face for DocView SVG
Manuel Giraud [Thu, 2 Mar 2023 18:16:19 +0000 (19:16 +0100)]
Use a face for DocView SVG

* lisp/doc-view.el (doc-view-svg-face): New face for SVG images.
(doc-view-insert-image): Use it.  (Bug#61816)

22 months agoFix out of sync counters in image-dired
Manuel Giraud [Thu, 2 Mar 2023 16:53:26 +0000 (17:53 +0100)]
Fix out of sync counters in image-dired

* lisp/image/image-dired.el (image-dired-delete-char): Update
thumbnails counter upon deletion.
(image-dired--update-header-line): Compute thumbnail index
dynamically.
(image-dired-insert-thumbnail): Remove now unused image-number
text property.  (Bug#61922)

22 months agoFix menu and popup race conditions on Android
Po Lu [Thu, 9 Mar 2023 08:30:02 +0000 (16:30 +0800)]
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/EmacsNative.java (sendContextMenu): New
argument.
* src/android.c (sendContextMenu): Pass serial number in event.

* src/androidgui.h (struct android_menu_event): New field
`menu_event_serial'.
* src/androidmenu.c (FIND_METHOD_STATIC)
(android_init_emacs_context_menu): Adjust method declarations.
(android_menu_show, android_dialog_show):
* src/androidterm.c (handle_one_android_event): Expect serial in
context menu events.
* src/androidterm.h: Update prototypes.

22 months agoFix webp test for Android
Po Lu [Thu, 9 Mar 2023 06:57:45 +0000 (14:57 +0800)]
Fix webp test for Android

* configure.ac (HAVE_WEBP): Disable WebPGetInfo check when
REALLY_ANDROID.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Thu, 9 Mar 2023 06:53:37 +0000 (14:53 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoUpdate Android port
Po Lu [Thu, 9 Mar 2023 06:50:32 +0000 (14:50 +0800)]
Update Android port

* 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.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Thu, 9 Mar 2023 05:30:23 +0000 (06:30 +0100)]
Merge from origin/emacs-29

7e1012765c4 Fix libwebp check for some webp installations
c2ca009da4c Avoid potential infloop
34c14430e9d Don't misindent 'else:' after 'if re.match:' in Python
8a2a554192a * Make sure `default-directory' exists before spawning pr...
1862e7eb7ef Fix sed expression in install-etc make target
c8ec0017cb9 Avoid using bash in the emacsclient desktop file
a588937094f Fix documentation of the 'line-height' text property
971ded31c4f Add 'declare' specs to with- and without-restriction

22 months agoUpdate Android port
Po Lu [Thu, 9 Mar 2023 03:27:00 +0000 (11:27 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu)
(addItem): New argument `tooltip'.

22 months agoUpdate Android port
Po Lu [Thu, 9 Mar 2023 02:50:03 +0000 (10:50 +0800)]
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'.
(android_menu_show): Correctly pass help strings in regular menu
items.
* src/sfnt.c (_sfnt_swap16, _sfnt_swap32): Avoid reserved names.

22 months agoFix crash upon restoring desktop
Po Lu [Thu, 9 Mar 2023 01:36:36 +0000 (09:36 +0800)]
Fix crash upon restoring desktop

* src/android.c (android_set_input_focus): Don't call method on
window using service class.

22 months ago; * src/sfnt.c (ODD): Use PUSH_UNCHECKED.
Po Lu [Thu, 9 Mar 2023 01:33:22 +0000 (09:33 +0800)]
; * src/sfnt.c (ODD): Use PUSH_UNCHECKED.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Thu, 9 Mar 2023 01:27:12 +0000 (09:27 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoFix libwebp check for some webp installations
Po Lu [Thu, 9 Mar 2023 00:52:54 +0000 (08:52 +0800)]
Fix libwebp check for some webp installations

* configure.ac: Look for WebPGetInfo; if it is not there, look
for libwebpdecoder as well.  (bug#61988)

22 months agoserver-eval-at: Signal more specific condition on unreadable result
Sean Whitton [Sat, 4 Mar 2023 21:53:01 +0000 (14:53 -0700)]
server-eval-at: Signal more specific condition on unreadable result

* lisp/server.el (server-return-invalid-read-syntax): New error
signal.
(server-eval-at): Re-signal invalid-read-syntax as
server-return-invalid-read-syntax (bug#61658).

22 months agoAvoid potential infloop
Dmitry Gutov [Wed, 8 Mar 2023 22:43:31 +0000 (00:43 +0200)]
Avoid potential infloop

* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions):
Avoid potential infloop (bug#62031).

22 months agoFix Pcompletion of "tar" when using unrecognized arguments
Jim Porter [Fri, 10 Feb 2023 07:27:50 +0000 (23:27 -0800)]
Fix Pcompletion of "tar" when using unrecognized arguments

Previously, arguments to tar like "--warning=no-timestamp" would cause
Pcompletion to hang (bug#58921).

This simplifies the logic flow by moving all the cases for "--"
arguments inside the THEN form of '(if (pcomplete-match "^--" 0)', and
for all "-" arguments inside the ELSE form.

* lisp/pcmpl-gnu.el (pcmpl-gnu--tar-long-options): New variable.
(pcomplete/tar): Properly handle completion of arguments that look
like "--ARG=", even if they're not recognized by this function.

22 months agoDon't misindent 'else:' after 'if re.match:' in Python
Dmitry Gutov [Wed, 8 Mar 2023 20:41:23 +0000 (22:41 +0200)]
Don't misindent 'else:' after 'if re.match:' in Python

* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Check that the
supposed block start is not a method call (bug#62031).

* test/lisp/progmodes/python-tests.el (python-indent-after-re-match):
New test.

Co-authored-by: Lele Gaifax <lele@metapensiero.it>
22 months ago* Make sure `default-directory' exists before spawning processes (bug#62004)
Andrea Corallo [Wed, 8 Mar 2023 20:08:49 +0000 (21:08 +0100)]
* Make sure `default-directory' exists before spawning processes (bug#62004)

* lisp/emacs-lisp/comp.el (comp-final, comp-run-async-workers): Bind
`default-directory' to `invocation-directory'.

22 months agogud.el: Fix bug#62041
Stefan Monnier [Wed, 8 Mar 2023 20:08:00 +0000 (15:08 -0500)]
gud.el: Fix bug#62041

Add a new `gud-shared-mode-map` where we put the bindings
shared between `gud-minor-mode-map` and `gud-mode-map`.

* lisp/progmodes/gud.el (gud-shared-mode-map): New keymap.
(gud-mode-map, gud-minor-mode-map): Use it as parent.
(gud-menu-map): Put the menu in that new keymap.
(gud-speedbar-buttons, gdb-script-font-lock-syntactic-face)
(gdb-script-indent-line): Skip obsolete face variables.

22 months agoFix sed expression in install-etc make target
Ulrich Müller [Wed, 8 Mar 2023 18:48:33 +0000 (19:48 +0100)]
Fix sed expression in install-etc make target

* Makefile.in (install-etc): Fix sed expression for emacsclient
desktop files.  (Bug#62045)

22 months agoAvoid using bash in the emacsclient desktop file
Ulrich Müller [Wed, 8 Mar 2023 18:37:27 +0000 (19:37 +0100)]
Avoid using bash in the emacsclient desktop file

* etc/emacsclient-mail.desktop (Exec): Use sh and sed instead
of bash, because the latter may not be available everywhere.

22 months agoFix documentation of the 'line-height' text property
Eli Zaretskii [Wed, 8 Mar 2023 17:29:33 +0000 (19:29 +0200)]
Fix documentation of the 'line-height' text property

* doc/lispref/display.texi (Line Height): More accurate
documentation of the value t of 'line-height' text property.
(Bug#62048)

22 months agoUpdate Android port
Po Lu [Wed, 8 Mar 2023 13:18:50 +0000 (21:18 +0800)]
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.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Wed, 8 Mar 2023 12:07:12 +0000 (20:07 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoFix occasional crash
Po Lu [Wed, 8 Mar 2023 12:06:41 +0000 (20:06 +0800)]
Fix occasional crash

* src/androidterm.c (android_build_extracted_text): Return NULL
if text class not initialized.
(android_update_selection): Check that EXTRACTED is not NULL.

22 months agoAdd 'declare' specs to with- and without-restriction
Gregory Heytings [Wed, 8 Mar 2023 09:55:06 +0000 (09:55 +0000)]
Add 'declare' specs to with- and without-restriction

* lisp/subr.el (with-restriction):
(without-restriction): Add 'declare' specs.

22 months agoUpdate Android port
Po Lu [Wed, 8 Mar 2023 07:04:49 +0000 (15:04 +0800)]
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.
* src/android.c (struct android_emacs_service): New method
`updateExtractedText'.
(android_hack_asset_fd_fallback): Improve naming convention.
Fix typo.
(android_init_emacs_service): Add new method.
(android_update_extracted_text): New function.
(android_open_asset): Fix typo.
* src/androidgui.h: Update prototypes.
* src/androidterm.c (struct android_get_extracted_text_context):
New field `flags'.
(android_get_extracted_text): Set flags on the frame's output
data.
(android_build_extracted_text): New function.
(getExtractedText): Move out class structures.
(android_update_selection): Send updates to extracted text if
the input method asked for them.
(android_reset_conversion): Clear extracted text flags.
* src/androidterm.h (struct android_output): New fields for
storing extracted text data.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Wed, 8 Mar 2023 05:30:18 +0000 (06:30 +0100)]
Merge from origin/emacs-29

f9b7913656f Fix empty line indentation in c-ts-mode (bug#61997)
90504f9d898 Fix tree-sitter indent preset prev-line (bug#61998)
ed3bab3cc72 Revert 'forward-sentence-default-function' to return poin...
bfe62b10413 ; * etc/NEWS: Fix typos.
3c1693d08b0 Fix Elisp code injection vulnerability in emacsclient-mai...
ab417c8a6ee Fix problem with debuginfod queries in "M-x gdb"

# Conflicts:
# etc/NEWS

22 months agoFix double free upon encountering invalid font
Po Lu [Wed, 8 Mar 2023 02:19:26 +0000 (10:19 +0800)]
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.

22 months agoFix empty line indentation in c-ts-mode (bug#61997)
Yuan Fu [Wed, 8 Mar 2023 00:35:23 +0000 (16:35 -0800)]
Fix empty line indentation in c-ts-mode (bug#61997)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Handle the empty line case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent-presets): Support null as
a value for NODE-TYPE in the 'match' matcher.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Wed, 8 Mar 2023 00:29:31 +0000 (08:29 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoFix tree-sitter indent preset prev-line (bug#61998)
Yuan Fu [Wed, 8 Mar 2023 00:26:33 +0000 (16:26 -0800)]
Fix tree-sitter indent preset prev-line (bug#61998)

* lisp/treesit.el (treesit-simple-indent-presets): Fix return value.

22 months agoRevert 'forward-sentence-default-function' to return point (bug#62027)
Manuel Giraud [Tue, 7 Mar 2023 19:03:53 +0000 (20:03 +0100)]
Revert 'forward-sentence-default-function' to return point (bug#62027)

* lisp/textmodes/paragraphs.el
(forward-sentence-default-function): Revert to return the
position of point.
(count-sentences): Adapt to this change.

22 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Tue, 7 Mar 2023 17:50:44 +0000 (18:50 +0100)]
; * etc/NEWS: Fix typos.

22 months ago* test/lisp/subr-tests.el (subr--safe-copy-tree): New tests for safe-copy-tree
Alan Mackenzie [Tue, 7 Mar 2023 17:38:20 +0000 (17:38 +0000)]
* test/lisp/subr-tests.el (subr--safe-copy-tree): New tests for safe-copy-tree

22 months agoFix Elisp code injection vulnerability in emacsclient-mail.desktop
Ulrich Müller [Tue, 7 Mar 2023 17:25:37 +0000 (18:25 +0100)]
Fix Elisp code injection vulnerability in emacsclient-mail.desktop

A crafted mailto URI could contain unescaped double-quote
characters, allowing injection of Elisp code.  Therefore, any
'\' and '"' characters are replaced by '\\' and '\"', using Bash
pattern substitution (which is not available in the POSIX shell).

We want to pass literal 'u=${1//\\/\\\\}; u=${u//\"/\\\"};' in the
bash -c command, but in the desktop entry '"', '$', and '\' must
be escaped as '\\"', '\\$', and '\\\\', respectively (backslashes
are expanded twice, see the Desktop Entry Specification).

Reported by Gabriel Corona <gabriel.corona@free.fr>.

* etc/emacsclient-mail.desktop (Exec): Escape backslash and
double-quote characters.

22 months agosafe-copy-tree. Correct mistakes from earlier patch.
Alan Mackenzie [Tue, 7 Mar 2023 15:26:20 +0000 (15:26 +0000)]
safe-copy-tree.  Correct mistakes from earlier patch.

* lisp/emacs-lisp/bytecomp.el (compile-defun): Remove unintended change.

* lisp/subr.el (safe-copy-tree--seen): Correct grammatical error in doc
string.
(safe-copy-tree): Delete hash table at end of function.

* doc/lispref/lists.texi (Building Lists): Add an "@end defun" line.

22 months agoFix problem with debuginfod queries in "M-x gdb"
Eli Zaretskii [Tue, 7 Mar 2023 12:39:27 +0000 (14:39 +0200)]
Fix problem with debuginfod queries in "M-x gdb"

* lisp/progmodes/gdb-mi.el (gdb-debuginfod-enable-setting): New
defcustom.
(gdb-debuginfod-message): New function.
(gdb-init-1): Initialize gdb-debuginfod-enable.  Ask the user
about debuginfod queries and display any error messages.
(Bug#61973)

* etc/NEWS: Announce the change.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Tue, 7 Mar 2023 12:18:15 +0000 (20:18 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoSave build timestamps in Android builds
Po Lu [Tue, 7 Mar 2023 12:18:02 +0000 (20:18 +0800)]
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.

22 months agoUpdate Android port
Po Lu [Tue, 7 Mar 2023 08:49:45 +0000 (16:49 +0800)]
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_fill_polygon, android_draw_rectangle, android_draw_point)
(android_draw_line, android_clear_area, android_bell)
(android_set_input_focus, android_raise_window)
(android_lower_window, android_set_dont_focus_on_map)
(android_set_dont_accept_focus, android_get_keysym_name)
(android_toggle_on_screen_keyboard, android_restart_emacs)
(android_display_toast, android_update_ic, android_reset_ic)
(android_set_fullscreen): Optimize by specifying the class
explicitly when calling a method.

22 months agoeval-and-compile: Strip symbol positions for eval but not for compile.
Alan Mackenzie [Tue, 7 Mar 2023 08:00:25 +0000 (08:00 +0000)]
eval-and-compile: Strip symbol positions for eval but not for compile.

This fixes bug #61962.

* lisp/subr.el (safe-copy-tree): New function.

* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Amend
the entry for eval-and-compile to use safe-copy-tree and
byte-run-strip-symbol-positions for the eval part.

* doc/lispref/lists.texi (Building Lists): Document safe-copy-tree.

* etc/NEWS: Note the new function safe-copy-tree.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Tue, 7 Mar 2023 07:25:28 +0000 (15:25 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoUpdate Android port
Po Lu [Tue, 7 Mar 2023 06:20:50 +0000 (14:20 +0800)]
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.
(skip_lazy_string): Add optimized versions of various functions
for accessing Android assets.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Tue, 7 Mar 2023 05:30:10 +0000 (06:30 +0100)]
Merge from origin/emacs-29

bd07cec8442 Fix regression in Fido mode (bug#62015)
0e3c7ac13da * Fix `emacs-lisp-native-compile-and-load' for (bug#61917)
4a7e657389a * lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (...
8a8a994cfab Revert "Fix configuration of webp libraries"
de4277af009 Fix configuration of webp libraries

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Tue, 7 Mar 2023 00:43:36 +0000 (08:43 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoFix regression in Fido mode (bug#62015)
João Távora [Mon, 6 Mar 2023 22:28:47 +0000 (22:28 +0000)]
Fix regression in Fido mode (bug#62015)

To understand the regression consider this recipe where the 'fo'
pattern is typed by the user in the last step.

   emacs -Q
   C-x b foo RET
   C-x b afoo RET
   C-x b *scratch* RET
   M-x fido-mode RET
   C-x b fo

This used to offer both 'foo' and 'afoo' as candidates but now only
offered 'foo'.  This is because the pattern 'fo' matches 'foo', but
not 'afoo' with 'basic' completion style.

Fido mode, however, prioritizes 'flex' completion style, and that is
not happening here as it used to.

This was introduced in this commit

     commit bf81df86e52fdc995bec8d9646f84d114cb896d1
     Author: João Távora <joaotavora@gmail.com>
     Date:   Wed Dec 7 10:43:59 2022 +0000

         Don't override completion-category-defaults in fido-mode

I took away the nil setting of 'completion-category-defaults; in Fido
mode's minibuffer. It seemed generally the correct thing to do, and
was done mainly because Eglot added its style preferences to that
variable instead of completion-category-overrides directly, which is a
nono.  So, to be able use the Fido UI with Eglot successfully,
'completion-category-defaults' should stay untouched.  Or so I
thought.

However, I failed to notice that, for most categories, the default
value of 'completion-category-defaults' prioritizes the 'basic'
completion style.

For example, in the 'buffer' category, the default value has the
styles list '(basic substring)'.  This means that if a pattern matches
accoring to the 'basic' style, 'substring' will not be tried.  And
neither will 'completion-styles' which in Fido mode's case happens to
be 'flex'.

The solution in this commit is to craft a value for completion
category defaults that is just like the default one, but prioritizes
'flex' completion for every category.

* lisp/icomplete.el (icomplete--fido-ccd): New helper.
(icomplete--fido-mode-setup): Use it.

22 months ago* Fix `emacs-lisp-native-compile-and-load' for (bug#61917)
Andrea Corallo [Mon, 6 Mar 2023 16:27:32 +0000 (17:27 +0100)]
* Fix `emacs-lisp-native-compile-and-load' for (bug#61917)

* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
Don't load if no compialtion happened.

22 months ago* lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (bug#61917)
Andrea Corallo [Mon, 6 Mar 2023 15:51:07 +0000 (16:51 +0100)]
* lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (bug#61917)

22 months agoRevert "Fix configuration of webp libraries"
Eli Zaretskii [Mon, 6 Mar 2023 15:31:57 +0000 (17:31 +0200)]
Revert "Fix configuration of webp libraries"

This reverts commit de4277af009115ceba7fe920163c05c608ea9524.
It breaks WebP support at least on my system.
There's no reason to require libwebpdecoder library to be
installed, since we don't use the functions from it, at least
not in libwebp 1.2.1.

22 months agoDon't modify interactive closures destructively (Bug#60974).
Vibhav Pant [Wed, 1 Mar 2023 09:34:34 +0000 (15:04 +0530)]
Don't modify interactive closures destructively (Bug#60974).

* lisp/emacs-lisp/cconv.el (cconv-convert): When form is an
interactive lambda form, don't destructively modify it, as it might be
a constant literal. Instead, create a new list with the relevant
place(s) changed.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-form-modify-bug60974): New test.

22 months agoFix configuration of webp libraries
Po Lu [Mon, 6 Mar 2023 13:42:29 +0000 (21:42 +0800)]
Fix configuration of webp libraries

* configure.ac: Link with libwebpdecoder along with
libwebpdemux.  (bug#61988)

22 months agoAdd tramp-use-ssh-controlmaster-options value `suppress'.
Michael Albinus [Mon, 6 Mar 2023 12:35:49 +0000 (13:35 +0100)]
Add tramp-use-ssh-controlmaster-options value `suppress'.

* doc/misc/tramp.texi (Ssh setup):
Explain tramp-use-ssh-controlmaster-options value `suppress'.
(Remote processes): Add reference to "Using ssh connection sharing".

* etc/NEWS: Extend 'tramp-use-ssh-controlmaster-options' values.
;; Fix typos.

* lisp/net/tramp-sh.el (tramp-use-ssh-controlmaster-options):
Allow new value `suppress'.
(tramp-ssh-option-exists-p): New defun.
(tramp-ssh-controlmaster-options): Implement `suppress' actions.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Mon, 6 Mar 2023 08:06:37 +0000 (16:06 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

22 months agoUpdate Android port
Po Lu [Mon, 6 Mar 2023 07:30:29 +0000 (15:30 +0800)]
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.
* src/android-asset.h (AAsset_seek): Define stub.
* src/android.c (android_open): Take mode_t.
(android_open_asset, android_close_asset, android_asset_read_quit)
(android_asset_read, android_asset_lseek, android_asset_fstat):
New functions.
* src/android.h (struct android_fd_or_asset): Update prototypes.
* src/androidgui.h (enum android_ime_operation): Add new
operation to update the selection position.
* src/androidterm.c (android_handle_ime_event): Handle new
operation.
(requestSelectionUpdate): New function.
* src/fileio.c (close_file_unwind_emacs_fd): New function.
(Fcopy_file, union read_non_regular, read_non_regular)
(Finsert_file_contents): Use optimized codepath to insert
Android asset files.
* src/frame.h (enum text_conversion_operation): New operation.
* src/textconv.c (really_request_point_update)
(handle_pending_conversion_events_1, request_point_update): New
functions.
* src/textconv.h: Update prototypes.

22 months agoMerge from origin/emacs-29
Stefan Kangas [Mon, 6 Mar 2023 05:30:13 +0000 (06:30 +0100)]
Merge from origin/emacs-29

1c67e4f895f Fix c-ts-mode indentation
d724d7d6785 Fix c-ts-mode indentation
7292b24c801 Fix c-ts-mode indentation
75cdc1afbe5 ; Change font-lock-variable-name-face to font-lock-variab...
b1b3af5b90b Update to Org 9.6.1-40-g3d817c
80e1037df44 Add string-interpolation feature to bash-ts-mode
5b8e0b31548 Fix tramp-sh-handle-insert-directory
2258ed01f42 ; Minor fix of last change
9c18af0cfaf * Warn when certain primitives are redefined (bug#61880)
5af695c7479 ; * lib-src/etags.c (print_help): Fix indentation.

22 months ago* src/conf_post.h: Avoid macro redeclaration.
Po Lu [Mon, 6 Mar 2023 03:46:19 +0000 (11:46 +0800)]
* src/conf_post.h: Avoid macro redeclaration.

22 months agoUpdate Android port
Po Lu [Mon, 6 Mar 2023 03:25:51 +0000 (11:25 +0800)]
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.

22 months agoFix c-ts-mode indentation
Yuan Fu [Sun, 5 Mar 2023 23:22:36 +0000 (15:22 -0800)]
Fix c-ts-mode indentation

Mentioned in bug#61893.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Handle
"#elif" and "#else".
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts: Add an
"#elif" to the test.

22 months agoFix c-ts-mode indentation
Yuan Fu [Sun, 5 Mar 2023 23:07:58 +0000 (15:07 -0800)]
Fix c-ts-mode indentation

Mentioned in bug#61893, although not the subject of it.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Fix the child index for preproc_else
and preproc_elif case.
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts:
New test.

22 months agoFix c-ts-mode indentation
Yuan Fu [Sun, 5 Mar 2023 23:01:54 +0000 (15:01 -0800)]
Fix c-ts-mode indentation

Not the subject of it, but mentioned in bug#61893.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Skip
the sibling if it doesn't start on it's own line.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

22 months ago; Change font-lock-variable-name-face to font-lock-variable-use-face
Yuan Fu [Sun, 5 Mar 2023 22:42:28 +0000 (14:42 -0800)]
; Change font-lock-variable-name-face to font-lock-variable-use-face

* lisp/progmodes/sh-script.el:
(sh-mode--treesit-settings): Change font-lock-variable-name-face to
font-lock-variable-use-face.

22 months agoUpdate to Org 9.6.1-40-g3d817c
Kyle Meyer [Sun, 5 Mar 2023 22:22:06 +0000 (17:22 -0500)]
Update to Org 9.6.1-40-g3d817c

22 months agoAdd string-interpolation feature to bash-ts-mode
Yuan Fu [Sun, 5 Mar 2023 22:16:58 +0000 (14:16 -0800)]
Add string-interpolation feature to bash-ts-mode

* lisp/progmodes/sh-script.el:
(bash-ts-mode): Add string-interpolation feature.
(sh-mode--treesit-settings): Add rule for string-interpolation feature.

22 months agoFix tramp-sh-handle-insert-directory
Michael Albinus [Sun, 5 Mar 2023 16:31:26 +0000 (17:31 +0100)]
Fix tramp-sh-handle-insert-directory

* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Remove also
//DIRED-OPTIONS// line when there is no //DIRED// line.

22 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sun, 5 Mar 2023 11:59:06 +0000 (19:59 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android