This adds a section for documenting all the optional modules.
* doc/misc/eshell.texi (Extension modules): Move explanation about
writing modules to...
(Writing a module): ... here.
(Module testing): Remove. Testing an Eshell module doesn't require
any special documentation.
(Key binding, Smart scrolling, Electric forward slash): Move under...
(Optional modules): ... here.
(Directory handling, Terminal emulation): Remove. These modules are
enabled by default, and so are documented above.
(Tramp extensions, Extra built-in commands): New sections.
F. Jason Park [Fri, 9 Jun 2023 06:49:23 +0000 (23:49 -0700)]
Redo erc-nickname-in-use-functions as a local module
* etc/ERC-NEWS: Mention new module `services-regain'.
* lisp/erc/erc-backend.el: Rename option.
* lisp/erc/erc-services.el (erc-services-regain-alist): Strategies for
regaining a lost nickname on reconnect. This option, in addition to
the rest of these changes, is a redo of
`erc-nickname-in-use-functions' from commit 8c0c9826 "Add hook to
regain nickname in ERC", which originally stemmed from bug#62044.
(erc-services-retry-nick-on-connect, erc-services-issue-regain,
erc-services-issue-ghost-and-retry-nick): New function variants for
`erc-services-regain-alist.
(erc-services-regain-mode, erc-services-regain-enable,
erc-services-regain-disable): New local module to activate
nick-regaining behavior.
(erc--nickname-in-use-make-request): New method, a services-specific
implementation.
* lisp/erc/erc.el (erc--nickname-in-use-make-request): New generic
function to request alternate nick when first choice is rejected.
(erc-nickname-in-use): Call `erc--nickname-in-use-make-request' to
request alternate nick.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-misc--reconnect-retry-nick): Adopt renamed
version of `erc-scenarios-base-renick-auto-regain'.
(erc-scenarios-services-misc--regain-command,
erc-scenarios-services-misc--ghost-and-retry-nick): New tests.
* test/lisp/erc/resources/services/regain/reconnect-retry-again.eld:
New test data file reusing existing blob c0529052 that once lived at
resources/base/renick/regain/normal-again.eld.
* test/lisp/erc/resources/services/regain/reconnect-retry.eld: New
test data file reusing existing blob 9f4df70e5 that once lived at
resources/base/renick/regain/normal.eld.
* test/lisp/erc/resources/services/regain/taken-ghost.eld: New test
data file.
* test/lisp/erc/resources/services/regain/taken-regain.eld New test
data file.
F. Jason Park [Wed, 28 Jun 2023 03:47:26 +0000 (20:47 -0700)]
Account for leading timestamps in erc-match
* lisp/erc/erc-match.el (erc-text-matched-hook): Mention that stamps
may be present in the narrowed buffer but absent from the message
parameter.
(erc-match--message): New function containing what was the body of
`erc-match-message' as if the latter were simply renamed.
(erc-match-message): Move body to `erc-match--message' and call it
with more aggressive narrowing. This fixes a regression stemming from d880a08f "Cement ordering of essential hook members in ERC". Special
thanks to Libera.Chat user jrm for reporting this bug. (Bug#60936)
* test/lisp/erc/erc-scenarios-match.el: New test file.
Harald Jörg [Sat, 1 Jul 2023 13:25:33 +0000 (15:25 +0200)]
cperl-mode: Fix byte-compilation warnings
* lisp/progmodes/cperl-mode.el (defconst): Reformat docstring to
fit into 80 columns.
(cperl-find-sub-attrs): Mark lexical parameters as unused.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-attrs-and-signatures): Fix use of
`match-beginning'
(perl-indent-parens-as-block): Define as a variable.
Eli Zaretskii [Sat, 1 Jul 2023 08:34:43 +0000 (11:34 +0300)]
Fix total count of messages in Rmail summary buffers
* lisp/mail/rmailsum.el (rmail-new-summary-1): Actually count the
messages in the summary buffer instead of relying on
'rmail-total-messages'. Reported by Andrea Monaco
<andrea.monaco@autistici.org>.
Harald Jörg [Fri, 30 Jun 2023 21:41:06 +0000 (23:41 +0200)]
cperl-mode.el: Support subroutine signatures
Since Perl 5.20, subroutine signatures were available as an
experimental feature. With Perl 5.38, they will be always enabled in
the new object system.
* test/lisp/progmodes/cperl-mode-resources/cperl-bug-64190.pl:
* test/lisp/progmodes/cperl-mode-resources/cperl-bug-64364.pl: New
test resources.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-attrs-and-signatures): Add tests for
signatures.
(cperl-test-attribute-rx, cperl-test-attribute-list-rx)
(cperl-test-prototype-rx, cperl-test-signature-rx): Tests for the
new rx sequences.
(cperl-test-bug-64190): New test for multiline declarations.
(cperl-test-bug-64364): New test for indentation of declarations.
* lisp/progmodes/cperl-mode.el:
(toplevel): New rx sequences to match Perl variables and attributes.
(cperl-declaration-header-p): New function to identify declarations.
(cperl-block-declaration-p): Use the new function.
(cperl-mode): Use the rx sequences.
(cperl-get-state): Use the new function.
(cperl-sniff-for-indent): Use the new function.
(cperl-find-sub-attrs): Improve fontification of subroutine
prototypes and attributes while typing when jit-lock-mode is
active. Detect signatures, and distinguish them from prototypes.
(cperl-find-pods-heres): Use the rx sequences to detect subroutines.
(cperl-init-faces): Use the rx sequences for fontification.
Eli Zaretskii [Fri, 30 Jun 2023 07:13:53 +0000 (10:13 +0300)]
Improve documentation of registers
* doc/lispref/text.texi (Registers): Document buffers in
registers. Mention "frameset" as another name for "frame
configuration".
* doc/emacs/regs.texi (Registers, Configuration Registers)
(File and Buffer Registers): Clarify and improve wording. Add
cross-references and indexing.
(Configuration Registers): Rename the section to a more accurate
name. (Bug#64354)
Andrew G Cohen [Tue, 27 Jun 2023 07:40:46 +0000 (15:40 +0800)]
Use a temporary buffer in nnagent-request-set-mark (bug#64117)
Commit cb12a84f2c519a48dd87453c925e3bc36d9944db inadvertently removed
the use of a temporary buffer in nnagent-request-set-mark. Bug and
fix reported by Jens Schmidt <jschmidt4gnu@vodafonemail.de>
* lisp/gnus/nnagent.el (nnagent-request-set-mark): Restore the use of
a temporary buffer that was inadvertently removed.
Andrew G Cohen [Tue, 27 Jun 2023 07:40:46 +0000 (15:40 +0800)]
Use a temporary buffer in nnagent-request-set-mark (bug#64117)
Commit cb12a84f2c519a48dd87453c925e3bc36d9944db inadvertently removed
the use of a temporary buffer in nnagent-request-set-mark. Bug and
fix reported by Jens Schmidt <jschmidt4gnu@vodafonemail.de>
* lisp/gnus/nnagent.el (nnagent-request-set-mark): Restore the use of
a temporary buffer that was inadvertently removed.
Daniel Martín [Sun, 25 Jun 2023 20:17:14 +0000 (22:17 +0200)]
Make js-beginning-of-defun return non-nil on success
The docstring of 'beginning-of-defun-function' says that the
function shall return non-nil when it found the beginning
of a defun. This is specially important because the calling
code decides when to move point depending on the return value.
* lisp/progmodes/js.el (js-beginning-of-defun)
(js--beginning-of-defun-flat): Return non-nil when the beginning
of a defun is found. (Bug#64283)
* test/lisp/progmodes/js-tests.el (js-mode-end-of-defun): Add a unit
test.
Alan Mackenzie [Wed, 28 Jun 2023 18:29:39 +0000 (18:29 +0000)]
Fontify C, C++, Objective C identifiers containing $
Optionally, fontify them with font-lock-warning-face.
This fixes bug#64204.
* lisp/progmodes/cc-fonts.el (c-font-lock-ids-with-dollar):
New function.
(c-simple-decl-matchers, c-complex-decl-matchers): invoke
c-font-lock-ids-with-dollar for pertinent languages.
* lisp/progmodes/cc-langs.el (c-symbol-start): Add `$' to the
character list.
(c-dollar-in-ids): New lang const.
(c-symbol-key): For the Pike value, use the AWK value rather
than the C value as the basis, as the latter is no longer
suitable.
* lisp/progmodes/cc-vars.el (c-warn-ids-with-dollar): New
customizable option.
* doc/misc/cc-mode.texi ("Miscellaneous Font Locking"): Add a
section on the new optional fontification of identifiers with
'font-lock-warning-face'.
Yuan Fu [Wed, 28 Jun 2023 03:58:34 +0000 (20:58 -0700)]
Tree-sitter use with-silent-modifications like jit-lock (bug#64321)
* lisp/treesit.el (treesit--font-lock-notifier): Use
with-silent-modifications when marking modified text to be fontified
by jit-lock. This is what jit-lock itself does.
Alan Mackenzie [Tue, 27 Jun 2023 20:11:48 +0000 (20:11 +0000)]
Amend the handling of c-laomib-cache.
There was unstable syntactic analysis of lines which were brace
lists. This fixes bug#64133.
* lisp/progmodes/cc-engine.el (c-laomib-cache): Allow several
entries with the same LIM element corresponding to distinct
scanning regions.
(c-laomib-get-cache): Add new parameter START. Adjust to be
able to have entries with the same LIM element and handle them
correctly.
(c-laomib-put-cache): Amend the handling of cache entries with
the same LIM element.
(c-looking-at-or-maybe-in-bracelist): Supply the needed new
argument to c-laomib-get-cache. Add in a new call to
c-laomib-put-cache.
Stephen Berman [Tue, 27 Jun 2023 15:50:18 +0000 (17:50 +0200)]
Fix todo-mode.el Commentary and a doc string (bug#64298)
* lisp/calendar/todo-mode.el: Explicitly note in the Commentary
that the Todo mode user manual is a separate Info manual in the
Emacs installation.
(todo-always-add-time-string): Replace doc string, which was
mistakenly retained in the initial merge of this version of
todo-mode.el, by a correct description of this user option.
Stephen Berman [Tue, 27 Jun 2023 15:38:20 +0000 (17:38 +0200)]
Prevent truncation of todo-mode categories sexp
* lisp/calendar/todo-mode.el (todo-delete-file)
(todo-move-category, todo-convert-legacy-files)
(todo-update-categories-sexp, todo-check-format):
Bind print-length and print-level to nil before using prin1
and related functions, to avoid truncating the todo categories
sexp and possibly corrupting the file format.
Stephen Berman [Tue, 27 Jun 2023 15:27:42 +0000 (17:27 +0200)]
Avoid making todo-mode buffers manually editable
* lisp/calendar/todo-mode.el (todo-add-category)
(todo-move-category, todo-edit-item--header)
(todo-set-item-priority, todo-move-item, todo-item-undone)
(todo-archive-done-item, todo-set-category-number): Restrict the
scope of nil buffer-read-only to the function calls that change
buffer text, thereby preventing todo mode buffers from becoming
manually editable and hence possibly corrupted when the minibuffer
is in use.
* lisp/misc.el (duplicate-line): Add the newline to the string to be
inserted instead of inserting it separately.
This makes duplicate-line as fast as duplicate-dwim with a contiguous
region. Both could easily be made faster yet by making the code more
complex.
F. Jason Park [Sun, 25 Jun 2023 13:15:11 +0000 (06:15 -0700)]
Avoid "shadows" warning from erc-button--nick slots
* lisp/erc/erc-button.el (erc-button-nick): Rename slots that share
names with user options to avoid "lexical argument shadows the dynamic
variable" warning.
(erc-button-add-nickname-buttons): Remove "erc-button-" namespace from
slot accessors.
* etc/ERC-NEWS: Also revert hunk from 52c8d537 "* etc/ERC-NEWS: Add
section for ERC 5.6." because it announced this feature, which no
longer exists.
* lisp/erc/erc.el (erc-reuse-frames): Revise doc string instead of
reverting completely. (Bug#62833)
Stefan Monnier [Sun, 25 Jun 2023 15:38:40 +0000 (11:38 -0400)]
cl-macs.el: Silence recent new "lexical arg shadows" warnings
* lisp/emacs-lisp/cl-macs.el (cl--slet): Add `nowarn` arg.
(cl--defsubst-expand): Use it.
(cl-defstruct): Silence warnings abour lexical shadowing when a slot's
name happens to be the same as a dynbound var.
Stefan Monnier [Sun, 25 Jun 2023 15:11:03 +0000 (11:11 -0400)]
Allow suppressing the "lexical arg shadows dynbound var" warning
In most cases the right way to fix this warning is by renaming
the offending argument, but in some cases this is inconvenient, as is
the case in `cl-defstruct` where arg names are imposed by slot names.
This patch also happens to fix a few bugs along the way:
- miscompilation of (lambda (gcs-done) (lambda (x) (+ x gcs-done)))
- errors about void function `byte-compile-warn-x` if the warning was
emitted via `cconv-fv` when bytecomp was not loaded.
Oh, and it improves the warning by making the location info slightly
more precise.
* lisp/emacs-lisp/cconv.el (cconv--analyze-function): Remove this warning.
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list):
Warn about it here instead. Let `with-suppressed-warnings` control it
under `lexical`.
Alan Mackenzie [Sun, 25 Jun 2023 15:06:05 +0000 (15:06 +0000)]
Correction to patch on 2023-06-21 15:36:56 +0000.
This corrects an error where commenting out a template closer
left a subsequent closer without a syntax-table text property.
* lisp/progmodes/cc-engine.el (c-unmark-<>-around-region):
Don't scan from the inside of 2-character comment delimiters.
Replace invalid skip-syntax-forward call with a null string
argument by an invocation of
c-search-forward-non-nil-char-property.
* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed):
Mention "cons cell". Add index entries.
(car & cdr): Simplify etymology of `car' and `cdr'.
Explain why for some purposes they are better than `first' and `rest'.
Mention cons cells.
* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed):
Mention "cons cell". Add index entries.
(car & cdr): Simplify etymology of `car' and `cdr'.
Explain why for some purposes they are better than `first' and `rest'.
Mention cons cells.
Stefan Monnier [Sat, 24 Jun 2023 21:53:41 +0000 (17:53 -0400)]
(macroexp--unfold-lambda): Obey the lexbind semantics
While at it, rework the code so as not to rely on an
intermediate rewriting of (funcall (lambda ..) ...)
to ((lambda ..) ...) since that forms is deprecated.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-funcall): Unfold lambdas
instead of turning them into the deprecated ((lambda ..) ..).
(byte-optimize-form-code-walker): Don't unfold ((lambda ..) ..) any more.
(byte-compile-inline-expand): Revert to non-optimized call if the unfolding
can't be optimized.
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Don't unfold
((lambda ..) ..) any more.
* lisp/emacs-lisp/disass.el (disassemble): Make sure the code is
compiled with its own `lexical-binding` value.
* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda): Make it work
both for ((lambda ..) ..) and for (funcall #'(lambda ..) ..).
Be careful not to move dynbound vars from `lambda` to `let`.
(macroexp--expand-all): Unfold (funcall #'(lambda ..) ..) instead of
turning it into ((lambda ..) ..). Don't unfold ((lambda ..) ..) any more.
kobarity [Sun, 18 Jun 2023 14:47:25 +0000 (23:47 +0900)]
Fix Python indentation of continuation lines within parens
* lisp/progmodes/python.el (python-indent-context): Add a new indent
context `:inside-paren-continuation-line'.
(python-indent--calculate-indentation): Use the new indent context.
* test/lisp/progmodes/python-tests.el (python-indent-pep8-2)
(python-indent-pep8-3)
(python-indent-inside-paren-1)
(python-indent-inside-paren-2)
(python-indent-inside-paren-3)
(python-indent-inside-paren-6)
(python-indent-after-backslash-2): Change to use the new indent
context.
(python-indent-inside-paren-8)
(python-indent-inside-paren-9): New tests. (Bug#63959)
Eshel Yaron [Sat, 17 Jun 2023 10:48:51 +0000 (13:48 +0300)]
New command 'eww-copy-alternate-url'
This adds a new command to EWW that copies an alternate link to the
currently visited page into the kill ring. This is useful for
subscribing to website feeds, etc.
* lisp/net/eww.el (eww--alternate-urls, eww-read-alternate-url):
New functions.
(eww-copy-alternate-url): New command.
(eww-mode-map): Bind it to 'A'.
Eli Zaretskii [Sat, 24 Jun 2023 11:13:42 +0000 (07:13 -0400)]
Merge from origin/emacs-29
d0147ff9e50 * lisp/emacs-lisp/shortdoc.el: More and better `substring... fa06249a9fb Fix "C-x RET r" when the new encoding is UTF 679e9d7c56e ; Mention MinGW64 GCC 13.1 problems in PROBLEMS fdc1a12ed1a Fix "vc-print-log does not erase buffer" and associated p... d507aa7336b Add selector_expression indentation rule 1f664a0af75 Add "nixd" LSP server to Eglot e962cf4ba72 Fix building --with-native-compilation=aot from release t... 4ca371e9cc7 Fix bug#64152 (Minibuffer sometimes goes "modal") a0ccf1859cc Disable target-async by default in gdb-mi.el 2bad5829ff7 Revert "Fix parsing of dn line if WITHDN is non-nil" 7637e361d3b Don't truncate filenames with "emacs.el" in them 2591eb1190a Improve documentation of 'minibuffer-message' 6f211bc57b9 Eglot: again fix positions of coinciding inlay hint overl... a24e9e3fee5 ; Update ChangeLog.4 and etc/AUTHORS.
Eli Zaretskii [Sat, 24 Jun 2023 10:57:25 +0000 (06:57 -0400)]
Merge from origin/emacs-29
8f62e7b85f6 Describe primarily the Emacs s-exp dialect for treesit qu... eacd75df4e4 ; Improve documentation of overlay priorities b3f11e94fad Fix documentation of :predicate in 'define-globalized-min...
Stephen Berman [Sat, 24 Jun 2023 08:45:10 +0000 (10:45 +0200)]
Apply quote substitution to popup choice menus
* lisp/wid-edit.el (widget-choose): Iteratively apply
substitute-command-keys to choice item text before building popup
or text buffer menu. Also fix two unnecessary uses of let*.
* etc/NEWS: Describe changes in Tramp kubernetes method.
* lisp/net/tramp-container.el (tramp-kubernetes-context)
(tramp-kubernetes-namespace): New defcustoms.
(tramp-kubernetes--completion-function): Extend for CONTAINER.POD
syntax.
(tramp-kubernetes--host-name-regexp): New defconst.
(tramp-kubernetes--container, tramp-kubernetes--pod)
(tramp-kubernetes--current-context): New defuns.
(tramp-kubernetes--current-context-data): Simplify.
(tramp-kubernetes--context-namespace): New defun.
(tramp-methods) <kubernetes>: Respect container, context and
namespace. (Bug#59797)
(tramp-container-connection-local-default-kubernetes-variables):
New defconst. Set respective connection-local variables.
* lisp/net/tramp-sh.el (tramp-config-check): New variable.
(tramp-open-connection-setup-interactive-shell): Use it.
* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-extra-expand-args): New defvar.
(tramp-expand-args): Use it.
Stefan Monnier [Fri, 23 Jun 2023 15:37:12 +0000 (11:37 -0400)]
cl-defsubst: Use static scoping for args
* lisp/emacs-lisp/cl-macs.el (cl--slet): New function, partly extracted
from `cl--slet*`.
(cl--slet*): Use it.
(cl--defsubst-expand): Use it to fix bug#47552.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct-dynbound-label):
New test.