]> git.eshelyaron.com Git - emacs.git/log
emacs.git
22 months agoUpdate Android port
Po Lu [Wed, 15 Mar 2023 07:07:29 +0000 (15:07 +0800)]
Update Android port

* configure.ac (XCONFIGURE): Disable NS.
* cross/Makefile.in (lib-src/config.h):

(lib/libgnu.a):
(src/android-emacs): Port sed invocation to Mac OS without GNU
sed.

22 months agoUpdate Android port
Po Lu [Wed, 15 Mar 2023 01:46:01 +0000 (09:46 +0800)]
Update Android port

* doc/lispref/commands.texi (Misc Events): Document variable
`disable-inhibit-text-conversion'.
* java/org/gnu/emacs/EmacsDialog.java (display1): Try an
activity that is certain to be focused first.
* lisp/touch-screen.el (touch-screen-track-tap)
(touch-screen-track-drag): Bind
`disable-inhibit-text-conversion'.
* src/keyboard.c (read_key_sequence): Only disable text
conversion if an actual function or numeric key is found in the
key sequence.
(syms_of_keyboard): New variable
`disable-inhibit-text-conversion'.
* src/lread.c (read_filtered_event): Check new variable.
* src/textconv.c (textconv_query): Remove unused label.

22 months agoOmit gnulib modules added by Android port on MinGW
Po Lu [Wed, 15 Mar 2023 00:20:59 +0000 (08:20 +0800)]
Omit gnulib modules added by Android port on MinGW

* nt/gnulib-cfg.mk: Omit new gnulib modules.

22 months agoUpdate Android port
Po Lu [Tue, 14 Mar 2023 11:51:42 +0000 (19:51 +0800)]
Update Android port

* lisp/minibuffer.el (minibuffer-setup-on-screen-keyboard):
Handle cases where last-event-frame is a kbd macro.
* src/keyboard.c (lispy_function_keys): Remove duplicates.

22 months agoFix the MS-DOS build
Po Lu [Tue, 14 Mar 2023 07:14:38 +0000 (15:14 +0800)]
Fix the MS-DOS build

* msdos/sed1v2.inp:
* msdos/sed3v2.inp:
* msdos/sedlibcf.inp:
* msdos/sedlibmk.inp: Update for Android port and new Gnulib
modules.

22 months agoUpdate Android port
Po Lu [Tue, 14 Mar 2023 05:19:01 +0000 (13:19 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsWindow.java (figureChange): Detect
mice on up events as well.
(onSomeKindOfMotionEvent): Work past framework bug.
* src/androidterm.c (android_perform_conversion_query):
* src/textconv.c (textconv_query):
* src/textconv.h (TEXTCONV_SKIP_ACTIVE_REGION): Remove unused
code.

22 months agoUpdate Android port
Po Lu [Tue, 14 Mar 2023 01:48:02 +0000 (09:48 +0800)]
Update Android port

* doc/emacs/android.texi (Android Windowing): Document how to
display dialogs when Emacs is in the background.
* java/org/gnu/emacs/EmacsDialog.java (display1): Use system
dialogs if possible.

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

22 months agoCC Mode: Allow lists of strings as safe values for *-font-lock-extra-types
Alan Mackenzie [Mon, 13 Mar 2023 16:42:02 +0000 (16:42 +0000)]
CC Mode: Allow lists of strings as safe values for *-font-lock-extra-types

* lisp/progmodes/cc-vars.el (c-list-of-strings): New function.
(c-font-lock-extra-types, c++-font-lock-extra-types)
(objc-font-lock-extra-types, java-font-lock-extra-types)
(idl-font-lock-extra-types, pike-font-lock-extra-types): Add a :safe entry
into each of thes defcustoms for c-list-of-string.
(Top level): Add an autoload entry for each of the above.

22 months agoUpdate Android port
Po Lu [Mon, 13 Mar 2023 12:39:29 +0000 (20:39 +0800)]
Update Android port

* etc/NEWS: Announce new option.
* lisp/menu-bar.el (menu-bar-close-window): New option.
(kill-this-buffer):
(kill-this-buffer-enabled-p): Adjust accordingly.
* src/keyboard.c (lispy_function_keys): Add more silly
keys.

22 months agoUpdate Android port
Po Lu [Mon, 13 Mar 2023 10:31:30 +0000 (18:31 +0800)]
Update Android port

* src/android.c (android_check_string, android_build_string):
Reduce consing when building menu bar strings.

22 months ago; * etc/MACHINES (Android): Update with more recent information.
Po Lu [Mon, 13 Mar 2023 07:53:39 +0000 (15:53 +0800)]
; * etc/MACHINES (Android): Update with more recent information.

22 months agoUpdate Android port
Po Lu [Mon, 13 Mar 2023 05:25:02 +0000 (13:25 +0800)]
Update Android port

* doc/emacs/android.texi (Android Startup): Document changes to
emacsclient wrapper.
* java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity)
(startEmacsClient): Open EmacsActivity if the service is not
running.
* java/org/gnu/emacs/EmacsService.java (onCreate):
* java/org/gnu/emacs/EmacsThread.java (EmacsThread, run): Pass
any file to open to Emacs.
* lisp/term/android-win.el (handle-args-function): Implement.

22 months agoUpdate Android port
Po Lu [Mon, 13 Mar 2023 01:58:52 +0000 (09:58 +0800)]
Update Android port

* src/image.c (image_create_bitmap_from_file, image_find_image_fd)
(close_android_fd, slurp_file): Return and use `struct
android_fd_or_asset' on Android.
(xbm_load, xpm_load, pbm_load, png_load_body, jpeg_load_body)
(webp_load, svg_load): Adjust accordingly.

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

22 months agoRepair and speed up safe-copy-tree and make it internal (bug#61962)
Mattias Engdegård [Sun, 12 Mar 2023 16:00:25 +0000 (17:00 +0100)]
Repair and speed up safe-copy-tree and make it internal (bug#61962)

There is no particular requirement for safe-copy-tree so let's make it
internal for now.  The new implementation is faster and more correct.

* doc/lispref/lists.texi (Building Lists):
* etc/NEWS:  Remove doc and announcement.
* lisp/subr.el (safe-copy-tree--seen, safe-copy-tree--1)
(safe-copy-tree): Remove old version.
* lisp/emacs-lisp/bytecomp.el (bytecomp--copy-tree-seen)
(bytecomp--copy-tree-1, bytecomp--copy-tree): Add new version.
(byte-compile-initial-macro-environment): Use it.
* test/lisp/subr-tests.el (subr--safe-copy-tree):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--copy-tree):
Move and improve tests.

22 months agoMake Tramp file name completion more quiet for all backends
Michael Albinus [Sun, 12 Mar 2023 16:21:57 +0000 (17:21 +0100)]
Make Tramp file name completion more quiet for all backends

* lisp/net/tramp-adb.el (tramp-adb-handle-file-name-all-completions):
* lisp/net/tramp-archive.el
(tramp-archive-handle-file-name-all-completions):
* lisp/net/tramp-crypt.el (tramp-crypt-handle-file-name-all-completions):
* lisp/net/tramp-fuse.el (tramp-fuse-handle-file-name-all-completions):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-name-all-completions):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
* lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions):
* lisp/net/tramp-sudoedit.el
(tramp-sudoedit-handle-file-name-all-completions):
Return nil when DIRECTORY is missing.  (Bug#61890)

22 months ago; NEWS markings.
Eli Zaretskii [Sun, 12 Mar 2023 15:43:40 +0000 (17:43 +0200)]
; NEWS markings.

22 months agoAdd elixir-ts-mode (Bug#61996)
Wilhelm H Kirschbaum [Sun, 12 Mar 2023 15:10:43 +0000 (17:10 +0200)]
Add elixir-ts-mode (Bug#61996)

* etc/NEWS: Mention the new mode.
* lisp/progmodes/elixir-ts-mode.el: New file.
* test/lisp/progmodes/elixir-ts-mode-tests.el: New file.
* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: New file.
* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add Elixir support.
* lisp/progmodes/eglot.el (eglot-server-programs): Add elixir-ts-mode.

22 months agoAdd heex-ts-mode (Bug#61996)
Wilhelm H Kirschbaum [Sun, 12 Mar 2023 15:08:50 +0000 (17:08 +0200)]
Add heex-ts-mode (Bug#61996)

* etc/NEWS: Mention the new mode.
* lisp/progmodes/heex-ts-mode.el: New file.
* test/lisp/progmodes/heex-ts-mode-tests.el: New file.
* test/lisp/progmodes/heex-ts-mode-resources/indent.erts: New file.
* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add HEEx support.

22 months agoFix pluralization in shortdoc-help-fns-examples-function
Daniel Martín [Sun, 12 Mar 2023 12:38:34 +0000 (13:38 +0100)]
Fix pluralization in shortdoc-help-fns-examples-function

* lisp/emacs-lisp/shortdoc.el (shortdoc-help-fns-examples-function):
Implement a better logic to pluralize "Example", by counting the
number of arrow characters in the example string. (Bug#61877)
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test): Add a test.

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

* src/android.c (android_get_screen_width):
(android_get_screen_height):
(android_get_mm_width):
(android_get_mm_height):
(android_detect_mouse): Correctly handle Java exceptions.

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

22 months agoUpdate Android port
Po Lu [Sun, 12 Mar 2023 11:36:09 +0000 (19:36 +0800)]
Update Android port

* src/android.c (android_check_if_event):
* src/androidgui.h: New function.
* src/androidterm.c (android_event_is_for_frame): New function.
(android_reset_conversion): Free and unqueue all text conversion
events for the given frame.

22 months agoUpdate Android port
Po Lu [Sun, 12 Mar 2023 09:07:57 +0000 (17:07 +0800)]
Update Android port

* src/androidterm.c (NATIVE_NAME, JNICALL)
(android_build_extracted_text, android_update_selection): Use
0-based indices for Android buffer positions.  Also, report
surrounding text relative to the region, not to the cursor.
* src/textconv.c (textconv_query): Accept new values of
position.
(really_set_composing_text): Use ephemeral last point.

22 months ago; Fix last change
Eli Zaretskii [Sun, 12 Mar 2023 08:25:10 +0000 (10:25 +0200)]
; Fix last change

* lisp/emacs-lisp/shortdoc.el (shortdoc-help-fns-examples-function)
(shortdoc-function-examples): Fix compilation warning and add an
empty line before the examples.

* lisp/emacs-lisp/shortdoc.el (shortdoc--insert-group-in-buffer)
(shortdoc-function-examples)
(shortdoc-help-fns-examples-function):
* etc/NEWS:
* doc/lispref/help.texi (Documentation Groups):
* doc/emacs/help.texi (Name Help): Improve documentation of
the last change.  (Bug#61877)

22 months agoAdd functions to query Emacs Lisp examples registered in shortdoc
Daniel Martín [Tue, 28 Feb 2023 22:15:40 +0000 (23:15 +0100)]
Add functions to query Emacs Lisp examples registered in shortdoc

* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Add
a new shortdoc-example text property so that ELisp examples can
be searched for later.
(shortdoc--insert-group-in-buffer): New function extracted from
the buffer insertion code in 'shortdoc-display-group'.
(shortdoc-display-group): Implement in terms of
'shortdoc--insert-group-in-buffer'.
(shortdoc-function-examples): New function that returns an alist
of Emacs Lisp examples from shortdoc.
(shortdoc-help-fns-examples-function): New function to insert
Emacs Lisp function examples in *Help* buffers, if added to
'help-fns-describe-function-functions'.
*
test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-function-examples-test):
Test it.
* doc/emacs/help.texi (Name Help): Document in the user manual.
* doc/lispref/help.texi (Documentation Groups): Document it.
* etc/NEWS: Advertise it. (Bug#61877)

22 months ago; Fix typo in docstring
Jim Porter [Sun, 12 Mar 2023 07:51:20 +0000 (23:51 -0800)]
; Fix typo in docstring

* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/variable-assign-completion/non-assignment): Fix typo.

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

22 months agoUpdate Android port
Po Lu [Sun, 12 Mar 2023 07:43:14 +0000 (15:43 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity)
(onCancel): New function.
(displayFailureDialog): Handle dialog cancellation.
* src/sfntfont.c (sfnt_parse_languages): Look for SLNG tag if
DLNG is not present.

22 months agoAdd Super modifier support to Android port
Po Lu [Sun, 12 Mar 2023 03:06:47 +0000 (11:06 +0800)]
Add Super modifier support to Android port

* src/androidgui.h (enum android_modifier_mask): New modifier
ANDROID_SUPER_MASK.
* src/androidterm.c (android_android_to_emacs_modifiers)
(android_emacs_to_android_modifiers): Add new modifier.

22 months agoAdd support for completing special references (e.g. buffers) in Eshell
Jim Porter [Wed, 25 Jan 2023 05:22:06 +0000 (21:22 -0800)]
Add support for completing special references (e.g. buffers) in Eshell

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): Handle
special references.

* lisp/eshell/em-arg.el (eshell-parse-special-reference): Ensure point
is just after the "#<" when incomplete, and handle backslash escapes
more thoroughly.
(eshell-complete-special-reference): New function.

* test/lisp/eshell/esh-arg-tests.el
(esh-arg-test/special-reference/default)
(esh-arg-test/special-reference/buffer)
(esh-arg-test/special-reference/special):
* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/special-ref-completion/type)
(em-cmpl-test/special-ref-completion/implicit-buffer)
(em-cmpl-test/special-ref-completion/buffer): New tests.

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.