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.
Make `value<` compare fixnums and floats by value, as `<` does, instead
of coercing the fixnum to a float first which is what C would do.
This matters when the fixnum cannot be represented as a float. For
example, C would evaluate
Eli Zaretskii [Wed, 3 Jul 2024 19:13:42 +0000 (22:13 +0300)]
Fix MS-Windows build with native-compilation
* src/w32.c (globals_of_w32): Move re-initialization of
Vlibrary_cache from here...
* src/emacs.c (main): ...to here, as it must be after load_pdump.
(Bug#71916)
Stefan Kangas [Wed, 3 Jul 2024 00:02:31 +0000 (02:02 +0200)]
Focus more on MS-Windows than MS-DOS in FAQ
* doc/misc/efaq.texi (Editing Windows files): Rename section from
"Editing MS-DOS files", and update the text to focus on Windows.
* doc/misc/efaq.texi (Colors on a TTY)
(Emacs does not display 8-bit characters): Mention MS-Windows before
MS-DOS.
Stefan Kangas [Mon, 1 Jul 2024 03:14:25 +0000 (05:14 +0200)]
Autoload some string functions
These functions are documented in both `(elisp) Creating Strings' and
'M-x shortdoc RET string RET', so users will expect them to be available
without having to require 'subr-x'.
Po Lu [Wed, 3 Jul 2024 09:05:24 +0000 (17:05 +0800)]
Adapt doc-view-set-slice-using-mouse to touch-screen input
* doc/lispref/commands.texi (Touchscreen Events): Document means
of unconditionally enabling simple conversion.
* lisp/doc-view.el (doc-view-set-slice-using-mouse): Bind
touch-screen-simple-mouse-conversion to t, and read translated
mouse events with read-key rather than read-event.
* lisp/subr.el (read-key): Don't permit idle timer to interfere
with reporting of translated mouse events.
* lisp/touch-screen.el (touch-screen-simple-mouse-conversion):
New variable.
(touch-screen-handle-point-up, touch-screen-handle-touch):
Unconditionally enable `mouse-drag' translation if set. Decide
whether to send drag or mouse events by the values of the two
touchpoints' XY positions and point and double-click-fuzz, as in
make_lispy_event.
Stefan Monnier [Tue, 2 Jul 2024 20:28:08 +0000 (16:28 -0400)]
(buf_*pos_to_*pos): Fix minor off-by one
* src/marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
Slightly restructure the markers loop so we check `distance`
also before "consider"ing the first marker.
Po Lu [Tue, 2 Jul 2024 04:10:43 +0000 (12:10 +0800)]
Port seccomp acceleration to Linux 3.5.0
* etc/NEWS: Update correspondingly.
* exec/Makefile.in (config-mips.m4): Don't define rule
or predicate $(LOADOBJS) on it elsewhere than on MIPS.
* exec/README: Direct developers to GDB.
* exec/trace.c (finish_exec): Resume the tracee after reporting
an error in `exec'.
(after_fork): If seccomp is enabled on Android, and the kernel
is 4.7 or earlier, detect whether revisions to the sequencing of
seccomp events have been backported from 4.8.
(exec_waitpid): Resume the process with PTRACE_CONT after
receiving an unknown signal.
(exec_init): Cease disabling seccomp on Android kernels earlier
than 4.8.
Po Lu [Mon, 1 Jul 2024 10:11:58 +0000 (18:11 +0800)]
Optimize process execution on Android
* exec/configure.ac (REENTRANT): Remove option for reentrancy.
(PROGRAM_COUNTER, HAVE_SECCOMP): Define register providing the
program counter and enable seccomp if its headers are available.
* exec/exec.c (write_load_command): Avoid defining unused
variable.
(exec_0): Remove code specific to REENTRANT configurations.
* exec/exec.h (struct exec_tracee) <exec_data, data_size>: New
fields for loader instructions and their size.
* exec/exec1.c (main): Call exec_init before forking.
* exec/mipsel-user.h (ELF_NGREG): Delete definition.
(struct mipsel_regs): Reduce number of gregs to 32, but
introduce separate fields for special registers.
* exec/trace.c (use_seccomp_p): New variable; defile to false if
!HAVE_SECCOMP.
(remove_tracee): Cease providing for non-reentrant
configurations. Release executable data if present.
(handle_clone_prepare): Likewise. Resume process with
PTRACE_CONT if seccomp-based interception is enabled.
(handle_clone, check_signal): Resume processes as above.
(handle_exec): Divide into two functions, with only rewriting
the system call and generating instructions for the loader
remaining in the first, and copying such instructions into the
loader's stack removed into a new function, `finish_exec'.
(finish_exec): New function.
(handle_readlinkat, handle_openat): Abolish non-REENTRANT
configurations.
(process_system_call): Divide exec system calls into two phases,
disambiguated by the value of tracee->waiting_for_syscall. Typo
fixes. Accommodate syscall-exit-stops where the signal was
initially intercepted by `seccomp_system_call'.
(interesting_syscalls): New array.
(ARRAYELTS): New macro.
(seccomp_system_call, establish_seccomp_filter): New function.
(tracing_execve) [HAVE_SECCOMP]: Establish a seccomp filter if
this is to be enabled.
(after_fork): Provide PTRACE_O_TRACESECCOMP. Resume process
with PTRACE_CONT if seccomp-based interception is enabled.
(exec_waitpid): Resume process with PTRACE_CONT if seccomp-based
interception is enabled. Dispatch stops identifying as
PTRACE_EVENT_SECCOMP to `seccomp_system_call'.
(exec_init): Establish whether it is possible to enable seccomp.
Stefan Kangas [Sun, 30 Jun 2024 23:44:38 +0000 (01:44 +0200)]
Backport file backup FAQ item to Emacs <28
* doc/misc/efaq.texi (Not writing files to the current directory):
Backport recommendation to Emacs 27 or older.
Problem reported by David Hedlund <davidh@gnu.org>.
Eli Zaretskii [Sun, 30 Jun 2024 19:25:31 +0000 (22:25 +0300)]
More updates of documentation for Emacs 30
* etc/NEWS: Improve wording and move/mark entries.
* doc/lispref/positions.texi (List Motion): Document
'forward-sentence-function'.
* doc/lispref/functions.texi (What Is a Function): Document
'primitive-function-p' and 'cl-functionp'.
* doc/emacs/misc.texi (Saving Emacs Sessions): Improve wording and
indexing.
* doc/lispref/tips.texi (Documentation Tips): Adapt to the new
value of 'emacs-lisp-docstring-fill-column'.
* doc/emacs/fixit.texi (Spelling): Document
'flyspell-check-changes'.