Stephen Gildea [Sat, 14 Dec 2024 18:23:04 +0000 (10:23 -0800)]
time-stamp: fix search end, more compatibility suggestions
* lisp/time-stamp.el (time-stamp): Use a marker for the
search end limit so we don't insert past it.
(time-stamp-conv-warn): Include a second suggested conversion
that might be what was intended.
Include a link to variable 'time-stamp-format'.
* test/lisp/time-stamp-tests.el: more tests
Richard Lawrence [Fri, 13 Dec 2024 09:41:02 +0000 (10:41 +0100)]
Check for presuppositions in `calendar-date-is-valid-p'
Do not signal an error in `calendar-date-is-valid-p' if passed a
value which is not a three-element list of integers. Signaling
an error makes the function unusable as a predicate for valid
date values. (Bug#74848)
* lisp/calendar/calendar.el (calendar-date-is-valid-p): Add the
check that input is a 3-element list.
* test/lisp/calendar/calendar-tests.el: New file with tests.
Daniel Mendler [Wed, 11 Dec 2024 06:36:16 +0000 (07:36 +0100)]
Add `browse-url-qutebrowser'
The browser launcher supports the NEW-WINDOW argument and
`browse-url-qutebrowser-new-window-is-tab' to open tabs.
Furthermore opening new URLs is sped up via Unix socket IPC if
available.
* lisp/net/browse-url.el (browse-url-qutebrowser-send): Function
to send command to Qutebrowser via IPC.
(browse-url-qutebrowser): New browser launcher. Use
`browse-url-qutebrowser-send'.
(browse-url-qutebrowser-program, browse-url-qutebrowser-arguments)
(browse-url-qutebrowser-new-window-is-tab): New customizables.
(browse-url-mozilla-new-window-is-tab)
(browse-url-firefox-new-window-is-tab)
(browse-url-epiphany-new-window-is-tab): Improve docstrings.
Jared Finder [Sat, 14 Dec 2024 08:30:43 +0000 (09:30 +0100)]
Fix for xt-mouse-tests.el broken in prior commit
xt-mouse-tests not turning on xterm-mouse-mode if it was already
on did not work with xterm-mouse-mode being set to t by default.
It turns out that xt-mouse-tests already does not report proper
results when called inside a running Emacs session so the code
path is not useful anyways.
* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Always
turn on xterm-mouse-mode, even if it is already on.
kobarity [Wed, 11 Dec 2024 14:21:04 +0000 (23:21 +0900)]
Fix font-lock of Python f-strings
* lisp/progmodes/python.el (python--font-lock-f-strings): Bind
'parse-sexp-ignore-comments' to nil so that we can look for
closing braces even if a hash is used in the format specifier.
* test/lisp/progmodes/python-tests.el
(python-font-lock-f-string-1): New test. (Bug#74738)
Yuan Fu [Fri, 13 Dec 2024 05:42:44 +0000 (21:42 -0800)]
Apply string syntax only to string in jsx (bug#73978)
The current code applies string syntax to too many things. This
patch makes tsx-ts-mode (and friends) only apply string syntax
to actual text in tsx/jsx.
* lisp/progmodes/typescript-ts-mode.el:
(tsx-ts--s-p-query): Only capture jsx_text.
(tsx-ts--syntax-propertize-captures): handle the case when the
text is one character long.
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.