Steven Allen [Wed, 2 Jul 2025 21:32:28 +0000 (14:32 -0700)]
Retain the <base> tag when making a page in EWW document readable
The base tag is necessary to correctly resolve relative links.
* lisp/net/eww.el (eww-readable-dom): Retain the base tag in addition to
the title/link tags. (Bug#78948)
* test/lisp/net/eww-tests.el (eww-test--wordy-page): Add a base tag.
(eww-test/readable/default-readable): Test that the base tag is retained.
Sean Whitton [Thu, 3 Jul 2025 19:09:14 +0000 (20:09 +0100)]
VC: Make incoming-revision backend function responsible for fetching
* lisp/vc/vc-hg.el (vc-hg-incoming-revision): Pull the incoming
revision if we don't have it.
(vc-hg-mergebase): Don't invoke 'hg pull'.
* lisp/vc/vc.el: Document that the incoming-revision backend
function, for distributed VCS, should fetch the incoming
revision into local storage.
uniquify-get-unique-names: Return a list with propertized strings
* lisp/uniquify.el (uniquify-get-unique-names): Return a list of
strings, and add text property 'uniquify-orig-buffer' to each,
pointing at the corresponding buffers (bug#77312).
* lisp/progmodes/project.el (project--read-project-buffer):
Look up that property's values here and build the alist.
In [1: 77a4c63fda5] "all" code sections were needlessly nested
below the ";;; Code:" section, which I do not like but can live
with. However, a few sections were missed; nest them here too.
Also put the "frontmatter" code, which in my libraries usually
is the only code located in the ";;; Code:" section, into a new
";;;; Frontmatter" sub-section. That way it is possible again
to cycle to the "show all headings but no code" state.
Sean Whitton [Tue, 1 Jul 2025 14:44:12 +0000 (15:44 +0100)]
VC-Hg: Use generic log-incoming & log-outgoing
* lisp/vc/vc-hg.el (vc-hg-print-log): Implement string LIMIT for
this backend. Use a DAG range when 'vc-log-view-type' is
'log-outgoing'. Document differences between -rN:M and -rN::M.
(vc-hg-log-view-mode): Treat 'log-incoming' and 'log-outgoing'
values for 'vc-log-view-type' as short logs too.
(vc-hg-log-incoming, vc-hg-log-outgoing): Delete.
Sean Whitton [Tue, 1 Jul 2025 14:39:39 +0000 (15:39 +0100)]
vc-hg-mergebase: Try a pull if first attempt fails
* lisp/vc/vc-hg.el (vc-hg-mergebase): If the first attempt
fails, execute a pull, then try again.
(vc-hg-incoming-revision): Use 'hg identify' not 'hg incoming'.
Roi Martin [Tue, 17 Jun 2025 17:21:18 +0000 (19:21 +0200)]
Update `fill-region-as-paragraph-semlf' to follow fill.el protocols
Update the `fill-region-as-paragraph-semlf' function to follow the
`fill-region-as-paragraph-function' protocol. This allows us to
reimplement the `fill-paragraph-semlf' function using `fill-paragraph'
and `fill-region-as-paragraph-function'.
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Make this
function compatible with `fill-region-as-paragraph-function'. Avoid
narrowing.
(fill-paragraph-semlf): Reimplement using `fill-paragraph' and
`fill-region-as-paragraph-function'.
* test/lisp/textmodes/fill-tests.el (fill-test-semlf-fill-region): Add
test.
(fill-test-fill-paragraph-semlf-fill-paragraph-function): Remove test.
(fill-test-fill-paragraph-semlf, fill-test-semlf)
(fill-test-fill-paragraph-semlf-justify, fill-test-semlf-justify)
(fill-test-fill-paragraph-semlf-sentence-end-double-space)
(fill-test-semlf-sentence-end-double-space)
(fill-test-fill-paragraph-semlf-fill-column, fill-test-semlf-fill-column)
(fill-test-fill-paragraph-semlf-punctuation-marks)
(fill-test-semlf-punctuation-marks, fill-test-fill-paragraph-semlf-twice)
(fill-test-semlf-twice, fill-test-fill-paragraph-semlf-fill-prefix)
(fill-test-semlf-fill-prefix)
(fill-test-fill-paragraph-semlf-indented-block)
(fill-test-semlf-indented-block, fill-test-fill-paragraph-semlf-revert)
(fill-test-semlf-revert, fill-test-fill-paragraph-semlf-emacs-lisp-mode)
(fill-test-semlf-emacs-lisp-mode, fill-test-fill-paragraph-semlf-c-mode)
(fill-test-semlf-c-mode, fill-test-fill-paragraph-semlf-org-mode)
(fill-test-semlf-org-mode, fill-test-fill-paragraph-semlf-markdown-mode)
(fill-test-semlf-markdown-mode): User shorter function names consistent
with erts file names.
* test/lisp/textmodes/fill-resources/semlf-fill-region.erts: Add test
data.
* test/lisp/textmodes/fill-resources/semlf-fill-paragraph-function.erts:
Delete file.
* test/lisp/textmodes/fill-resources/semlf-emacs-lisp-mode.erts: Remove
newlines around indented block.
* doc/lispref/text.texi (Filling): Highlight that
`fill-region-as-paragraph-function' changes the behavior of
`fill-paragraph'.
Sean Whitton [Sun, 29 Jun 2025 13:53:37 +0000 (14:53 +0100)]
VC: Fix several START-REVISION versus LIMIT issues
* lisp/vc/vc-git.el (vc-git-print-log): When LIMIT and
START-REVISION are both supplied, use START-REVISION as the
newest commit, and LIMIT as a base (problem was introduced in
the commit adding 'vc-diff-mergebase' and 'vc-log-mergebase').
* lisp/vc/vc.el (vc-default-log-incoming)
(vc-default-log-outgoing): Fix order of START-REVISION and LIMIT
arguments passed to 'print-log' backend function.
(vc-log-mergebase): Fix order of START-REVISION and LIMIT
arguments passed to 'vc-print-log-internal'.
Roi Martin [Tue, 17 Jun 2025 08:45:13 +0000 (10:45 +0200)]
Add variable `fill-region-as-paragraph-function'
Add the variable `fill-region-as-paragraph-function' to provide
a way to override how functions like `fill-region' fill text.
* doc/lispref/text.texi (Filling): Document
`fill-region-as-paragraph-function' variable.
* doc/emacs/text.texi (Fill Commands): Reference
`fill-region-as-paragraph-function' variable.
* lisp/textmodes/fill.el (fill-region-as-paragraph-function):
Add variable.
(fill-region-as-paragraph): Convert into
`fill-region-as-paragraph-function' wrapper.
(fill-region-as-paragraph-default): Rename old
`fill-region-as-paragraph' function.
(fill-region-as-paragraph-semlf): Update calls to
`fill-region-as-paragraph-default'.
(fill-region): Add reference to `fill-region-as-paragraph-function'
in doc string.
* test/lisp/textmodes/fill-tests.el (fill-test-fill-region): Add
test case for the `fill-region' function.
* test/lisp/textmodes/fill-resources/fill-region.erts: Add test
data. (Bug#78816)
Pip Cet [Sat, 28 Jun 2025 09:33:01 +0000 (09:33 +0000)]
Avoid extra output in Vprin1_to_string_buffer (bug#78842)
print_error_message can throw after producing some output, so use
unwind-protect to ensure prin1-to-string-buffer is cleared.
* src/print.c (erase_prin1_to_string_buffer): New.
(Ferror_message_string): Use it to catch errors thrown in
'print_error_message'.
* test/src/print-tests.el (error-message-string-circular): Expand
test.
Align the js-ts-mode entry with the javascript-mode entries in the
default auto-mode-alist value in lisp/files.el. Otherwise, js-ts-mode is
not associated with .js files.
Rahguzar [Sun, 22 Jun 2025 08:13:06 +0000 (13:13 +0500)]
* lisp/pcmpl-rpm.el: Generate completions for dnf5
(pcmpl-rpm-dnf-cache-file): Remove now unused variable.
(pcmpl-rpm--dnf-packages): Use dnf repoquery.
(pcomplete/dnf): Adjust regexps to allow for help format of
dnf5. New regexps works for both dnf4 and dnf5. Add
aliases for better subcommand completion. Better support
for dnf repoquery command. (Bug#78661)
Paul Eggert [Sat, 28 Jun 2025 06:53:32 +0000 (23:53 -0700)]
Port varargs macros better to C99
C99 prohibits passing zero args to macro’s ‘...’.
* lib-src/seccomp-filter.c (RULE0): New macro, which is like RULE
except with zero args. All zero-arg uses of RULE changed to RULE0.
* src/comp.c (compile_function, Fcomp__init_ctxt, syms_of_comp):
Change ‘CALLN (Fmake_hash_table)’ to ‘Fmake_hash_table (0, NULL)’,
since CALLN requires at least two args in C99.
Stefan Monnier [Sat, 28 Jun 2025 02:55:04 +0000 (22:55 -0400)]
cus-start.el: Reliably distinguish preload from nonpreload
`dump-mode` can be nil even if we're about to dump (this is
done in the Android build), so don't rely on it to distinguish
if `cus-start` is loaded from `loadup.el` vs loaded during
a "normal run".
* lisp/loadup.el (cus-start): Bind `cus-start--preload`.
* lisp/cus-start.el: <top-level>: Test it rather than `dump-mode`.
Sean Whitton [Fri, 27 Jun 2025 20:19:55 +0000 (21:19 +0100)]
vc-annotate: Fix ever-lengthening buffer names
* lisp/vc/vc-annotate.el (vc-annotate): Rewrite code to generate
the buffer name so that when switching from annotating one
revision to annotating another, we don't embed the old name of
the vc-annotate buffer directly into its new one (bug#78890).
(tab-bar--update-tab-bar-lines): Don't set the frame parameter
'tab-bar-lines' in daemon's initial frame because it messes up the
frames when 'format-mode-line' called from 'tab-bar-format-global'
on daemon's initial frame forces focus switch to daemon's initial
frame. Also don't set 'default-frame-alist' in daemon mode because
'frame-notice-user-settings' copies the frame parameter 'tab-bar-lines'
from 'default-frame-alist' to daemon's initial frame. Here updating
'default-frame-alist' is not much needed anyway since the frame
parameter 'tab-bar-lines' for new frames is set in 'make_terminal_frame'
and 'x-create-frame'. 'default-frame-alist' might be need only
to handle non-default 'tab-bar-show', but this can be handled by
'toggle-frame-tab-bar' called from 'server-after-make-frame-hook'.
(toggle-frame-tab-bar): Document a useful case of calling it
from 'server-after-make-frame-hook'.
Sean Whitton [Fri, 27 Jun 2025 13:14:36 +0000 (14:14 +0100)]
'C-u C-x .' clears the fill prefix
* lisp/textmodes/fill.el (set-fill-prefix): When called
interactively with a prefix argument, clear the fill prefix,
just like how 'C-u C-x C-n' clears the goal column.
* doc/emacs/text.texi (Fill Prefix):
* etc/NEWS: Document the change.
Jim Porter [Tue, 17 Jun 2025 16:11:55 +0000 (09:11 -0700)]
When making a readable page in EWW, include the <title> and similar tags
* lisp/net/eww.el (eww--walk-readability, eww-readable-dom): New
functions.
(eww-display-html): Call 'eww-readable-dom'.
(eww-readable): Call 'eww-readable-dom'. Don't copy over 'eww-data'
properties that our new readable page can handle on its own.
(eww-score-readability): Rewrite in terms of 'eww--walk-readability'.
Make obsolete.
(eww-highest-readability): Make obsolete.
* test/lisp/net/eww-tests.el (eww-test--lots-of-words)
(eww-test--wordy-page): New variables...
(eww-test/readable/toggle-display): ... use them.
(eww-test/readable/default-readable): Make sure that the readable page
includes the <title> and <link> tags (bug#77299).
James Cherti [Tue, 24 Jun 2025 17:25:40 +0000 (13:25 -0400)]
Fix yaml-ts-mode comment-start-skip to improve commenting/uncommenting
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): Fix 'comment-start-skip'
value to resolve an issue when commenting/uncommenting using the
'comment-or-uncomment-region' function. The previous 'comment-start-skip'
value left some "-" uncommented after commenting and uncommenting
multiple YAML indented blocks (bug#78892).
Juri Linkov [Wed, 25 Jun 2025 17:07:17 +0000 (20:07 +0300)]
Add alternative "ruby-lsp" to eglot-server-programs.
* lisp/progmodes/eglot.el (eglot-server-programs):
Add "ruby-lsp" to eglot-alternatives for ruby-mode and ruby-ts-mode.
https://shopify.github.io/ruby-lsp/editors.html#emacs-eglot
Juri Linkov [Wed, 25 Jun 2025 16:57:05 +0000 (19:57 +0300)]
Improve treesit settings for python-ts-mode (bug#73404).
* lisp/progmodes/python.el (python--thing-settings):
For the 'sexp' thing use all nodes except top-level
grouping nodes, comments and parens. Add the 'list' thing.
(python-ts-mode): Use setq-local for treesit-thing-settings.
Modify 'forward-sexp-function' and 'treesit-sexp-thing'
after calling 'treesit-major-mode-setup'.
Juri Linkov [Wed, 25 Jun 2025 16:45:54 +0000 (19:45 +0300)]
Fix usage of 'treesit-defun-type-regexp' in treesit-tests.
* test/src/treesit-tests.el (treesit--ert-test-defun-navigation):
Replace 'treesit-defun-type-regexp' with
'(or treesit-defun-type-regexp 'defun)' that fixes the tests
for ts-modes that set up the 'defun' thing instead of
'treesit-defun-type-regexp'.
Po Lu [Wed, 25 Jun 2025 16:02:11 +0000 (00:02 +0800)]
Attempt to fix initialization of startup variables on Android
* lisp/cus-start.el (standard): Revert last change if (featurep
'android), as Android systems perform dumping during the
initialization of the first user session.
Sean Whitton [Wed, 25 Jun 2025 15:21:49 +0000 (16:21 +0100)]
Improve discoverability of using dumb-emacs-ansi terminal type
* doc/emacs/misc.texi (Interactive Shell, Shell Options):
* lisp/comint.el (comint-terminfo-terminal): Mention setting
comint-terminfo-terminal to "dumb-emacs-ansi" when the system's
terminfo database contains a definition for that terminal type.
* etc/NEWS: Announce changes.
* lisp/progmodes/project.el (project-prune-zombie-projects): New
user option.
(project-prune-zombies-default): New function.
(project-forget-zombie-projects): Rework.
(project--ensure-read-project-list, project-prompt-project-dir)
(project-prompt-project-name): Call
'project-forget-zombie-projects' but inhibit its message.
Alan Mackenzie [Fri, 20 Jun 2025 21:13:45 +0000 (21:13 +0000)]
CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacs
Also start using `symbols' as the PAREN argument to regexp-opt.
lisp/progmodes/cc-defs.el (c-make-keywords-re): Simplify,
remove the redundant `appendable' value of the ADORN parameter,
use the `symbols' value of the PAREN argument to regexp.
(c-emacs-features): Test that "\_<" and "\_>" work in regexps
before allowing CC Mode to start.
lisp/progmodes/cc-engine.el (c-looking-at-decl-block): When
GOTO-START is set, leave point at the _last_ Java annotation,
if any. Clarify this in the doc string.
(c-guess-basic-syntax CASE 5G): Replace a not needed t
GOTO-START argument to c-looking-at-decl-block with nil.
lisp/progmodes/cc-langs.el (c-make-mode-syntax-table): Make the
syntax of ?@ in Java Mode symbol for processing annotations.
(c-opt-identifier-concat-key, c-opt-identifier-prefix-key)
(c-opt-after-id-concat-key, c-identifier-key)
(c-cpp-message-directives-re, c-cpp-include-key, c-pack-key)
(c-brace-stack-thing-key, c-brace-stack-no-semi-key): Replace
the `appendable' value of the ADORN argument to
c-make-keywords-re with t.
(c-annotation-re): New lang const and lang var.
(c-keywords-obarray): Replace an explicit (apply 'nconc (mapcar
... )) with c--mapcan, now that the obscure bug with mapcan in
Emacs has been resolved.
lisp/progmodes/cc-align.el (c-lineup-gnu-DEFUN-intro-cont)
(c-lineup-java-throws, c-snug-do-while)
lisp/progmodes/cc-awk.el (c-awk-pre-exp-alphanum-kwd-re)
(c-awk-after-if-for-while-condition-p)
(c-awk-after-function-decl-param-list)
(c-awk-after-continue-token)
(c-awk-after-rbrace-or-statement-semicolon)
(awk-font-lock-keywords)
lisp/progmodes/cc-cmds.el (c-defun-name-1)
lisp/progmodes/cc-engine.el (c-beginning-of-statement-1)
(c-forward-<>-arglist, c-forward-label, c-skip-conditional)
(c-looking-at-c++-lambda-expression, c-add-stmt-syntax)
(c-guess-basic-syntax CASE 11, CASE 12, CASE 13, CASE 15)
(CASE 5C.3, CASE 5D.4, CASE 7D)
lisp/progmodes/cc-fonts.el (c-cpp-matchers)
(c-basic-matchers-before, c-font-lock-declarations)
(c-font-lock-c++-modules, c-simple-decl-matchers)
(c-complex-decl-matchers, c-basic-matchers-after)
lisp/progmodes/cc-langs.el (c-paragraph-start)
(c-stmt-block-only-keywords-regexp)
(c-type-decl-prefix-keywords-key, c-type-decl-prefix-key)
(c-type-decl-suffix-key, c-known-type-key)
(c-enum-clause-introduction-re)
lisp/progmodes/cc-menus.el (cc-imenu-c++-generic-expression)
lisp/progmodes/cc-vars.el (c-make-noise-macro-regexps)
(c-make-macro-with-semi-re): Replace explicit "\<" and "\>"
with "\_<" and "\_>". Replace explicit specification of
non-'_' character after word end with "\_>". Replace
concatenation of "\<" and "\>" with regexps with (regexp-opt
... 'symbols). Use (regexp-opt ... 'symbols) in general.
Peter Oliver [Wed, 11 Jun 2025 16:34:53 +0000 (17:34 +0100)]
Show also tagged versions on Tree-sitter compatibility report
* admin/tree-sitter/compat-template.html: Accommodate two tables.
* admin/tree-sitter/treesit-admin.el
(treesit-admin--find-latest-compatible-revision): Pass through new arg
REVISION-TYPE.
(treesit-admin--last-compatible-grammar-for-modes): Optionally iterate
over tagged rather than all commits.
(treesit-admin--generate-compatibility-report): Generate a second table,
showing only tagged commits (bug#78848).
Stefan Monnier [Mon, 16 Jun 2025 11:05:11 +0000 (07:05 -0400)]
(smerge-refine-shadow-cursor): New variable and face (bug#78806)
* lisp/vc/smerge-mode.el (smerge-refine-shadow-cursor): New variable
and face.
(smerge-refine-regions): Add 'cursor-sensor-functions' property
to the covering overlays.
(smerge--refine-at-right-margin-p, smerge--refine-shadow-cursor):
New functions.
(smerge--refine-other-pos): New function, extracted from
smerge-refine-exchange-point'.
(smerge-refine-exchange-point): Use it.
(smerge--refine-highlight-change): Add thin
highlighted space for insertion/deletion positions.
* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect):
Run functions for 'moved' events. Demote errors.
(cursor-sensor-mode): Adjust docstring accordingly.
* doc/lispref/text.texi (Special Properties) <cursor-sensor-functions>:
Mention the new 'moved' direction.
Jim Porter [Sat, 21 Jun 2025 19:10:59 +0000 (12:10 -0700)]
When navigating to anchor targets in EWW, retain 'eww-data' properties
Previously, navigating to an in-page anchor target would clear
'eww-data', removing many important properties like the original source
and the DOM. Among other things, this prevented enabling/disabling
readable mode.