Po Lu [Tue, 16 Jul 2024 02:14:30 +0000 (10:14 +0800)]
Port better to Android 3.0
* java/org/gnu/emacs/EmacsNoninteractive.java (main): Use the
old getPackageInfo calling convention if it exists rather than
on Android 2.3.3 and earlier.
Paul Eggert [Wed, 17 Jul 2024 15:13:31 +0000 (08:13 -0700)]
Go back to preferring -isystem to -I
* configure.ac: Go back to preferring -isystem to -I,
as headers like <gobject/gparam.h> still need it. This
reverts almost all of 2024-07-16T02:25:44!eggert@cs.ucla.edu,
except that the ‘nw="$nw -Wsystem-headers"’ line continues to
be removed as it is no longer needed due to recent Gnulib changes.
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2024-07/msg00756.html
Notive the nested "*" blob inside the the {} group.
Eglot used to reject them in 'workspace/didChangeWatchedFiles' requests,
responding with "Internal Error". This could confuse some servers. Now
I've done some changes to the state machine generation and it supports
them.
* lisp/progmodes/eglot.el (eglot--glob-parse): Relax parser.
(eglot--glob-fsm): New helper.
(eglot--glob-compile, eglot--glob-emit-{}): Use it.
* test/lisp/progmodes/eglot-tests.el (eglot-test-glob-test):
Uncomment some test cases.
Paul Eggert [Tue, 16 Jul 2024 16:19:31 +0000 (09:19 -0700)]
Check for more ‘find’ failures and port ‘find’
* Makefile.in (install-eln), configure.ac (emacs_cv_find_delete):
* make-dist: Use ‘find ... -exec CMD {} +’ rather than ‘find
... -exec CMD {} \;’ so that if CMD fails, ‘find’ fails too.
* Makefile.in (install-eln): Port to ‘find’ implementations that
behave differently from GNU ‘find’ when given an argument
that contains ‘{}’ within a longer string. POSIX allows
this behavior.
Paul Eggert [Tue, 16 Jul 2024 02:41:35 +0000 (19:41 -0700)]
Quote BIN_DESTDIR better
* Makefile.in (BIN_DESTDIR, install-eln, uninstall):
* src/Makefile.in ($(pdmp)):
Be more consistent about quoting BIN_DESTDIR and ELN_DESTDIR,
avoiding double-quoting ''like this'' which does not work as
expected.
Paul Eggert [Tue, 16 Jul 2024 02:25:44 +0000 (19:25 -0700)]
Prefer -I to -isystem
* configure.ac: Simplify configuration by using -I instead of
-isystem, as -isystem is no longer helpful for suppressing
diagnostics (and likely has not been helpful for years).
Do not suppress -Wsystem-headers, as Gnulib no longer enables it.
Paul Eggert [Mon, 15 Jul 2024 00:00:56 +0000 (01:00 +0100)]
Simplify time form analysis
This does not change behavior; it merely refactors the code
for simplicity.
* src/timefns.c (enum timeform, struct form_time):
Remove. All uses removed.
(decode_time_components): Accept HZ instead of FORM.
This saves a switch. All uses changed.
(decode_lisp_time): Return union c_time instead of struct form_time.
All uses changed.
(lisp_time_cform): Remove. All uses changed to just use
decode_lisp_time.
(time_arith, Ftime_convert): Check (TICKS . HZ) form directly
using CONSP, instead of using the old struct form_time.
That's fast enough here.
Paul Eggert [Sun, 14 Jul 2024 16:36:01 +0000 (17:36 +0100)]
Test !FASTER_TIMEFNS with builtin resolutions
* src/timefns.c (timespec_hz, trillion, ztrillion):
If !FASTER_TIMEFNS, do not optimize the calculations of
these variables. This gives better test coverage of the
slow-path code, when compiling with -DFASTER_TIMEFNS=0.
(NEED_ZTRILLION_INIT): Move up, to simplify #ifdefery.
Now defined or not defined, instead of being 1 or not defined,
since it is used only via #ifdef.
Paul Eggert [Sun, 14 Jul 2024 22:45:31 +0000 (23:45 +0100)]
Fix buffer size problem in print_bool_vector
* src/print.c (print_bool_vector): Don’t assume SIZE fits
into ptrdiff_t, since it is an EMACS_INT. This
pacifies gcc -Wformat-overflow on i686 --with-wide-int.
* src/textconv.c (get_conversion_field): Set max value to
PTRDIFF_MAX, not MOST_POSITIVE_FIXNUM, since the variable is
ptrdiff_t, not EMACS_INT. Problem caught by gcc -Woverflow on a
32-bit platform with --with-wide-int.
Paul Eggert [Sun, 14 Jul 2024 19:53:28 +0000 (20:53 +0100)]
Pacify 32-bit GCC 14.1.1 in timer_check_2
* src/keyboard.c (timer_check_2): Refactor to make flow control
more obvious, to pacify -Wanalyzer-use-of-uninitialized-value with
gcc 14.1.1 20240607 (Red Hat 14.1.1-5) on i686.
Paul Eggert [Fri, 12 Jul 2024 16:23:30 +0000 (17:23 +0100)]
Use Gnulib workaround for Android strnlen bug
The workaround for the Android 5.0 (API 21) strnlen bug
is now done in m4/strnlen.m4, taken from Gnulib, so
there is no need for Emacs to have its own workaround.
* configure.ac (ORIGINAL_AC_FUNC_STRNLEN, AC_FUNC_STRNLEN):
Remove.
Previously, project-kill-buffers always called (project-current t). A
Lisp program could change what project project-kill-buffers operated
on by binding project-current-directory-override. However, in some
edge cases (for example, if the project was deleted between looking it
up and calling project-kill-buffers) this might fail to detect a
project, and so (project-current t) would prompt the user.
To avoid this, accept the project to kill buffers for as an argument.
* lisp/progmodes/project.el (project-kill-buffers): Take project as an
optional argument (bug#72019).
Peter Oliver [Mon, 15 Jul 2024 11:03:47 +0000 (12:03 +0100)]
Fix intermittent failure of dired-test-bug27243-02
* test/lisp/dired-tests.el (dired-test-bug27243-02): Exclude free disk
space from dired listing in this test, in case it changes while it's
running and confuses the result. (Bug#72120)
Jim Porter [Sat, 13 Jul 2024 18:43:42 +0000 (11:43 -0700)]
Don't save to history from 'eshell-command' when aborting
* lisp/eshell/eshell.el (eshell-add-input-to-history)
(eshell--save-history): Declare.
(eshell-command-mode-exit): New function...
(eshell-command-mode): ... use it.
* lisp/eshell/em-hist.el (eshell-hist-initialize): Don't handle
minibuffer logic here. Always read history file (this ensures that
'eshell-command' can see the history, too).
(eshell-add-command-to-history): Remove.
Eli Zaretskii [Sun, 14 Jul 2024 06:06:55 +0000 (09:06 +0300)]
Fix decoding 'display' properties with SVG images in Enriched mode
* lisp/textmodes/enriched.el (enriched-next-annotation): Reject
matches of 'enriched-annotation-regexp' inside strings. Reported
by Christopher Howard <christopher@librehacker.com> in
https://lists.gnu.org/archive/html/help-gnu-emacs/2024-06/msg00178.html.
Paul Eggert [Sun, 14 Jul 2024 05:16:26 +0000 (22:16 -0700)]
Minor renaming in timefns.c
* src/timefns.c (current_time_in_cform): Rename this static
function from current_time_in_form, since this is about enum cform
not enum timeform. Use changed.
Po Lu [Sun, 14 Jul 2024 04:46:23 +0000 (12:46 +0800)]
Do not set LD_LIBRARY_PATH during Android initialization
* doc/emacs/android.texi (Android Environment): Adjust
documentation to match.
* java/org/gnu/emacs/EmacsNoninteractive.java (main1): New
function. Remove initialization of EmacsNative hither.
(main): Acquire an ApplicationInfo or LoadedApk, as the case may
be on the host system, derive a ClassLoader from the result, and
load and call `main1' from within this class loader.
* src/android-emacs.c (main):
* src/android.c (setEmacsParams): Do not override
LD_LIBRARY_PATH or set EMACS_LD_LIBRARY_PATH. This enables
Emacs to execute subprocesses in certain "fortified" Android
systems, amongst other things.
Jim Porter [Thu, 11 Jul 2024 23:29:37 +0000 (16:29 -0700)]
Treat SVG images like other image types in 'shr-put-image'
For both SVG and no-SVG builds, this works as expected (in the no-SVG
case, it would raise an error which subsequently gets ignored).
However, compared to the previous implementation, this lets users resize
SVG images just like every other image type (bug#71913).
Peter Oliver [Fri, 12 Jul 2024 09:52:23 +0000 (10:52 +0100)]
Fix 'wdired-test-unfinished-edit-01'
* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):
Don't modify the random directory name if, by chance, it happens
to contain the substring "foo" anywhere but immediately after the
slash. (Bug#72073)
Eli Zaretskii [Sat, 13 Jul 2024 10:16:42 +0000 (13:16 +0300)]
; Fix last change
* lisp/progmodes/java-ts-mode.el (java-ts-mode):
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Load the
Doxygen grammar quietly, so that if it isn't available, the user
is not annoyed. (Bug#71874)
Fontify doxygen support to 'c-ts-mode', 'c++-ts-mode' and 'java-ts-mode'
Add doxygen support to 'c-ts-mode', 'c++-ts-mode' and
'java-ts-mode' using tree-sitter-doxygen from
github.com/tree-sitter-grammars.
* lisp/progmodes/c-ts-common.el
(c-ts-mode-doxygen-comment-font-lock-settings): Add font locking
rules for doxygen comment.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--feature-list): Add
'document' feature.
(c-ts-mode--doxygen-comment-regex): New regular expression for
doxygen comments.
(c-ts-mode, c++-ts-mode): Add support for doxygen parser.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Add support for
doxygen parser. (Bug#71874)
F. Jason Park [Fri, 12 Jul 2024 21:41:54 +0000 (14:41 -0700)]
Fix invalid defcustom type for erc-buffers option
* lisp/erc/erc.el (erc-ensure-target-buffer-on-privmsg): Change
invalid inner `choice' to a `const' for the third-state `status'
variant, which is new in ERC 5.6 and Emacs 30. Thanks to Mattias
Engdegård for catching this.
Eli Zaretskii [Fri, 12 Jul 2024 06:58:53 +0000 (09:58 +0300)]
Fix infloop in 'shell-resync-dirs'
* lisp/shell.el (shell-eval-command): Fix detection of newline
after last output line. (Bug#71896)
(shell-resync-dirs): Make sure the inner loop never infloops.
Suggested by Troy Hinckley <troyhinckley@dabrev.com>.