Eli Zaretskii [Sat, 19 Aug 2023 07:34:07 +0000 (10:34 +0300)]
Fix behavior of client frames when 'find-alternate-file' is used
* lisp/files.el (find-alternate-file-dont-kill-client): New var.
(find-alternate-file): Bind it to a special value when invoking
kill-buffer-hook.
* lisp/server.el (server-delete-client): If NOFRAME is
'dont-kill-client', don't kill the client and its terminals.
(server-buffer-done): Pass 'find-alternate-file-dont-kill-client'
to 'server-delete-client'. (Bug#65277)
Po Lu [Sat, 19 Aug 2023 05:25:42 +0000 (13:25 +0800)]
Make some file I/O operations more robust on Android
* src/android.h (android_readlinkat): New prototype.
* src/androidvfs.c (struct android_vops): New function pointer
`readlink'.
(unix_vfs_ops, android_unix_readlink, afs_vfs_ops)
(android_afs_readlink, content_vfs_ops, android_content_mkdir)
(android_content_chmod, authority_vfs_ops)
(android_authority_readlink, saf_root_vfs_ops)
(android_saf_root_readlink, saf_tree_vfs_ops)
(android_saf_tree_readlink, saf_file_vfs_ops, saf_new_vfs_ops)
(android_saf_new_readlink, root_vfs_ops): Implement new
`readlink' vops for each vnode type.
(android_readlinkat): New function.
* src/fileio.c (Fcopy_file): Be more flexible about SELinux
errors under Android.
(emacs_readlinkat): Use `android_readlink' when built as
libemacs.so.
Po Lu [Sat, 19 Aug 2023 00:48:20 +0000 (08:48 +0800)]
Disable text conversion within read-char-from-minibuffer
* lisp/subr.el (read-char-from-minibuffer): Disable text
conversion. (bug#65370)
(y-or-n-p): Remove redundant binding of
`override-text-conversion-style', given that read-key already
disables text conversion.
* src/textconv.c (Fset_text_conversion_style): Always reset text
conversion for the selected frame in addition to any displaying
current_buffer.
Eli Zaretskii [Thu, 17 Aug 2023 18:35:20 +0000 (21:35 +0300)]
Fix invocation with --debug-init and changes to debug-ignored-errors
* src/eval.c (syms_of_eval) <debug-ignored-errors>: Mention in the
doc string the caveat with removing errors from the standard value
while invoking Emacs with --debug-init.
* lisp/startup.el (startup--load-user-init-file): If the user's
init files add to the value of 'debug-ignored-errors', make sure
the additions are preserved after restoring the value we reset
during loading the init file, if Emacs was invoked with
"--debug-init". (Bug#65267)
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.