Robert Pluim [Tue, 10 Dec 2024 13:56:21 +0000 (14:56 +0100)]
Fix 'gnus-select-method' custom type
* lisp/gnus/gnus.el (gnus-redefine-select-method-widget): Cater
for the 'gnus-search-engine' configuration variable, which takes
2 args instead of 1. (Bug#74759)
Jared Finder [Tue, 10 Dec 2024 06:16:40 +0000 (22:16 -0800)]
Enable xterm-mouse-mode by default in xterm
* lisp/xt-mouse.el (xterm-mouse-mode): Change default value of
xterm-mouse-mode to t.
* lisp/term/xterm.el (xterm--init): Enable xterm-mouse-mode if
the default value is still set.
* etc/NEWS: Document new behavior.
Daniel Mendler [Sat, 7 Dec 2024 21:56:15 +0000 (22:56 +0100)]
eww: Use browse-url-with-browser-kind in eww-browse-with-external-browser
Guarantee that an external browser is used by EWW if
`browse-url-secondary-browser-function' is set to
`eww-browse-url'.
* lisp/net/eww.el (eww-browse-with-external-browser): Use
`browse-url-secondary-browser-function' only if it is an
external browser, otherwise fall back to
`browse-url-with-browser-kind'.
(eww-follow-link): Use `eww-browse-with-external-browser' if the
EXTERNAL prefix argument is non-nil. Improve docstring.
* lisp/net/browse-url.el (browse-url-secondary-browser-function):
Update docstring. (Bug#74730)
Visuwesh [Thu, 5 Dec 2024 06:10:02 +0000 (11:40 +0530)]
Revert Dired buffer when clicking on basename of directory
* lisp/dired.el (dired--make-directory-clickable): Make clicking
on basename of the directory revert the Dired buffer.
* etc/NEWS: Announce the change. (Bug#74700)
Pengji Zhang [Tue, 10 Dec 2024 10:55:36 +0000 (18:55 +0800)]
Rework history Isearch for Eshell
This is to make history Isearch for Eshell similar to that of
'comint-mode', by hooking into Isearch properly instead of
defining new commands to emulate Isearch (bug#74287).
* lisp/eshell/em-hist.el (eshell-history-isearch): New user
option.
(eshell-goto-history, eshell--isearch-setup)
(eshell-history-isearch-end, eshell-history-isearch-search)
(eshell-history-isearch-message, eshell-history-isearch-wrap)
(eshell-history-isearch-push-state): New functions.
(eshell-isearch-backward-regexp, eshell-isearch-forward-regexp):
New commands.
(eshell--history-isearch-message-overlay)
(eshell--stored-incomplete-input, eshell--force-history-isearch):
New internal variables.
(eshell-hist-mode-map): Bind 'M-r' to
'eshell-isearch-backward-regexp' and free 'M-s' binding for
normal in-buffer search commands.
(eshell-isearch-backward, eshell-isearch-forward): Use the new
way to start searching.
(eshell-hist-initialize): Use the new Isearch setup function.
(eshell-previous-matching-input): Use 'eshell-goto-history'.
Also inhibit messages when searching.
(eshell-isearch-map, eshell-isearch-repeat-backward)
(eshell-isearch-abort, eshell-isearch-delete-char)
(eshell-isearch-return, eshell-isearch-cancel)
(eshell-isearch-repeat-forward, eshell-test-imatch)
(eshell-return-to-prompt, eshell-prepare-for-search): Remove.
These are for the old history Isearch implementation.
Pengji Zhang [Wed, 11 Dec 2024 07:05:09 +0000 (09:05 +0200)]
Do not call custom-reevaluate-setting in comint.el (bug#74287)
* lisp/comint.el (comint--force-history-isearch): New internal variable.
(comint-history-isearch-backward, comint-history-isearch-backward-regexp):
Set comint--force-history-isearch to t.
(comint-history-isearch-setup): Check comint--force-history-isearch.
(comint-history-isearch-end): Set comint--force-history-isearch back to nil
instead of calling custom-reevaluate-setting.
Björn Bidar [Tue, 10 Dec 2024 22:43:29 +0000 (00:43 +0200)]
Update browse-url-kde variables
* lisp/net/browse-url.el (browse-url-kde-program, browse-url-kde-args):
Update defaults to more modern alternative to kfmclient. Kfmclient is
only installed when Konqueror is installed, which isn't the default
file-manager since KDE4. In contrast, it is more likely that kde-open
is installed as it is required by Plasma, and it exists since
KDE4. (Bug#74775)
Paul Eggert [Tue, 10 Dec 2024 19:19:25 +0000 (11:19 -0800)]
Use builtin-expect directly
* admin/merge-gnulib (GNULIB_MODULES): Add builtin-expect,
since src/lisp.h now uses __builtin_expect directly,
which we should no longer rely on it being pulled in as
a dependency of some other Gnulib module that we use.
Stephen Gildea [Tue, 10 Dec 2024 17:09:39 +0000 (09:09 -0800)]
time-stamp: properly abbreviate instead of truncating names
* lisp/time-stamp (time-stamp-string-preprocess): Stop truncating month
and weekday name strings; it didn't internationalize well.
Some historical conversions, previously accepted quietly, now warn.
(time-stamp-format): Recommend the simpler formats implemented in 2019.
* test/lisp/time-stamp-tests.el: Update tests and comments to match.
Revert commit 83e4559664 (2022-07-01), which was working around the
former confusion between truncation and abbreviation.
F. Jason Park [Sun, 8 Dec 2024 00:52:12 +0000 (16:52 -0800)]
; Mark failing tests in erc-scenarios-match.el as :unstable
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--stamp-both-invisible-fill-static)
(erc-scenarios-match--stamp-both-invisible-fill-static--nooffset):
Tag as :unstable for a `system-type' of `berkeley-unix'.
(Bug#74722)
F. Jason Park [Sat, 7 Dec 2024 03:09:04 +0000 (19:09 -0800)]
; Slightly improve test case for erc-parse-modes
* lisp/erc/erc.el (erc--merge-local-modes): Look for a symbol's
`erc-module' property before examining its name.
* test/lisp/erc/erc-tests.el (erc-parse-modes): Expand case to cover
alternating plus and minus mode changes.
Stefan Kangas [Mon, 9 Dec 2024 03:01:44 +0000 (04:01 +0100)]
Make setting tex-dvi-view-command to an sexp obsolete
This is more in line with how we generally handle user options for
commands to call. Later, we can get rid of the 'eval' call.
* lisp/textmodes/tex-mode.el (tex-view): Warn if tex-dvi-view-command is
set to an sexp instead of a string; say that this use is obsolete.
(tex-dvi-view-command): Change the default value to a string. Update
docstring to reflect the above obsoletion.
Yuan Fu [Sun, 8 Dec 2024 07:18:53 +0000 (23:18 -0800)]
Allow treesit--font-lock-level-setter to be an alist
* lisp/treesit.el (treesit-font-lock-level): Allow the
value to be an alist mapping major modes to font lock levels.
(treesit--font-lock-level-setter): Rewrite.
(treesit--compute-font-lock-level): New function.
(treesit-font-lock-recompute-features): Use new function.
* doc/lispref/modes.texi (Parser-based Font Lock): Minor fix.
john muhl [Mon, 2 Dec 2024 15:20:01 +0000 (09:20 -0600)]
Don't restrict 'lua-ts-send-file' to 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts-send-file): Remove
restriction on interactive use. Unlike related send-* commands
it can be useful to send a file to the Lua interpreter outside of
a 'lua-ts-mode' buffer. (Bug#74705)
Manuel Giraud [Mon, 2 Dec 2024 14:11:52 +0000 (15:11 +0100)]
Fix the version of librsvg API change
* src/image.c (init_svg_functions, svg_load_image): The first
official version that introduces
'rsvg_handle_get_pixbuf_and_error' is 2.59.0 not 2.58.0.
(Bug#74606)
Michael Albinus [Fri, 6 Dec 2024 10:56:05 +0000 (11:56 +0100)]
Better handling of "%" in Tramp user or host names
* lisp/net/tramp.el (tramp-format-spec): New defun.
(tramp-dissect-file-name, tramp-compute-multi-hops)
(tramp-expand-args):
* lisp/net/tramp-cmds.el (tramp-default-rename-file): Use it.
Yuan Fu [Tue, 3 Dec 2024 04:47:38 +0000 (20:47 -0800)]
Validate font-lock rules when setting up tree-sitter major mode
When tree-sitter grammar make breaking changes, major modes
breaks completely: no highlighting is shown. This new function
will run in treesit-major-mode-setup, validate each
font-lock features, and disable the ones that are not compatible
with the new grammar, so that the rest of the features still
work. It also displays a warning explaining the situation,
which looks like this:
Warning (treesit-font-lock-rules-mismatch): Emacs cannot
compile every font-lock rules because a mismatch between the
grammar and the rules. This is most likely due to a
mismatch between the font-lock rules defined by the major
mode and the tree-sitter grammar.
This error can be fixed by either downgrading the
grammar (tree-sitter-c) on your system, or upgrading the
major mode package. The following are the temporarily
disabled features:
- `preprocessor' for c.
* lisp/treesit.el (treesit-validate-font-lock-rules): New function.
(treesit-major-mode-setup): Validate font-lock rules.
Yuan Fu [Tue, 3 Dec 2024 04:14:55 +0000 (20:14 -0800)]
Make treesit-query-compile compile compiled-query eagerly
* src/treesit.c (treesit_ensure_query_compiled_signal): Extrat
out into a function.
(Ftreesit_query_compile): If EAGER is non-nil and QUERY is a
lazily compiled query, compile it eagerily.
Yuan Fu [Tue, 3 Dec 2024 01:23:08 +0000 (17:23 -0800)]
Make tree-sitter-explorer support selecting local parser
Now treesit-explore-mode will prompt the user to select a parser
to explore, rather than a language. It'll also include the
local parsers at point for selection.
* lisp/treesit.el (treesit--explorer-language): Change to
treesit--explorer-parser.
(treesit--explorer--nodes-to-highlight):
(treesit--explorer-refresh): Change to use parser.
(treesit--explorer-generate-parser-alist): New function.
(treesit-explorer-switch-parser): New command.
(treesit-explore-mode): Use switch-parser to setup.
* doc/lispref/parsing.texi (Language Grammar): Mention
treesit-explorer-switch-parser.
* lisp/textmodes/tex-mode.el (tex-display-shell)
(tex-recenter-output-buffer):
Replace 'display-tex-shell-buffer-action' with a list of
'display-buffer-in-previous-window' and '(category . tex-shell)'.
Robert Pluim [Tue, 3 Dec 2024 14:41:48 +0000 (15:41 +0100)]
Improve docstrings of functions for moving to message headers
* lisp/gnus/message.el (message-goto-to, message-goto-from,
message-goto-subject, message-goto-cc, message-goto-bcc,
message-goto-fcc, message-goto-reply-to,
message-goto-newsgroups, message-goto-distribution,
message-goto-followup-to, message-goto-mail-followup-to,
message-goto-keywords, message-goto-summary): Mention that these
will insert an empty header if the header is not found.
(message-position-on-field): Explain that this inserts an empty
header if the header is missing, and that insertion is done
after the headers mentioned in AFTERS.
Yuan Fu [Mon, 2 Dec 2024 00:40:05 +0000 (16:40 -0800)]
Standardize and promote c-ts-mode's custom matcher and anchor
Specifically, standalone-parent and prev-sibling. The c-ts-mode
custom version skips labels and proproc directives.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--standalone-parent-skip-preproc): Rename to
c-ts-mode--standalone-parent, and make it skip labels too.
(c-ts-mode--preproc-indent-rules): Rename standalone-parent and
prev-sibling.
(c-ts-mode--label-indent-rules): Use custom standalone-parent
and prev-sibling.
Yuan Fu [Sun, 1 Dec 2024 07:49:14 +0000 (23:49 -0800)]
Add more c-ts-mode indent tests
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: Fix
label test.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add some
test, make other tests harder.
Yuan Fu [Sun, 1 Dec 2024 08:15:08 +0000 (00:15 -0800)]
Use new baseline indent rule in c-ts-mode
Rework the indent rules in c-ts-mode using
c-ts-common-baseline-indent-rule. Also reworked internal
functions for setting indent styles to make it simpler and (more
importantly) more readable. Now there's a single function,
c-ts-mode--simple-indent-rules, that returns a value that can go
straight to treesit-simple-indent-rules.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Simplify.
(c-ts-mode--get-indent-style): Remove function.
(c-ts-mode--prompt-for-style): Use a hard-coded list of styles.
This is a tiny downgrade from the computed lists but is
acceptable.
(c-ts-mode-set-style): Use c-ts-mode--simple-indent-rules.
(c-ts-mode--standalone-grandparent): Docstring change.
(c-ts-mode--for-loop-indent-rule): New function.
(c-ts-mode--preproc-indent-rules): New variable. Copied from
old indent rules and added some new rule.
(c-ts-mode--macro-heuristic-rules):
(c-ts-mode--simple-indent-rules):
(c-ts-mode--parenthesized-expression-indent-rule):
(c-ts-mode--label-indent-rules): New functions.
(c-ts-mode):
(c++-ts-mode): Use c-ts-mode--simple-indent-rules.
Yuan Fu [Sat, 30 Nov 2024 04:43:09 +0000 (20:43 -0800)]
Add baseline tree-sitter indent rule for C-like languages
I found a really good baseline indent rule that handles a wide
range of situations very well. Now major modes can just start
with this rule and add exceptions on top.
This is worth mentioning in the manual, but that'll be a large
change, and doesn't have to be included in this commit.
* lisp/progmodes/c-ts-common.el:
(c-ts-common-list-indent-style): New variable.
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling):
(c-ts-common-parent-ignore-preproc):
(c-ts-common-baseline-indent-rule): New function.
* lisp/treesit.el (treesit--indent-prev-line-node): New function.
(treesit-simple-indent-presets): Add new preset.