Tone down python-mode warning to a simple message (bug#68559)
* lisp/progmodes/python.el
(python-shell-completion-native-turn-on-maybe):
There is no need for an alarming warning when using an inferior Python
without GNU readline; a calm message will do.
Juri Linkov [Thu, 22 Feb 2024 17:38:17 +0000 (19:38 +0200)]
* lisp/help-fns.el (describe-mode-outline): New user option (bug#64684).
(describe-mode, describe-mode--minor-modes): Use 'describe-mode-outline'.
* lisp/help-mode.el (help-setup-xref): After disabling outline-minor-mode
also kill all outline-related local variables. So that they won't affect
the output of other help commands in the same help buffer.
Jörg Bornemann [Sat, 17 Feb 2024 20:18:02 +0000 (21:18 +0100)]
Recognize functions and macros as defuns in 'cmake-ts-mode'
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--function-name):
Renamed to 'cmake-ts-mode--defun-name' since the function handles
now functions and macros.
(cmake-ts-mode--defun-name): Return text of the first 'argument'
node below 'function_def' and 'macro_def' nodes.
(cmake-ts-mode): Set up treesit-defun-type-regexp and
'treesit-defun-name-function'. Change the imenu setup to
recognize macros too. Since we have set up
'treesit-defun-name-function', we don't have to
pass 'cmake-ts-mode--function-name' anymore. (Bug#69186)
To make `treesit-defun-at-point' work properly, we have to recognize
function_def/macro_def nodes, not the lower-level *_command nodes.
Andrea Corallo [Wed, 21 Feb 2024 10:18:06 +0000 (11:18 +0100)]
* Make 'comp--compute-function-types' a pass
* lisp/emacs-lisp/comp.el (comp-passes): Add comp--compute-function-types.
(comp--compute-function-types): New function.
(comp--compute-function-type): Move it.
(comp--final): Update it.
Eli Zaretskii [Wed, 21 Feb 2024 15:16:45 +0000 (17:16 +0200)]
Remove redundant call to 'eln_load_path_final_clean_up'
* src/emacs.c (shut_down_emacs): Remove redundant call to
'eln_load_path_final_clean_up'. We call it from 'kill-emacs'
right before the call to 'exit'.
Jonas Bernoulli [Tue, 20 Feb 2024 17:49:20 +0000 (18:49 +0100)]
Allow trivially autoloading uses of transient's define macros
Since 49e41991b2f transient-define-prefix itself was autoloaded, but
that meant that when ever an autoload file was loaded, which contained
an autoload for a command defined using that macro, transient itself
had to be loaded.
That shouldn't be necessary. For commands using these macros, an
autoload that is identical to what would have been generated if it
had been defined using defun, works just fine.
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Allow uses of
transient-define-prefix, transient-define-suffix,
transient-define-infix and transient-define-argument
to be autoloaded using just ";;;autoload".
* lisp/transient.el (transient-define-prefix): No longer autoload.
Jonas Bernoulli [Mon, 19 Feb 2024 22:36:17 +0000 (23:36 +0100)]
Make find-function-regexp also find transient-define-*
* lisp/emacs-lisp/find-func.el (find-function-regexp): Also find
transient-define-prefix, transient-define-suffix,
transient-define-infix and transient-define-argument.
* lisp/net/tramp-container.el (tramp-dockercp-method)
(tramp-podmancp-method): New defconst.
(tramp-methods) <dockercp, podmancp>: Add new methods.
(tramp-container--completion-function): Adapt docstring. Use it
for "dockercp" and "podmancp" completion.
* lisp/net/tramp.el (tramp-get-remote-tmpdir):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use a default
value with `tramp-get-method-parameter'.
* lisp/net/tramp-sh.el (tramp-methods) <nc>: Add `tramp-copy-file-name'.
(tramp-default-copy-file-name): New defconst.
(tramp-make-copy-file-name): Rename from
`tramp-make-copy-program-file-name'. Use method parameter
`tramp-copy-file-name'. (Bug#69085)
(tramp-do-copy-or-rename-file-out-of-band): Adapt callees.
* test/lisp/net/tramp-tests.el (tramp--test-container-p): Adapt.
(tramp--test-container-oob-p): New defun.
(tramp-test17-dired-with-wildcards, tramp-test35-remote-path)
(tramp-test41-special-characters): Use it.
(tramp--test-set-ert-test-documentation): Use `split-string'.
* lisp/emacs-lisp/shortdoc.el (shortdoc--check)
(define-short-documentation-group): Check that used keywords exist.
* lisp/emacs-lisp/shortdoc.el (list): Fix a typo.
Paul Eggert [Sun, 18 Feb 2024 07:38:30 +0000 (23:38 -0800)]
Remove no-longer-needed pdumper_load workaround
* src/pdumper.c (pdumper_load): Revert my commit "Pacify GCC
12.1.1 in default developer build" dated 2022-06-13 13:21:18 -07,
as GCC bug 105961 is fixed, and this workaround is not needed for
unfixed GCC as these builds should not use --enable-gcc-warnings.
Paul Eggert [Sun, 18 Feb 2024 07:12:18 +0000 (23:12 -0800)]
Ignore fewer GCC -fanalyzer diagnostics in ccl.c
* src/ccl.c: Do not ignore -Wanalyzer-use-of-uninitialized-value,
as that bug has been fixed in GCC. Ignore
-Wanalyzer-out-of-bounds only if GCC 13, as the bug will
reportedly be fixed when GCC 14 comes out.
Eshel Yaron [Wed, 21 Feb 2024 16:23:57 +0000 (17:23 +0100)]
New command 'minibuffer-apply'
* lisp/minibuffer.el (completions-used-input): New face.
(minibuffer-completion-action): New variable and function.
(minibuffer-completion-command): New variable.
(completing-read-default): Set it to 'this-command'.
(minibuffer-current-input): New function.
(minibuffer-apply): New command.
(minibuffer-local-completion-map): Bind it to 'C-j'.
(minibuffer-local-must-match-map): Unbind 'C-j'.
* lisp/cus-edit.el (customize-toggle-option): Set
'minibuffer-action' property to non-nil.
Eshel Yaron [Wed, 21 Feb 2024 12:24:06 +0000 (13:24 +0100)]
; Reposition cursor after refreshing *Completions*
* lisp/minibuffer.el (minibuffer-completion-help): If *Completions* is
already visible and some candidate is highlighted, try to highlight it
again after populating the buffer anew.
Paul Eggert [Fri, 16 Feb 2024 02:45:29 +0000 (18:45 -0800)]
Adjust to yesterday’s Gnulib nstrftime changes
Bruno Haible fixed Gnulib so that nstrftime no longer requires
locking code, which means we no longer need to avoid localename.
However, nstrftime now requires localename-unsafe-limited which
pulls in some Gnulib-specific locale code, and it’s likely this
needs to be replaced with Emacs-specific locale code. In the
meantime let’s continue to finess this by avoiding
localename-unsafe-limited.
* admin/merge-gnulib (AVOIDED_MODULES):
Avoid localename-unsafe-limited instead of localename.
Jakub Ječmínek [Sat, 17 Feb 2024 17:34:36 +0000 (09:34 -0800)]
Provide better default value for date in Gnus scoring
Bug#61002, thanks to Kamil Jońca for reporting
* lisp/gnus/gnus-score.el (gnus-summary-score-entry): When scoring on
Date header, the default value for the prompt should be number of days
between the date of the article under point, and "now".
Eshel Yaron [Tue, 20 Feb 2024 14:18:52 +0000 (15:18 +0100)]
; Bind M-<left>/<right> in minibuffer for navigating *Completions*
* lisp/minibuffer.el (minibuffer-local-completion-map): Bind
'M-<left>/<right>' to 'minibuffer-previous/next-completion', and bind
'M-<down>/<up>' to the vertical variants of these commands.
Eshel Yaron [Sun, 18 Feb 2024 21:08:48 +0000 (22:08 +0100)]
; Show option state (ON/OFF) in 'toggle-option' completions list
* lisp/cus-edit.el (custom-boolean-option-on)
(custom-boolean-option-off): New faces.
(customize-read-boolean-option-affixation): New function.
(customize-read-boolean-option): Use it.
(customize-toggle-option): Update.
john muhl [Tue, 13 Feb 2024 00:46:51 +0000 (18:46 -0600)]
Eagerly indent first field in tables in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Properly indent the first field of a table when it appears on a
line by itself. (Bug#69088)
Kévin Le Gouguec [Sat, 10 Feb 2024 16:56:57 +0000 (17:56 +0100)]
Support shebang lines with amended environment
For bug#64939.
* lisp/files.el (auto-mode-interpreter-regexp): Account for possible
VARIABLE=[VALUE] operands.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Add an example from the coreutils manual.
Kévin Le Gouguec [Sat, 10 Feb 2024 16:37:35 +0000 (17:37 +0100)]
Support more complex env invocations in shebang lines
This is not an exact re-implementation of what env accepts, but
hopefully it should be "good enough".
Example of known limitation: we assume that arguments for
--long-options will be set with '=', but that is not
necessarily the case. '--unset' (mandatory argument) can be
passed as '--unset=VAR' or '--unset VAR', but
'--default-signal' (optional argument) requires an '=' sign.
For bug#64939.
* lisp/files.el (auto-mode-interpreter-regexp): Account for
supplementary arguments passed beside -S/--split-string.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Test some of these combinations.
Kévin Le Gouguec [Sat, 10 Feb 2024 15:14:08 +0000 (16:14 +0100)]
Refine shebang tests (bug#64939)
* test/lisp/files-tests.el (files-tests--check-shebang): For
shell-script modes, verify that the correct shell is set.
(files-tests-auto-mode-interpreter): Prefer 'sh-base-mode' to
'sh-mode' to stay tree-sitter-agnostic; re-organize test cases to
make future ones easier to add.
F. Jason Park [Mon, 12 Feb 2024 04:01:54 +0000 (20:01 -0800)]
Use modern fallback for channel name detection in ERC
* lisp/erc/erc-backend.el (erc-query-buffer-p): Remove forward declaration.
* lisp/erc/erc.el (erc-query-buffer-p): Defer to `erc-channel-p'.
(erc-channel-p): Refactor and use `erc--fallback-channel-prefixes' for
the default CHANTYPES value. Honor an empty CHANTYPES value as valid,
e.g., for servers that only support direct messages.
(erc--fallback-channel-prefixes): New variable to hold fallback
CHANTYPES prefixes recommended by RFC1459 and modern authorities on
the matter.
* test/lisp/erc/erc-tests.el (erc-channel-p): Revise test. (Bug#67220)
F. Jason Park [Mon, 12 Feb 2024 01:15:14 +0000 (17:15 -0800)]
Normalize ISUPPORT params with empty values in ERC
* lisp/erc/erc-backend.el (erc-server-parameters)
(erc--isupport-params): Mention parsing and storage behavior regarding
nonstandard "FOO=" tokens.
(erc--parse-isupport-value): Move comment closer to code.
(erc--get-isupport-entry): Treat the empty string as truly null, as
prescribed by the Brocklesby draft cited in the top-level comment.
* test/lisp/erc/erc-tests.el (erc--get-isupport-entry): Add case for
the empty string appearing as a value for an `erc-server-parameters'
item.
(erc-server-005): Assert compat-related behavior of retaining the
empty string as a valid value from a raw "FOO=" token.
(Bug#67220)
F. Jason Park [Mon, 12 Feb 2024 04:42:18 +0000 (20:42 -0800)]
Ignore the TGT-LIST parameter in erc-open
* etc/ERC-NEWS: Mention `erc-open' now ignores TGT-LIST.
* lisp/erc/erc.el (erc-open): Set `erc-default-recipients' to a list
containing only the supplied target. Other values may cause ERC to
malfunction. Also redo doc string.
F. Jason Park [Mon, 13 Nov 2023 20:07:36 +0000 (12:07 -0800)]
Make erc-fill-wrap depend on scrolltobottom
* lisp/erc/erc-fill.el (erc-fill-mode): Add reference to
`erc-fill-wrap-mode' in doc string.
(erc--fill-wrap-scrolltobottom-exempt-p): New variable to allow tests
involving `fill-wrap' to opt out of having to enable `scrolltobottom'.
(erc-fill--wrap-ensure-dependencies): Warn and enable
`erc-scrolltobottom-mode' if necessary.
(erc-fill-wrap-mode): Mention workaround for automatically enabling
`scrolltobottom'.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--wrap-populate):
Exempt tests from `scrolltobottom' dependency.
* test/lisp/erc/resources/erc-scenarios-common.el: Load `erc-fill'
when compiling.
(erc-scenarios-common--print-trace): Exempt tests using `fill-wrap'
from the `scrolltobottom' dependency by making
`erc--fill-wrap-scrolltobottom-exempt-p' non-nil during test runs.
(Bug#60936)
F. Jason Park [Sun, 4 Feb 2024 01:17:48 +0000 (17:17 -0800)]
Autoload custom-loads for new Custom groups in erc.el
* lisp/erc/erc.el: Add `custom-loads' library features for group
symbols `erc-spelling' and `erc-imenu' since they aren't defined in
all supported Emacs versions. Also add groups `erc-sasl' and
`erc-nicks', new libraries recently added to ERC. Note that this is
unrelated to prefixes generated for the help system. (Bug#68943)
F. Jason Park [Fri, 16 Feb 2024 04:17:20 +0000 (20:17 -0800)]
Remove "erc-" prefixed Compat definitions
* lisp/erc/erc-compat.el: Remove NO-ERROR argument from top-level
`require' for library `compat' because it's guaranteed to be present.
(erc-compat-function, erc-compat-call): Redefine as obsolete aliases
for unprefixed namesakes.
* lisp/erc/erc-fill.el (erc-fill-wrap-nudge): Use `compat-call'
instead of `erc-compat-call'.