F. Jason Park [Tue, 1 Aug 2023 05:20:01 +0000 (22:20 -0700)]
; Relax timeouts on some ERC tests
There have been three failures (all on native-comp-speed2-master) over
the last three weeks pointing to these tests, which haven't changed in
the year-plus they've existed in tree. No test appears in multiple
failures, and all continue to pass daily on commercial GitLab (GCP)
runners using the same EMBA container image. They also pass locally
with "make check" and "make -j -C test SELECTOR=t check-lisp-erc". If
these tweaks don't fix the problem, they can be branded :unstable.
Michael Albinus [Tue, 15 Aug 2023 13:23:20 +0000 (15:23 +0200)]
Some Tramp optimizations
* lisp/net/tramp-sh.el (tramp-perl-file-name-all-completions):
Extend. It shall return also some basic file attributes.
(tramp-bundle-read-file-names): Simplify data to be transferred.
(tramp-sh-handle-file-name-all-completions): Read additional attributes.
(tramp-sh-handle-expand-file-name): Check also "doas".
(tramp-bundle-read-file-names): Handle changed data layout.
(tramp-find-file-exists-command): Set "file-exists-p" file property.
Stefan Kangas [Mon, 14 Aug 2023 19:34:34 +0000 (21:34 +0200)]
Add native WebP support on macOS (Bug#59242)
* src/image.c (syms_of_image)
[HAVE_NATIVE_IMAGE_API && HAVE_NS && NS_IMPL_COCOA]:
Add webp as an image type.
* src/nsimage.m (ns_can_use_native_image_api)
[NS_IMPL_COCOA && !HAVE_WEBP]: Add webp to list of possible image
types in the native image support lookup.
* lisp/emacs-lisp/ert.el (ert-deftest):
Since the return value of the body isn't going to be used, ignore
it explicitly so that the compiler can warn if we try to return
something anyway. In particular, this exposes some comparisons
whose result weren't actually checked.
Po Lu [Mon, 14 Aug 2023 08:45:27 +0000 (16:45 +0800)]
Correct touch screen event translation
* lisp/touch-screen.el (touch-screen-handle-point-up)
<mouse-drag>: Provide for situations where both the old and new
posns land on a special area of the window by comparing their
nominal row, column, and area.
Po Lu [Mon, 14 Aug 2023 05:15:08 +0000 (13:15 +0800)]
Improve efficiency of checking for access to authority documents
* java/org/gnu/emacs/EmacsService.java (checkContentUri): Take a
string instead of a byte array. Then, use
checkCallingUriPermission, in lieu of opening the file.
* src/android.c (android_check_content_access): Delete unused
function.
(android_init_emacs_service): Adjust for changes to
checkContentUri's signature.
* src/androidvfs.c (android_get_content_name): Return the file
name in a new buffer.
(android_check_content_access): Adjust correspondingly.
(android_authority_name): Verify NAME is a valid JNI string.
Stefan Kangas [Sun, 13 Aug 2023 13:08:16 +0000 (15:08 +0200)]
Remove dead code in `eshell/diff`
* lisp/eshell/em-unix.el (eshell/diff): Adjust for diff-mode; do not
set 'compilation-finish-functions', as it is never used. (Bug#65245)
(eshell-diff-quit): Make into an obsolete function alias for 'ignore';
the command has been a no-op for close to two decades.
(eshell-diff-window-config): Make obsolete.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns)
(side-effect-and-error-free-fns)
(byte-compile-side-effect-and-error-free-ops)
(byte-compile-side-effect-free-ops):
Demote `equal` and `equal-including-properties` from error-free to
merely side-effect-free since they may in fact signal error on
circularity.
Eli Zaretskii [Sun, 13 Aug 2023 06:34:20 +0000 (09:34 +0300)]
Avoid unexpected implicit completion in find-func.el
* lisp/emacs-lisp/find-func.el (find-function-read): Don't allow
implicit completion, which could produce unexpected results.
Patch by Jens Schmidt <jschmidt4gnu@vodafonemail.de>. (Bug#65058)
Po Lu [Sun, 13 Aug 2023 03:10:50 +0000 (11:10 +0800)]
Fix the MS-DOS build
* msdos/sedlibmk.inp (OMIT_GNULIB_MODULE_boot-time): Define to
true.
* src/filelock.c (get_boot_sec) [MSDOS]: Return 0; this
information is probably unavailable. It is also irrelevant as
MS-DOS is a single-process operating system.
Po Lu [Sun, 13 Aug 2023 02:55:48 +0000 (10:55 +0800)]
; Fix FSF address in some files' copyright notices
* src/sfnt.c:
* src/sfnt.h:
* src/sfntfont-android.c:
* src/sfntfont.c:
* src/sfntfont.h: Replace the old FSF address with a link to
gnu.org/licenses. These addresses were inadvertently imported
when sfnt.c was copied to src.
Paul Eggert [Sun, 13 Aug 2023 02:39:11 +0000 (19:39 -0700)]
Improve boot-time gathering
Simplify Emacs proper by using Gnulib’s boot-time module
instead of doing it all by hand. This should port Emacs
better to obscurish hosts, as Bruno Haible has merged the
best of Emacs’s and Gnulib’s boot-time gathering.
* lib/boot-time-aux.h, lib/boot-time.c, lib/boot-time.h:
* lib/readutmp.h, m4/readutmp.m4: New files, copied from Gnulib.
* admin/merge-gnulib (GNULIB_MODULES): Add boot-time.
* configure.ac: Do not check for utmp.h;
the boot-time module now does this.
(BOOT_TIME_FILE): Remove; no longer used.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/filelock.c [__FreeBSD__]: Do not include <sys/sysctl.h>.
[HAVE_UTMP_H]: Do not include utmp.h.
Include boot-time instead: boot-time does the work now.
(BOOT_TIME) [HAVE_ANDROID && !ANDROID_STUBIFY]: Don’t undef.
(WTMP_FILE): Don’t define.
(boot_time, boot_time_initialized, get_boot_time_1, get_boot_time):
Remove.
(get_boot_sec): New function that simply calls Gnulib get_boot_time.
(lock_file_1, current_lock_owner): Use get_boot_sec instead
of get_boot_time.
Po Lu [Sun, 13 Aug 2023 01:45:36 +0000 (09:45 +0800)]
Fix bootstrap-clean in the cross directory on USG
* cross/Makefile.in (FIND_DELETE): New variable.
(CLEAN_SUBDIRS): Avoid including src if not already present.
(clean, bootstrap-clean, etc): Use FIND_DELETE.
Paul Eggert [Sat, 12 Aug 2023 19:50:15 +0000 (12:50 -0700)]
Avoid stpncpy
It’s not worth the porting hassle, and as the glibc manual says,
“this function is generally a poor choice for processing strings”.
* admin/merge-gnulib (GNULIB_MODULES): Remove stpncpy.
* exec/configure.ac: Do not check for stpncpy.
* exec/exec.c (rpl_stpncpy, stpncpy): Remove this replacement.
(exec_0): Properly clear buffer1. Use memcpy instead of
stpncpy to add the trailing name. This code is clearly
still suboptimal but efficiency is not that important here
and I tried to minimize the change.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Paul Eggert [Sat, 12 Aug 2023 19:50:15 +0000 (12:50 -0700)]
Adjust to recent Gnulib changes
The Gnulib regex module now pulls in some wide-char stuff
that I think Emacs doesn’t need.
* admin/merge-gnulib (AVOIDED_MODULES): Add iswblank, iswctype,
iswdigit, iswxdigit, wctype.
Eli Zaretskii [Sat, 12 Aug 2023 17:50:38 +0000 (13:50 -0400)]
Merge from origin/emacs-29
842dbf500e0 * Fix `batch-byte+native-compile' target directory. 8dbd5aa1eef Avoid crashes in 'display_count_lines' when current buffe... 47b4f4cf783 ; * doc/emacs/mini.texi (Completion Commands): Fix a typo... 78999d52136 Update csharp tree-sitter support due to upstream changes 556cb01b48e Substitute command keys in 'ielm-header' at use time 99367078e50 ; * etc/PROBLEMS: Add entry about XIM problems (bug#65205). 03e897c08fa Fix rare crashes in redisplay due to problems with fontsets b1ba06a1e4b Fix a typo in 'leuven-dark-theme.el' e80a9dcabb9 ; * admin/git-bisect-start: Update failing commits 9091f42784b ; * admin/git-bisect-start: Update failing commits 344ac529ca9 ; * etc/PROBLEMS: Fix typo. bccf848b26c Adapt Tramp test 71bc060e403 Properly expand the JSX indentation rules in 'js-ts-mode' 889cfb42ed9 * Add `emacs-lisp-native-compile' to easy-menu. 4535aafa8a3 * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Si... 173af0cad51 * Introduce `emacs-lisp-native-compile'. 063d7d89d7a Fix the -x switch in non-X builds 5a7fb0b39b7 Document that `set-mouse-color' does not work everywhere d06fc72496f ; * doc/emacs/dired.texi (Misc Dired Features): Fix last ... 97b8ac376b5 Fix the effects and documentation of 'dired-free-space' 75c72e59f69 ; Fix typo 6d11b7b3007 Fix cross-reference to eldoc in eglot manual 913e50aba6c Add native-compilation to Emacs Lisp mode menu b93107c20b2 Fix emacs-lisp-native-compile-and-load eln target directo...
Translate or-patterns that (even partially) match single characters
into character alternatives which are more efficient in matching,
sometimes algorithmically so. Example:
(or "%" (in "a-z") space)
was previously translated to
"%\\|[a-z]\\|[[:space:]]"
but now becomes
"[%a-z[:space:]]"
Single-char patterns include `nonl` and `anychar`, which now can also
be used in set operations (union, complement and intersection), and
character classes. For example, `(or nonl "\n")` is now equivalent to
`anychar`.
Stefan Kangas [Sat, 12 Aug 2023 14:30:08 +0000 (16:30 +0200)]
Convert dictionary-mode to define-derived-mode
* lisp/net/dictionary.el (dictionary-instances): Delete.
(dictionary-mode): Use define-derived-mode.
(dictionary--count-mode-buffers): New function.
(dictionary-close): Use above new function.
Stefan Kangas [Sat, 12 Aug 2023 10:43:19 +0000 (12:43 +0200)]
Stop `use-package-report` from displaying an empty buffer
* lisp/use-package/use-package-core.el (use-package-report): Signal
user-error if there are no statistics to display, instead of showing
an empty buffer.
J M [Thu, 10 Aug 2023 22:23:20 +0000 (23:23 +0100)]
Update csharp tree-sitter support due to upstream changes
A change in tree-sitter-c-sharp grammar for csharp (commit
18a531), has removed the keyword void_keyword and advised
we should use predefined_type.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Support both old and new style of keywords in tree-sitter-c-sharp
grammar. (Bug#65113)
Matthew Tromp [Thu, 10 Aug 2023 14:41:24 +0000 (10:41 -0400)]
Substitute command keys in 'ielm-header' at use time
Before, command keys were substituted into the ielm-header when
ielm.el was loaded, which resulted in the substitutions depending on
the user's current buffer instead of the ielm buffer.
For example, if the user was in an info-mode buffer, the key would
appear as 'H' instead of 'C-h m'.
Now, the command key is substituted after the ielm buffer has been
created.
* lisp/ielm.el (ielm-header): Remove substitute-command-keys.
(inferior-emacs-lisp-mode): Add substitute-command-keys. (Bug#65213)
Eli Zaretskii [Sat, 12 Aug 2023 06:38:28 +0000 (09:38 +0300)]
Fix rare crashes in redisplay due to problems with fontsets
* src/xdisp.c (get_next_display_element): If we have no usable
face to display a character/composition, treat that as glyphless.
(produce_glyphless_glyph): If neither it->face nor its ASCII face
are usable, fall back to the frame's default font. (Bug#65198)
Paul Eggert [Sat, 12 Aug 2023 06:09:39 +0000 (23:09 -0700)]
Update lists of non-UTF files
* .gitattributes: Don't diff text files with encodings
incompatible with UTF-8. Add some new binary file extensions,
like '.webp'. etc/e/eterm-direct and java/emacs.keystore
are also binary.
* admin/notes/unicode: Update similarly.
This fixes what I consider to be the core of the bug, by handling
`cl--labels-convert-cache` more carefully (i.e. being more careful how
we look up its value and by flushing it ASAP).
Po Lu [Sat, 12 Aug 2023 02:21:34 +0000 (10:21 +0800)]
Improve precision pixel scrolling
* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page)
(pixel-scroll-precision-scroll-up-page): Use
pos-visible-in-window-p to opt between the next line or to the
window start rather than computing the next position by hand.
(pixel-scroll-precision-mode): Disable
make-cursor-line-fully-visible. (bug#65214)
* src/image.c (jpeg_load_body): Fix crash if libjpeg detects an
error before ximg is initialized.
* src/xdisp.c (display_and_set_cursor): Don't display cursor in
vscrolled-away row.
Dmitry Gutov [Sat, 12 Aug 2023 00:58:53 +0000 (03:58 +0300)]
Unbreak project-find-file's future history when cpd is not root
* lisp/progmodes/project.el (project-find-file): Pass in
buffer-file-name as absolute name (bug#63829).
(project--read-file-cpd-relative): Make it relative to the
appropriate common parent dir.
Po Lu [Fri, 11 Aug 2023 08:08:16 +0000 (16:08 +0800)]
Improve kill-ring-deindent-mode
* etc/NEWS:
* lisp/simple.el (kill-ring-deindent-buffer-substring-function):
(kill-ring-deindent-mode): Deindent by the column number at BEG
in lieu of the indentation at BEG.
Po Lu [Fri, 11 Aug 2023 07:58:31 +0000 (15:58 +0800)]
New global minor mode `kill-ring-deindent-mode'
* etc/NEWS: Announce the new minor mode.
* lisp/simple.el (kill-ring-deindent-buffer-substring-function):
New function.
(kill-ring-deindent-mode): New minor mode, for trimming excess
indentation from saved text.
Po Lu [Fri, 11 Aug 2023 06:55:21 +0000 (14:55 +0800)]
Minor adjustments to Android port
* java/org/gnu/emacs/EmacsService.java (readDirectoryEntry):
Also refrain from returning NULL or file names containing
non-representable NULL bytes.
* src/callproc.c (get_current_directory): Clean up by employing
android_is_special_directory.