Po Lu [Sun, 20 Aug 2023 13:40:08 +0000 (21:40 +0800)]
Repair desktop notification display on Android 2.3 and 2.2
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Create a pending intent and set it as the contentIntent when
building a notification by hand.
* java/org/gnu/emacs/EmacsDesktopNotification.java: New file.
* java/res/layout/sdk8_notifications_view.xml: New file holding
substitute notification widget definitions for Android versions
prior to 3.0.
* java/res/values/strings.xml: Remove inadvertently introduced
tag attribute.
* lisp/org/org-clock.el (haiku-notifications-notify): Correct
file name in function declaration.
(android-notifications-notify): New declaration.
(org-show-notification): Use `android-notifications-notify'.
* src/androidselect.c (android_init_emacs_desktop_notification)
(android_notifications_notify_1, Fandroid_notifications_notify):
New functions.
(init_androidselect, syms_of_androidselect): Initialize new
class and define new subr.
Eli Zaretskii [Sun, 20 Aug 2023 08:48:03 +0000 (11:48 +0300)]
; Fix documentation of last change
* lisp/net/eww.el (eww--open-url-in-new-buffer)
(eww-open-in-new-buffer):
* etc/NEWS:
* doc/misc/eww.texi (Basics): Improve the documentation of this
new feature. (Bug#65346)
Po Lu [Sun, 20 Aug 2023 04:44:38 +0000 (12:44 +0800)]
Update Android port
* src/sfnt.c (sfnt_decompose_compound_glyph): New argument
GET_METRICS. Call this function to retrieve glyph metrics used
to compute phantom points when a component glyph's anchor point
is one.
(sfnt_decompose_glyph, sfnt_build_glyph_outline): Plumb
GET_METRICS these two functions.
(sfnt_interpret_shc): Don't shift the provided reference point.
(sfnt_transform_f26dot6): Eschew looping through X and Y if no
offsets are provided.
(sfnt_interpret_compound_glyph_2): Discontinue initializing
phantom points here.
(sfnt_interpret_compound_glyph_1): Do not incorporate phantom
points into the ultimately produced glyph outline. Correctly
provide for phantom childanchor points.
(sfnt_test_get_metrics, main): Update tests.
* src/sfnt.h: Update prototypes.
* src/sfntfont.c (struct sfntfont_get_glyph_outline_dcontext):
New fields `hmtx', `hhea' and `maxp'.
(sfntfont_get_metrics): New function.
(sfntfont_get_glyph_outline): Provide new tables and the new
callback function.
Ken Brown [Sat, 19 Aug 2023 18:18:57 +0000 (14:18 -0400)]
Skip hanging tests on Cygwin (bug#65325)
* test/lisp/server-tests.el (server-tests/can-create-frames-p):
Define to be nil on Cygwin unless Emacs has at least one of the
features gfilenotify, dbus, or threads. This causes three tests
to be skipped.
* test/src/keyboard-tests.el (keyboard-unread-command-events):
Skip on Cygwin unless Emacs has at least one of the features
gfilenotify, dbus, or threads.
Stefan Kangas [Sat, 19 Aug 2023 10:25:25 +0000 (12:25 +0200)]
Remove Emacs 24 compat code from reftex
* lisp/textmodes/reftex-index.el (reftex-display-index):
* lisp/textmodes/reftex-toc.el (reftex-toc): Assume that we have
'cursor-intangible-mode', which was added in Emacs 25.
Stefan Kangas [Sat, 19 Aug 2023 10:21:57 +0000 (12:21 +0200)]
Remove XEmacs compat code from reftex
* lisp/textmodes/reftex-toc.el (reftex-toc, reftex-toc-dframe-p)
(reftex-toc-revert, reftex-toc-toggle-dedicated-frame): Delete
XEmacs compat code.
* lisp/textmodes/reftex.el (reftex-window-height): Make into
obsolete function alias of 'window-height'. Update all callers.
(reftex-create-customize-menu): Assume recent version of cus-edit.el.
* lisp/emacs-lisp/package.el (package--dependencies): Extend function
to handle and return package descriptors.
(package-isolate): Add new command.
* etc/NEWS: Announce new command.
Mauro Aranda [Tue, 15 Aug 2023 22:35:39 +0000 (19:35 -0300)]
Specialize default-get for alist widgets (Bug#63290)
* lisp/wid-edit.el (widget-list-default-get)
(widget-alist-default-get): New functions.
(list, alist): Use it.
* test/lisp/cus-edit-tests.el (cus-edit-test-bug63290-option)
(cus-edit-test-bug63290-option-2): New test options.
(cus-edit-test-bug63290): New test.
* test/lisp/wid-edit-tests.el (widget-test-alist-default-value-1)
(widget-test-alist-default-value-2)
(widget-test-alist-default-value-3)
(widget-test-alist-default-value-4): New tests.
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.