* src/coding.c (make_string_from_utf8):
* src/fileio.c (file_name_directory):
* src/lread.c (Fintern):
* src/gnutls.c (Fgnutls_format_certificate):
Use `make_multibyte_string` and `make_unibyte_string` instead of
more expensive `make_specified_string` and `make_string_from_bytes`.
Michael Albinus [Tue, 9 Jul 2024 15:37:50 +0000 (17:37 +0200)]
Warn if D-Bus error "InteractiveAuthorizationRequired" occurs
* lisp/net/dbus.el
(dbus-error-interactive-authorization-required): New defconst.
(dbus-warn-interactive-authorization-required): New defun.
(dbus-event-error-functions): Add it.
Steven Allen [Tue, 9 Jul 2024 11:16:43 +0000 (13:16 +0200)]
Support interactive D-Bus authorization
When invoking D-Bus methods, let the user enable interactive
authorization by passing an :authorizable t parameter. This makes
it possible to D-Bus methods that require polkit authorization.
* configure.ac (HAVE_DBUS_MESSAGE_SET_ALLOW_INTERACTIVE_AUTHORIZATION):
Set a new variable if `dbus_message_set_allow_interactive_authorization'
is available.
* src/dbusbind.c (dbus-message-internal): Allow interactive
authorization by passing :authorizable t.
* doc/misc/dbus.texi (Synchronous Methods, Asynchronous Methods):
* etc/NEWS:
* lisp/net/dbus.el (dbus-call-method-asynchronously): Document the
new parameter.
Po Lu [Tue, 9 Jul 2024 01:35:16 +0000 (09:35 +0800)]
Fix byte-compiler warning in calc.el
* lisp/calc/calc.el
(calc-embedded-open-close-new-formula-alist): Remove previously
introduced quotation marks, as they bring the width of the doc
string past 80.
Stefan Monnier [Mon, 8 Jul 2024 21:09:31 +0000 (17:09 -0400)]
editorconfig-core-handle.el: Fix regressions in fnmatch handling
* lisp/editorconfig-core-handle.el
(editorconfig-core-handle-get-properties-hash): Fix computation of
relative file name.
(editorconfig-core-handle--fnmatch-p): Handle the case when `pattern`
doesn't have a `/` but does match the `/` character.
Po Lu [Mon, 8 Jul 2024 07:33:26 +0000 (15:33 +0800)]
Correct conditions for iconification on Android
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity)
<isPaused>: Rename to <isStopped>.
(attachWindow): Adjust to match.
(onPause): Delete function.
(onStop): Deem frames iconified after calls to onStop instead.
Michael Albinus [Sun, 7 Jul 2024 17:34:37 +0000 (19:34 +0200)]
Fix Tramp parser
* lisp/net/tramp.el (tramp-host-with-port-regexp): Declare.
(tramp-set-syntax): Set also `tramp-host-with-port-regexp'.
(tramp-build-host-with-port-regexp): New defun.
(tramp-host-with-port-regexp): Make it a defvar. (Bug#71972)
Stefan Kangas [Sun, 7 Jul 2024 11:40:59 +0000 (13:40 +0200)]
Make `checkdoc-verb-check-experimental-flag` default to nil
This user option leads to a very large amount of false positives in
practice. In my personal experience, almost all occurrences that are
flagged are false positives. Flipping the default to something less
intrusive should hopefully encourage more use of checkdoc.
* lisp/emacs-lisp/checkdoc.el
(checkdoc-verb-check-experimental-flag): Switch the default to nil.
Stefan Kangas [Sun, 7 Jul 2024 11:37:55 +0000 (13:37 +0200)]
checkdoc: Flag formatting mistakes in warnings
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-next-string)
(checkdoc-message-text-engine): Flag formatting mistakes in warnings.
(checkdoc--warning-function-re): New variable.
Juri Linkov [Sun, 7 Jul 2024 06:57:34 +0000 (09:57 +0300)]
* lisp/files.el (insert-directory): Quote switches in wildcard case.
Use shell-quote-wildcard-pattern on the switches string split by
split-string-and-unquote. This helps to quote such switches as
"--block-size='1" (bug#71935).
Juri Linkov [Sun, 7 Jul 2024 06:52:01 +0000 (09:52 +0300)]
Fix uses of 'dired-omit-mode' (bug#71905)
* lisp/dired.el (dired-jump): Disable dired-omit-mode with -1.
* lisp/files.el (recover-session): Disable dired-omit-mode
explicitly afterwards instead of modifying dired-mode-hook
that fails when it contains a lambda.
Stefan Kangas [Sun, 7 Jul 2024 02:31:01 +0000 (04:31 +0200)]
Fix fontification of network files in `awk-mode`
* lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Fix fontification
of special network file names such as "/inet4/tcp/0/localhost/daytime".
See Info node '(gawk) TCP/IP Networking'.
Po Lu [Sun, 7 Jul 2024 02:19:31 +0000 (10:19 +0800)]
Correct JNI string error checking and miscellaneous corrections
* src/android-emacs.c (main): Do not attempt to load the
bootstrap class path, which is redundant on all Android releases.
* src/android.c (initEmacs, android_browse_url): Do not assume
exceptions will be raised if GetStringUTFChars fails. Decode
Android JNI strings as Qandroid_jni.
* src/androidvfs.c (android_saf_check_nonnull): New function.
(android_saf_new_mkdir): Likewise.
JD Smith [Sat, 6 Jul 2024 13:22:33 +0000 (09:22 -0400)]
Fix formatting of tables with thead/tfoot but no tbody
Correctly handle formatting of tables containing thead and/or tfoot, but
without any tbody, to prevent including thead/tfoot content twice within
the table's derived body.
* lisp/net/shr.el (shr--fix-tbody): Omit 'thead' and 'tfoot' from
implicit body. (Bug#71685)
* test/lisp/net/shr-resources/table.html:
* test/lisp/net/shr-resources/table.txt: New tests for table rendering.
Vincenzo Pupillo [Thu, 27 Jun 2024 14:13:58 +0000 (16:13 +0200)]
Fix treesit range rule for jsdoc
The parser for jsdoc is local, so it is necessary for the range
rule to take this into account.
* lisp/progmodes/js.el (js-ts-mode): Add ':local' keyword.
(js-ts-language-at-point): Remove 'js-ts-language-at-point'.
(Bug#71776)
Daniel Semyonov [Mon, 1 Jul 2024 22:42:26 +0000 (01:42 +0300)]
nnfeed: (Mostly) fix group descriptions
* lisp/gnus/nnfeed.el (nnfeed--group-description): New function.
(nnfeed-request-group-description, nnfeed-request-list-newsgroups):
Use `nnfeed--group-description' and always return t if group data
is found. (Bug#71888)
Eli Zaretskii [Sat, 6 Jul 2024 07:32:39 +0000 (10:32 +0300)]
Fix returning to original TTY frame after 'rmail-reply'
* lisp/mail/rmail.el (rmail-start-mail): Record the frame from
which an Rmail command, such as 'rmail-mail' or 'rmail-reply', was
invoked.
(rmail--find-orig-rmail-frame): New function.
(rmail-mail-return): Use 'rmail--find-orig-rmail-frame' to find
the original frame, and make it the top frame on its TTY terminal.
(Bug#69738)
Eli Zaretskii [Fri, 5 Jul 2024 19:00:08 +0000 (22:00 +0300)]
Improve warnings from native compiler
* src/comp.c (syms_of_comp) <native-compiler>: Rename from 'comp'.
* src/lread.c (maybe_swap_for_eln):
* lisp/emacs-lisp/comp.el (comp--fwprop):
* lisp/emacs-lisp/comp-run.el
(comp--accept-and-process-async-output, native--compile-async):
Adjust to the new symbol.
Stefan Monnier [Fri, 5 Jul 2024 14:02:39 +0000 (10:02 -0400)]
perl-mode.el: Improve indent after hanging open-paren
Make the indentation of the code right after an open paren/brace
use the same rule as already used to indent the corresponding
matching paren/brace.
* lisp/progmodes/perl-mode.el (perl-calculate-indent):
Use `perl-indent-new-calculate`s "virtual" indentation instead of
approximating it with `current-indentation`.
Eli Zaretskii [Fri, 5 Jul 2024 10:58:11 +0000 (13:58 +0300)]
Fix file-name detection in Dired under -F
* lisp/files.el (insert-directory-clean): Support all the symbols
appended to file names by the -F/--classify option of 'ls'. See
https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg00366.html
for the details.
Po Lu [Fri, 5 Jul 2024 04:09:52 +0000 (12:09 +0800)]
Enable Gnulib substitute on Android systems with defective strnlen
* configure.ac (AC_FUNC_STRNLEN): Detect a bug where strnlen is
liable to integer overflows if addition of the search limit to
the string would also overflow.
Jim Porter [Sun, 23 Jun 2024 21:53:49 +0000 (14:53 -0700)]
In SHR, load from URL cache if possible when zooming images
* lisp/net/shr.el (shr-replace-image): New function extracted from...
(shr-image-fetched): ... here.
(shr-zoom-image): Check URL cache and call 'shr-replace-image' if we
can.
Jim Porter [Sun, 23 Jun 2024 21:48:32 +0000 (14:48 -0700)]
Fix the different image zoom levels in SHR to work as expected
* lisp/net/shr.el (shr-image-zoom-levels): New option.
(shr-image-zoom-level-alist): New variable.
(shr-zoom-image): Take POSITION and ZOOM-LEVEL arguments. Consult
'shr-image-zoom-levels'.
(shr-put-image): Use 'shr-image-zoom-level-alist'.
(shr-rescale-image): Only reset width *or* height when either is too
large.
(shr--image-zoom-original-size, shr--image-zoom-image-size)
(shr--image-zoom-fill-height): New functions.
Jim Porter [Sun, 23 Jun 2024 19:25:25 +0000 (12:25 -0700)]
In SHR, keep track of image sizes as specified by the HTML
Previously, these values got lost when zooming the image.
* lisp/net/shr.el (shr-tag-img): Set 'image-dom-size'...
(shr-zoom-image): ... use it. Rename 'size' to 'zoom'.
(shr-image-fetched): Rename 'image-size' to 'image-zoom'.
(shr-put-image): Accept the zoom level as ':zoom' and document it.
Previously, FLAGS was a mix of alist and plist(!).
* test/lisp/net/shr-tests.el (shr-test/zoom-image): Rename "size" to
"zoom".
Jim Porter [Sun, 23 Jun 2024 19:18:57 +0000 (12:18 -0700)]
Slice images based on their height in SHR, not their zoom level
* lisp/net/shr.el (shr-sliced-image-height): New option...
(shr-put-image): ... use it. Compute the number of slices in relation
to the image height; this way, each slice is roughly the height of a
line of ordinary text.
* test/lisp/net/shr-tests.el (shr-test/zoom-image): Update test, since
zooming no longer necessarily triggers slicing.