Robert Pluim [Thu, 17 Aug 2023 10:15:44 +0000 (12:15 +0200)]
Escape braces in regexp in make-info-dir
This fixes a build failure on Alpine Linux.
* build-aux/make-info-dir (detexinfo): Escape the braces, since some
awk variants (such as BusyBox's) don't like regexp interval
specifications that aren't numbers. Bug#65323
Po Lu [Thu, 17 Aug 2023 02:03:49 +0000 (10:03 +0800)]
; Add tasks for the Android port
* etc/PROBLEMS: Improve descriptions of issues with Droid Sans
Mono and Anonymous Pro. Then, bring up the subject of CFF fonts
and how they relate to CJK text.
Po Lu [Thu, 17 Aug 2023 00:45:57 +0000 (08:45 +0800)]
Update Android port
* configure.ac (emacs_cv_tputs_lib): Only circumvent termcap if
Android windowing support is enabled. (bug#65340)
* etc/PROBLEMS: Fix typo in section recouting problems with the
Anonymous Pro font.
* lisp/subr.el (event-start, event-end): Return the mouse
position list tied to touchscreen-begin and end events.
Reported by Stefan Monnier <monnier@iro.umontreal.ca>.
* lisp/version.el (emacs-build-system, emacs-build-time)
(emacs-repository-get-version, emacs-repository-get-branch):
Bypass Android specific code on non-GUI builds running on
Android. (bug#65340)
* lisp/wid-edit.el (widget-event-point): Remove now redundant
code.
Jim Porter [Sun, 13 Aug 2023 19:07:39 +0000 (12:07 -0700)]
Add 'compile' builtin command for Eshell
* lisp/eshell/em-unix.el (eshell-compile, eshell/compile): New
functions.
(eshell/make, eshell-grep): Use 'eshell-compile'.
(eshell/glimpse): It's no longer necessary to let-bind 'null-device';
'eshell-grep' no longer calls 'grep' (the Lisp function), which needed
'null-device' to be nil for this case.
* test/lisp/eshell/em-unix-tests.el: New file.
* doc/misc/eshell.texi (Built-ins): Document the 'compile' builtin.
Gregory Heytings [Wed, 16 Aug 2023 15:58:39 +0000 (15:58 +0000)]
Simplify 'with-restriction' and 'without-restriction'
* lisp/subr.el (with-restriction, without-restriction): Merge the
bodies of the 'internal--with-restriction' and
'internal--without-restriction' function into the macros. The
result is more efficient than a funcall.
(internal--with-restriction, internal--without-restriction):
Remove.
Suggested by Mattias Engdegård.
* src/editfns.c: (Finternal__labeled_widen): Add a call to
'Fwiden', and rename from 'internal--unlabel-restriction'.
(unwind_labeled_narrow_to_region): Use the renamed function, and
remove the call to 'Fwiden'.
(syms_of_editfns): Rename the symbol.
* lisp/subr.el (internal--without-restriction): Use the renamed
function.
* lisp/org/ob-tangle.el (org-babel-interpret-file-mode):
Repair parts of regexp that should only match +, - and =.
* lisp/files.el (file-modes-symbolic-to-number):
Fix the same error in a doc string; this seems to be where
the mistake originated.
When we see \(:?...\) in a regexp it very much looks like a typo
for a \(?:...\) construct and often is, so do something about
all of these (one of which being another mistake).
Doing so silences an optional relint check.
* lisp/comint.el (comint-replace-by-expanded-history-before-point):
* lisp/term.el (term-replace-by-expanded-history-before-point):
Move :? out from capturing group where it does not need to be,
to avoid confusion.
* lisp/emacs-lisp/cl-indent.el (common-lisp-loop-part-indentation):
A capturing group isn't needed here; turn it into simple bracketing.
* lisp/progmodes/sql.el (sql--completion-table):
Change :? into ?: which was clearly meant here.
Eli Zaretskii [Wed, 16 Aug 2023 13:06:20 +0000 (16:06 +0300)]
Revert "Fix slow "C-h f" in Emacs built without native compilation"
This reverts commit 545f95d1a3213318389ecadc7cfff3f48b555b03.
It is no longer needed, as comp.el and comp-cstr.el are now
byte-compiled even if native-compilation is not built-in.
Po Lu [Wed, 16 Aug 2023 12:32:04 +0000 (20:32 +0800)]
Update Android port
* configure.ac: Test for getpwent using gl_CHECK_FUNCS_ANDROID.
(bug#65319)
* etc/MACHINES (Android): Mention that a non-GUI build is also
possible on Android.
* lisp/loadup.el: Provide for regular builds on Android.
(bug#65339)
* lisp/wid-edit.el (widget-event-start): Remove function, since
event-start now does the same thing.
(widget-button--check-and-call-button, widget-button-click):
Adjust correspondingly. Reported by Stefan Monnier
<monnier@iro.umontreal.ca>.
* src/sysdep.c (close_output_streams): Apply workarounds for the
file descriptor sanitizer on all builds where __ANDROID__ is
defined, not just Android port builds. (bug#65340)
Po Lu [Wed, 16 Aug 2023 03:02:55 +0000 (11:02 +0800)]
Fix display of compound glyphs that employ simple transforms
* src/sfnt.c (sfnt_transform_coordinates): Always compute an
affine transform matrix except if no scale is provided at all.
Unconditionally apply x_off and y_off.
(sfnt_decompose_compound_glyph): Delete arguments OF_X and
OFF_Y. Apply component offsets after writing simple glyph
contours.
(sfnt_decompose_glyph): Modify for new calling convention.
(sfnt_transform_f26dot6): Modify analogously to
sfnt_decompose_compound_glyph. Also correct anchor offset
computation to scale the unscaled component anchor coordinates
by the interpreter scale.
(sfnt_interpret_compound_glyph_1): Also modify for new calling
convention.
* src/sfnt.h (struct sfnt_compound_glyph_component): <u>: Make
scale fields signed.
F. Jason Park [Mon, 7 Aug 2023 05:05:26 +0000 (22:05 -0700)]
Add line-wise movement commands for erc-fill-wrap
* lisp/erc/erc-fill.el (erc-fill-line-spacing): Revise doc string.
(erc-fill--wrap-escape-hidden-speaker): New helper function to move
point to beginning of visible text.
(erc-fill--wrap-beginning-of-line): Factor out adjustment for hidden
speakers.
(erc-fill--wrap-previous-line, erc-fill--wrap-next-line): Add commands
for moving to previous and next line in a manner consistent with the
value of `erc-fill--wrap-visual-keys'.
(erc-fill-wrap-mode-map): Add remap bindings for `next-line' and
`previous-line'.
(erc-fill-wrap-mode): Revise doc string.
(erc-fill-wrap-nudge): Fix vertical anchoring so that point's line
remains steadier throughout the adjustment. (Bug#60936)
F. Jason Park [Mon, 7 Aug 2023 10:35:56 +0000 (03:35 -0700)]
Deprecate erc-button-nickname-callback-function
* lisp/erc/erc-button.el (erc-button-nickname-callback-function):
Deprecate this function-valued variable, first introduced in ERC 5.6
and Emacs 30, to dissuade consumers of the old `erc-button-alist'
nickname interface from meddling with the on-click callback of
buttonized nicks. If necessary, third parties can instead add their
own propertizing logic in something like `erc-insert-modify-hook'.
Also change default callback to a wrapper that discards all but the
first arg. This effectively declares that `erc-data' values for
nicknames may contain more than one element in the near future.
(erc-button--perform-nick-popup): New default nick-button callback
function wrapping `erc-nick-popup' in order to adapt it to the
`erc-button-nickname-callback-function' interface. (Bug#60933)
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.