]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoFix SVG scaling (bug#59802)
Manuel Giraud [Tue, 13 Dec 2022 09:10:03 +0000 (10:10 +0100)]
Fix SVG scaling (bug#59802)

Fix SVG scaling with librsvg>2.52 and SVG file with only one known
dimension.

* src/image.c (svg_load_image): Compute a percentage dimension with
the other known dimension.

2 years ago; Add useful hint to which-func documentation
Eli Zaretskii [Fri, 16 Dec 2022 15:43:46 +0000 (17:43 +0200)]
; Add useful hint to which-func documentation

* lisp/progmodes/which-func.el (which-func-non-auto-modes)
(which-func-maxout): Mention the slow startup with Eglot and
how to work around that.  (Bug#60107)

2 years ago; Improve doc strings of minibuffer-history commands
Eli Zaretskii [Fri, 16 Dec 2022 15:32:05 +0000 (17:32 +0200)]
; Improve doc strings of minibuffer-history commands

* lisp/simple.el (goto-history-element, next-history-element)
(previous-history-element): Doc fixes.  (Bug#60103)

2 years ago; Fix last changes in buffer.c
Eli Zaretskii [Fri, 16 Dec 2022 14:46:37 +0000 (16:46 +0200)]
; Fix last changes in buffer.c

* src/buffer.c (other_buffer_safely): Ensure Lisp Interaction mode
in *scratch*.  (Bug#60096)

2 years agoFix some naming issues involving query buffers in ERC
F. Jason Park [Mon, 12 Dec 2022 15:38:44 +0000 (07:38 -0800)]
Fix some naming issues involving query buffers in ERC

* lisp/erc/erc-networks.el
(erc-networks-rename-surviving-target-buffer): Don't kill a surviving
target buffer when another, non-target buffer, possibly not even
belonging to ERC, already exists and sports the target's name.
(erc-networks--reconcile-buffer-names): Always append a network-ID
suffix to a target buffer's name if another buffer of that name
already exists.  (Bug#59976.)
* lisp/erc/erc.el (erc, erc-tls): Revise `:id' portion of doc strings.
Thanks to Mike Kazantsev for the suggestion and for filing this bug
and helping solve it.
* test/lisp/erc/erc-networks-tests.el:
(erc-networks-rename-surviving-target-buffer--query-non-target): Add
new test.
* test/lisp/erc/erc-scenarios-base-association-query.el: New file.
* test/lisp/erc/resources/base/assoc/queries/netnick.eld: New file.
* test/lisp/erc/resources/base/assoc/queries/non-erc.eld: New file.

2 years ago; Fix doc string in ERC's module-activation commands
F. Jason Park [Fri, 16 Dec 2022 07:25:10 +0000 (23:25 -0800)]
; Fix doc string in ERC's module-activation commands

* lisp/erc/erc-common.el (erc--assemble-toggle): Previously, the doc
string implied that a prefix argument was necessary to achieve
connection-wide effects, which might lead a person to think the
interactive code should be an uppercase "P".
* test/lisp/erc/erc-tests.el (define-erc-module--local): Update
expected result of code-gen.

2 years agoIncrement erc-debug-irc-protocol-version to 2
F. Jason Park [Thu, 15 Dec 2022 04:03:15 +0000 (20:03 -0800)]
Increment erc-debug-irc-protocol-version to 2

* lisp/erc/erc.el (erc-debug-irc-protocol-version): Change version to
2 to help dependent tooling detect redacted passwords.
(erc-log-irc-protocol): Don't bother redacting incoming messages.
(Bug#59284.)

2 years agoA better fix for bug#60096
Eli Zaretskii [Fri, 16 Dec 2022 14:29:51 +0000 (16:29 +0200)]
A better fix for bug#60096

* lisp/startup.el (initial-scratch-message):
* lisp/simple.el (get-scratch-buffer-create): Revert last changes.

* src/window.c (Fset_window_configuration): Force recalculation of
Vwindow_list after restoring the windows.
* src/buffer.c (other_buffer_safely): Make sure we always return a
valid buffer, even if 'get-scratch-buffer-create' signals an
error.

2 years ago; Fix printing Lisp types in .gdbinit
Eli Zaretskii [Fri, 16 Dec 2022 12:14:42 +0000 (14:14 +0200)]
; Fix printing Lisp types in .gdbinit

* src/alloc.c (valid_lisp_object_p): Support printing
stack-allocated strings and cons cells.

2 years agoBump Eglot version to 1.10
João Távora [Fri, 16 Dec 2022 09:23:21 +0000 (09:23 +0000)]
Bump Eglot version to 1.10

* lisp/progmodes/eglot.el (Version): Bump to 1.10
(Package-Requires): Bump required versions of jsonrpc and project.

2 years agoEglot: fix discrepant eglot-guess-contact/eglot-command-history
João Távora [Fri, 16 Dec 2022 09:29:32 +0000 (09:29 +0000)]
Eglot: fix discrepant eglot-guess-contact/eglot-command-history

Due to a typo, the defvar eglot--command-history wasn't actually used
in eglot-guess-contact as intended.  That function used a
single-dash-name version of the variable instead.

This worked fine, except that two variables were created instead of
one, and the one actually being used didn't have any docstring.

Rename the variable to eglot-command-history to fix this.  It's better
than renaming the reference in eglot-guess-contact which would lose
user's history for M-x eglot.

* lisp/progmodes/eglot.el (eglot-command-history): Rename from
eglot--command-history.

2 years agoAvoid recursive process filters in lisp/jsonrpc.el (bug#60088)
João Távora [Thu, 15 Dec 2022 15:26:13 +0000 (15:26 +0000)]
Avoid recursive process filters in lisp/jsonrpc.el (bug#60088)

jsonrpc.el may lose JSON-RPC messages because of recursive process
filters.  The problem happens in jsonrpc.el's jsonrpc--process-filter.

The code of the process filter didn't expect to be called recursively
and fails in that case.

But that can happen if the three conditions are verified.

1. the client code invoked by its jsonrpc--connection-receive inside
   the process filter callee immediately sends follow-up input to
   process within the same Lisp stack.  This is a common scenario,
   especially during LSP initialiation sequence used by Eglot, a
   jsonrpc.el client.

2. that follow-up message is large enough for process-send-string to
   send the input in bunches (output from processes can arrive in
   between bunches).

3. the process happens to have already some more output ready

The fix in this commit detects recursive invocations and immediately
re-schedules them as non-recursive calls to the
jsonrpc--process-filter (but started from timers).

* lisp/jsonrpc.el (jsonrpc--process-filter): Rework.
(Version): Bump to 1.0.16.

2 years ago; Fix typos
Stefan Kangas [Thu, 15 Dec 2022 01:41:20 +0000 (02:41 +0100)]
; Fix typos

2 years agoAdd lambda_expression-rule to java-ts-mode (bug#60091)
Theodor Thornhill [Thu, 15 Dec 2022 13:54:17 +0000 (14:54 +0100)]
Add lambda_expression-rule to java-ts-mode (bug#60091)

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
rule.

2 years agoeglot: Add support for new language server csharp-ls
Jostein Kjønigsen [Thu, 15 Dec 2022 12:44:39 +0000 (13:44 +0100)]
eglot: Add support for new language server csharp-ls

C# has two popular language servers: Omnisharp Roslyn (already
supported) and csharp-ls (newer, more performant).

* lisp/progmodes/eglot.el: Add new C# language server
csharp-ls.  (Bug#60089)

2 years agoUse the new tree-sitter commands
Yuan Fu [Fri, 16 Dec 2022 01:44:07 +0000 (17:44 -0800)]
Use the new tree-sitter commands

* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-valid-p)
(c-ts-mode--defun-skipper): New functions.
(c-ts-base-mode): Setup defun navigation.
* lisp/progmodes/sh-script.el (bash-ts-mode): Setup defun navigation.
* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Change to new implementation, which is
intended to be used as commands.
(treesit-major-mode-setup): Setup remap for beginning/end-of-defun
commands.

2 years agoAdd "function" feature to python-ts-mode (bug#59977)
Yuan Fu [Fri, 16 Dec 2022 01:25:06 +0000 (17:25 -0800)]
Add "function" feature to python-ts-mode (bug#59977)

* lisp/progmodes/python.el (python--treesit-settings): Add feature.
(python-ts-mode): Add feature.  And fix indentation for the
python-indent-guess-indent-offset code.

2 years agoAdd go-ts-mode and go-mod-ts-mode (Bug#60025)
Randy Taylor [Sun, 11 Dec 2022 23:41:16 +0000 (18:41 -0500)]
Add go-ts-mode and go-mod-ts-mode (Bug#60025)

* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add go-mod support.
* etc/NEWS: Mention them.
* lisp/progmodes/eglot.el (eglot-server-programs): Add them.
* lisp/progmodes/go-ts-mode.el: New major modes with
tree-sitter support.

2 years agoAdd basic support for hideshow in python-ts-mode (bug#60044)
Yuan Fu [Fri, 16 Dec 2022 01:16:28 +0000 (17:16 -0800)]
Add basic support for hideshow in python-ts-mode (bug#60044)

* lisp/progmodes/python.el (python-base-mode): Add setup for
python-ts-mode.

2 years agoAdd "this" keyword to java-ts-mode (bug#60086)
Theodor Thornhill [Thu, 15 Dec 2022 10:48:32 +0000 (11:48 +0100)]
Add "this" keyword to java-ts-mode (bug#60086)

* lisp/progmodes/java-ts-mode.el
(java-ts-mode--font-lock-settings): Add the node to the keyword
feature.

2 years agoWhen completing relative project file names, use relative history
Dmitry Gutov [Thu, 15 Dec 2022 22:45:55 +0000 (00:45 +0200)]
When completing relative project file names, use relative history

* lisp/progmodes/project.el: Require 'cl-lib'.

* lisp/progmodes/project.el (project--read-file-cpd-relative):
Pre-process history entries around completing-read (bug#58447).

This includes both filtering by common-parent-directory prefix and
mapping into relative names.

2 years agoAvoid segfaults due to invalid selected-window's buffer
Eli Zaretskii [Thu, 15 Dec 2022 21:39:58 +0000 (23:39 +0200)]
Avoid segfaults due to invalid selected-window's buffer

* lisp/startup.el (initial-scratch-message): Don't use \\[...]
commands for substitute-command-keys.
* lisp/simple.el (get-scratch-buffer-create): Don't call
substitute-command-keys on initial-scratch-message, to avoid
signaling an error in rare cases.  (Bug#60096)

2 years agoRevert 21b387c39bd with last-minute hasty changes (bug#60048).
Juri Linkov [Thu, 15 Dec 2022 19:24:48 +0000 (21:24 +0200)]
Revert 21b387c39bd with last-minute hasty changes (bug#60048).

* lisp/simple.el (completion-list-mode-map): Unbind [up] and [down].
(previous-line-completion, next-line-completion): Remove.

2 years agoReplace an erroneous eq with an equal in cc-defs.el
Alan Mackenzie [Thu, 15 Dec 2022 19:23:19 +0000 (19:23 +0000)]
Replace an erroneous eq with an equal in cc-defs.el

* lisp/progmodes/cc-defs.el (c-looking-at-non-alphnumspace): Replace eq with
equal in the XEmacs branch.

2 years ago* lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.
Juri Linkov [Thu, 15 Dec 2022 19:10:28 +0000 (21:10 +0200)]
* lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.

This helps to avoid the error in 'where-is-internal' that should
not call :filter unnecessarily (bug#9923).

2 years agocompile.el: Fix regression with nb of errors in modeline
Stefan Monnier [Thu, 15 Dec 2022 18:36:14 +0000 (13:36 -0500)]
compile.el: Fix regression with nb of errors in modeline

* lisp/progmodes/compile.el (compilation-mode-line-errors): Mark it as
risky-local, like `defconst` used to do for us.

2 years agoMake tab-bar-tab-group-format-function backwards-compatible (bug#60073)
Juri Linkov [Thu, 15 Dec 2022 18:03:24 +0000 (20:03 +0200)]
Make tab-bar-tab-group-format-function backwards-compatible (bug#60073)

* lisp/tab-bar.el (tab-bar--format-tab-group): Add condition-case
with wrong-number-of-arguments for backwards-compatibility.
(tab-bar-tab-group-format-default): Simplify.

2 years agoMake tab-bar-tab-group-format-function also handle current group
Gabriel do Nascimento Ribeiro [Thu, 15 Dec 2022 14:58:30 +0000 (11:58 -0300)]
Make tab-bar-tab-group-format-function also handle current group

* lisp/tab-bar.el (tab-bar--format-tab-group): Call
'tab-bar-tab-group-format-default' to format current group tab.
(tab-bar-tab-group-format-default): Update function to also handle
current group tab (bug#60073).

2 years agoEnsure package directories for source packages from checkouts
Philip Kaludercic [Thu, 15 Dec 2022 17:21:24 +0000 (18:21 +0100)]
Ensure package directories for source packages from checkouts

* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Set the :dir entry, since `package-vc--unpack-1' assumes the field is
set, as is the case when invoking `package-vc--unpack'.

2 years ago; * etc/NEWS: Fix recent changes.
Randy Taylor [Thu, 15 Dec 2022 16:44:10 +0000 (11:44 -0500)]
; * etc/NEWS: Fix recent changes.

2 years ago* test/README (SELECTOR): Add eglot-tests.el to remote file using libraries.
Michael Albinus [Thu, 15 Dec 2022 15:37:36 +0000 (16:37 +0100)]
* test/README (SELECTOR): Add eglot-tests.el to remote file using libraries.

2 years agoFix bug#60060 in Tramp
Michael Albinus [Thu, 15 Dec 2022 15:37:16 +0000 (16:37 +0100)]
Fix bug#60060 in Tramp

* lisp/net/tramp-sh.el (tramp-sh-handle-file-local-copy):
Delete `tmpfile' in case of error.  (Bug#60060)

2 years ago; * lisp/net/tramp-crypt.el: Fix comment.
Michael Albinus [Thu, 15 Dec 2022 15:36:38 +0000 (16:36 +0100)]
; * lisp/net/tramp-crypt.el: Fix comment.

2 years ago* .gitignore: Ignore GDB history files.
Manuel Giraud [Thu, 15 Dec 2022 08:50:32 +0000 (09:50 +0100)]
* .gitignore: Ignore GDB history files.

2 years agoMention 'tree-sitter' in user manual and NEWS
Eli Zaretskii [Thu, 15 Dec 2022 08:47:11 +0000 (10:47 +0200)]
Mention 'tree-sitter' in user manual and NEWS

* doc/emacs/programs.texi (Program Modes): Mention tree-sitter and
the modes supported by it.
* etc/NEWS: Mention tree-sitter in the Installation Changes
section.

2 years ago; * etc/NEWS: Rearrange entries for tree-sitter supported modes.
Eli Zaretskii [Thu, 15 Dec 2022 08:25:27 +0000 (10:25 +0200)]
; * etc/NEWS: Rearrange entries for tree-sitter supported modes.

2 years ago; Announce 'toml-ts-mode' in NEWS.
Eli Zaretskii [Thu, 15 Dec 2022 08:09:25 +0000 (10:09 +0200)]
; Announce 'toml-ts-mode' in NEWS.

2 years ago; Auto-commit of loaddefs files.
Stefan Kangas [Thu, 15 Dec 2022 04:11:35 +0000 (05:11 +0100)]
; Auto-commit of loaddefs files.

2 years ago; Don't quote nil in comments
Stefan Kangas [Thu, 15 Dec 2022 01:24:56 +0000 (02:24 +0100)]
; Don't quote nil in comments

2 years ago; Checkdoc fixes in dired-aux.el
Stefan Kangas [Thu, 15 Dec 2022 01:22:45 +0000 (02:22 +0100)]
; Checkdoc fixes in dired-aux.el

* lisp/dired-aux.el (dired-compare-directories, dired-do-chmod)
(dired-do-chgrp, dired-do-chown, dired-do-touch)
(dired-minibuffer-default-add-shell-commands)
(dired-read-shell-command, dired-mark-prefix)
(dired-mark-postfix, dired-mark-separator, dired-kill-line)
(dired-reset-subdir-switches, dired-add-entry)
(dired-remove-file)
(dired-create-destination-dirs-on-trailing-dirsep)
(dired-maybe-insert-subdir, dired-tree-up, dired-tree-down):
Checkdoc fixes.

2 years agoFix ruby-add-log-current-method after nested class definition
Dmitry Gutov [Thu, 15 Dec 2022 01:21:14 +0000 (03:21 +0200)]
Fix ruby-add-log-current-method after nested class definition

* lisp/progmodes/ruby-mode.el (ruby--add-log-current-indent):
New function.
(ruby-add-log-current-method): Use it.
Check for "class" and "module" indentation to filter out the
definitions which don't include the given position.  Also try to
match "def" only once (for performance), because if the closest
one doesn't include the given position, none will.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-after-inner-class-outside-methods)
(ruby-add-log-current-method-after-inner-class-outside-methods-with-text):
New tests.

2 years agoAdd indent rules to js/typescript/tsx-ts-mode (bug#60074)
Theodor Thornhill [Wed, 14 Dec 2022 20:23:33 +0000 (21:23 +0100)]
Add indent rules to js/typescript/tsx-ts-mode (bug#60074)

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Add in binary_expression and
jsx_fragment.
* lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules.

2 years agoImprove fontification in csharp-ts-mode (bug#59897)
Jostein Kjønigsen [Thu, 8 Dec 2022 10:07:15 +0000 (11:07 +0100)]
Improve fontification in csharp-ts-mode (bug#59897)

Fixes highlighting of generic methods like the one below:

instance.MethodWithTypeArguments<Type>(...);
InClassMethodWithTypeArguments<Type>(...);

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add new rule.

2 years agoRevert "Add expression for generic_name in csharp-ts-mode"
Yuan Fu [Wed, 14 Dec 2022 22:28:29 +0000 (14:28 -0800)]
Revert "Add expression for generic_name in csharp-ts-mode"

I applied the wrong commit, the next commit will be the right one,
sorry about that!

This reverts commit 647b6a8099f414e5a7b162efd3658e174064dfe7.

2 years agoIntroduce support for TOML config-format
Jostein Kjønigsen [Sun, 11 Dec 2022 12:05:29 +0000 (13:05 +0100)]
Introduce support for TOML config-format

This commit introduces support for the semi-popular TOML
config-format[1] through a new major-mode: toml-ts-mode.

I've read through the full spec[2], and from what I can see this
major-mode should provide correct syntax-highligting for every sort of
config-declaration which adheres to the specification.

Besides that it also adds support for imenu and basic tree-sitter
based navigation.

[1] https://toml.io/en/
[2] https://toml.io/en/v1.0.0

2 years agoFix handling of % when searching in .tex or .dtx files
Arash Esbati [Wed, 14 Dec 2022 20:17:30 +0000 (21:17 +0100)]
Fix handling of % when searching in .tex or .dtx files

* lisp/textmodes/reftex.el (reftex-compile-variables): Consider %
when building the regexp for searching only in .dtx files.
(AUCTeX bug#59638)

2 years agoTreat C++ classes as defuns in C Tree-sitter mode (bug#60047)
Daniel Martín [Tue, 13 Dec 2022 20:35:40 +0000 (21:35 +0100)]
Treat C++ classes as defuns in C Tree-sitter mode (bug#60047)

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add "class_specifier"
as a node of type "defun".

2 years agoAdd < and > to the syntax table in c++-ts-mode (bug#60049)
Daniel Martín [Tue, 13 Dec 2022 21:28:13 +0000 (22:28 +0100)]
Add < and > to the syntax table in c++-ts-mode (bug#60049)

* lisp/progmodes/c-ts-mode.el (c++-ts-mode--syntax-table): Add a
specific syntax table for C++.  Consider "<" and ">" open/close
delimiters (C++ templates).
(c++-ts-mode): Use the new syntax table.

2 years agoImprove fontifications in Typescript mode
Jostein Kjønigsen [Wed, 7 Dec 2022 08:27:42 +0000 (09:27 +0100)]
Improve fontifications in Typescript mode

* lisp/progmodes/typescript-ts-mode.el: Improve fontification of
variables.  (Bug#59831)

2 years agoUpdate the documentation of overlays (bug#59996)
Eli Zaretskii [Wed, 14 Dec 2022 18:13:47 +0000 (20:13 +0200)]
Update the documentation of overlays (bug#59996)

* src/buffer.c (Foverlay_recenter, Foverlay_lists): Update the doc
strings.

* lisp/subr.el (copy-overlay): Update comment.

* doc/lispref/internals.texi (Buffer Internals): Remove buffer
fields relevant to the old implementation; add the new interval
tree field.
* doc/lispref/display.texi (Overlays, Managing Overlays): Update
text to be consistent with the new implementation of overlays.
(Managing Overlays): Remove documentation of 'overlay-recenter'.

* etc/NEWS: Mention incompatible aspects of overlay
reimplementation.

2 years ago; Improve description of scoping and let-bindings
Eli Zaretskii [Wed, 14 Dec 2022 15:46:16 +0000 (17:46 +0200)]
; Improve description of scoping and let-bindings

* doc/lispref/variables.texi (Local Variables, Variable Scoping):
Explain the move to lexical-binding and elaborate on 'let*'.
Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
(Bug#60027)

2 years ago; Fix a typo in window.el
Eli Zaretskii [Wed, 14 Dec 2022 15:08:46 +0000 (17:08 +0200)]
; Fix a typo in window.el

* lisp/window.el (switch-to-prev-buffer-skip-p): Fix typo.
Patch by Shuguang Sun <shuguang79@qq.com>.  (Bug#59985)

2 years agoDon't send erc-sasl-user as USER command argument
F. Jason Park [Tue, 13 Dec 2022 07:58:03 +0000 (23:58 -0800)]
Don't send erc-sasl-user as USER command argument

* lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch
for sending an opening "CAP LS".  The rationale for not enabling this
by default is twofold: one, it more strongly implies that ERC supports
IRCv3 client capability negotiation, which is somewhat disingenuous;
and, two, We'd still be "faking it" by firing and forgetting, and more
balls in the air makes things less predictable.
(erc--register-connection): Possibly send a "CAP LS" before anything
depending on the value of `erc-sasl--send-cap-ls'.  Also, don't
attempt to send `erc-session-username' when it holds an SASL username
because the latter may contain protocol-defying characters.
* test/lisp/erc/resources/base/local-modules/fourth.eld: change user
parameter of "USER" command to reflect nick when `erc-sasl-user' is
set to `:user'.  (Bug#59976.)

2 years agoSet erc-network to a "given" ID instead of failing
F. Jason Park [Tue, 13 Dec 2022 07:58:03 +0000 (23:58 -0800)]
Set erc-network to a "given" ID instead of failing

* lisp/erc/erc-networks.el (erc-networks--determine): Return the
so-called "given" ID from a non-nil `:id' keyword arg passed to `erc'
or `erc-tls'.
(erc-networks--allow-unknown-network): Add internal variable to
allow IRC session to continue despite the network being unknown.
(erc-networks--set-name): Tell the user about falling back to a given
ID when the network can't be determined.  When that's so, end the
session by destroying the connection unless
`erc-networks--allow-unknown-network' is enabled.  (Bug#59976.)
(erc-networks--ensure-announced): Include the fallback announced
server name in the error message.
* test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Add
dummy server process and don't expect an error to be signaled.
* test/lisp/erc/erc-scenarios-misc.el
(erc-scenarios-networks-announced-missing): Don't expect an error to
be signaled.
* test/lisp/erc/resources/networks/announced-missing/foonet.eld:
Remove "mode" match pattern.

2 years agoLimit casemapping to appropriate ranges in ERC
F. Jason Park [Mon, 12 Dec 2022 03:41:43 +0000 (19:41 -0800)]
Limit casemapping to appropriate ranges in ERC

* lisp/erc/erc-common.el (erc-downcase): Use case table for
`erc-downcase' so that case conversions are limited to the ASCII
interval.
* lisp/erc/erc.el (erc-casemapping--rfc1459-strict,
erc--casemapping-rfc1459): Make these case tables instead of
translation tables.  The functions in case-table.el modify the
standard syntax table, but that doesn't seem to make sense here,
right?
* test/lisp/erc/erc-tests.el (erc-downcase): Add cases showing
mappings outside of the ASCII range.  (Bug#59976.)

2 years agoActually accept non-symbols as IDs in erc-open
F. Jason Park [Mon, 12 Dec 2022 03:41:43 +0000 (19:41 -0800)]
Actually accept non-symbols as IDs in erc-open

* lisp/erc/erc.el (erc-generate-new-buffer-name): Despite what it says
in the documentation, only symbols were being accepted as valid `:id'
entry-point arguments.  This uses the interned `princ' representation
of the argument instead.
* test/lisp/erc/erc-scenarios-base-netid-samenet.el
(erc-scenarios-common--base-network-id-same-network): Randomly specify
a string for the ID param instead of a non-nil symbol when opening a
new connection.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common-assert-initial-buf-name): Adjust helper to allow
for non-symbol IDs.  (Bug#59976.)

2 years ago; Be nicer when updating browse-url var in erc-compat
F. Jason Park [Mon, 12 Dec 2022 03:16:07 +0000 (19:16 -0800)]
; Be nicer when updating browse-url var in erc-compat

* lisp/erc/erc-compat.el: Be more cautious about modifying
`browse-url-default-handlers' when loading erc-compat on Emacs 28.  A
user may have already added an entry for irc:// URLs before loading
`erc-compat'.

2 years agoRespect a nil erc-session-password when reconnecting
F. Jason Park [Sat, 3 Dec 2022 07:11:24 +0000 (23:11 -0800)]
Respect a nil erc-session-password when reconnecting

* lisp/erc/erc.el (erc-open): Simplify `old-vars' expression.
(erc--compute-server-password): Only compute a server password when
first connecting.  For compatibility, this respects third-party code
that expects session passwords in target buffers when initially
non-nil.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-auth-source-reconnect): Add new test.
* test/lisp/erc/resources/services/auth-source/recon.eld: Add new test
data file.  (Bug#59858.)

2 years agoAdd dedicated auth-source section in ERC manual
F. Jason Park [Thu, 1 Dec 2022 07:10:58 +0000 (23:10 -0800)]
Add dedicated auth-source section in ERC manual

* doc/misc/erc.texi: Move auth-source description from the Password
subheading of the Advanced chapter's Connecting section to the new
Integrations section as a new node, Auth-Source, and give it a bit
more structure.  Fix various misuses of xref vs. pxref.  Convert URL
subheading to subsection and add anchor.  Prefer "backend" as a single
word, based on usage in other manuals.  Also replace loud "warning" in
SASL troubleshooting section.
* etc/ERC-NEWS: Re-link auth-source mention.
* lisp/erc/erc-sasl.el (erc-sasl-auth-source-function): Update info
node in doc string.
* lisp/erc/erc-services.el (erc-auth-source-services-function):
Re-link auth-source info node in doc string.
* lisp/erc/erc.el (erc-password, erc-auth-source-server-function,
erc-auth-source-join-function): Re-link auth-source info node in doc
strings.

2 years ago; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commit
Mattias Engdegård [Wed, 14 Dec 2022 13:06:46 +0000 (14:06 +0100)]
; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commit

2 years ago; * lisp/progmodes/cmake-ts-mode.el (auto-mode-alist): $ -> \'
Mattias Engdegård [Wed, 14 Dec 2022 11:25:49 +0000 (12:25 +0100)]
; * lisp/progmodes/cmake-ts-mode.el (auto-mode-alist): $ -> \'

2 years agoBetter shortdoc examples
Mattias Engdegård [Wed, 14 Dec 2022 11:20:46 +0000 (12:20 +0100)]
Better shortdoc examples

* lisp/emacs-lisp/shortdoc.el
(symbol, comparison): New.
(string, list, number): Remove or change examples that do not have
well-defined results, such as `eq` on strings or floats.
Edit other examples for better illustrating each respective operation.

2 years agoShortdoc: read and evaluate strings after :eval
Mattias Engdegård [Wed, 14 Dec 2022 11:16:28 +0000 (12:16 +0100)]
Shortdoc: read and evaluate strings after :eval

* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function):
If the parameter of :eval is a string then read, evaluate and print
the result.  This was always the intention and is documented behaviour.

2 years agoFix Tramp tests in eglot-tests, prefix tests uniquely
Michael Albinus [Wed, 14 Dec 2022 09:52:04 +0000 (10:52 +0100)]
Fix Tramp tests in eglot-tests, prefix tests uniquely

* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Use `make-nearby-temp-file'.
(eglot--call-with-tramp-test): Set `tramp-verbose' and
`default-directory'.  The latter is needed for `make-nearby-temp-file'.
(eglot-test-tramp-test, eglot-test-tramp-test-2): Tag them as
:expensive-test.
(all): Prefix all tests with `eglot-test-' uniquely.

2 years ago* lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-temp-file (bug#60011)
Juri Linkov [Wed, 14 Dec 2022 08:05:55 +0000 (10:05 +0200)]
* lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-temp-file (bug#60011)

2 years agoDelete temp files after icalendar tests
Stefan Kangas [Wed, 14 Dec 2022 07:21:34 +0000 (08:21 +0100)]
Delete temp files after icalendar tests

* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--get-error-string-for-export): Make sure we clean up
temporary files after test.

2 years ago; * lisp/keymap.el (keymap-substitute): Doc fix. (Bug#60059)
Stefan Kangas [Wed, 14 Dec 2022 05:38:14 +0000 (06:38 +0100)]
; * lisp/keymap.el (keymap-substitute): Doc fix.  (Bug#60059)

(cherry picked from commit 1568123196cd8b57ed64e284b7deb058026be713)

2 years agoFix syntax tables of tree-sitter modes (bug#59807)
Kai Ma [Sat, 3 Dec 2022 22:15:42 +0000 (06:15 +0800)]
Fix syntax tables of tree-sitter modes (bug#59807)

Tree-sitter modes should use the same syntax table as the
non-tree-sitter ones.

* lisp/progmodes/js.el (js-mode-syntax-table)
(js-ts-mode)
* lisp/progmodes/python.el (python-ts-mode)
* lisp/progmodes/sh-script.el (bash-ts-mode)

Copyright-paperwork-exempt: yes

xx

2 years ago; * admin/notes/tree-sitter/build-module/build.sh: Minor name change.
Yuan Fu [Wed, 14 Dec 2022 00:24:38 +0000 (16:24 -0800)]
; * admin/notes/tree-sitter/build-module/build.sh: Minor name change.

2 years ago; Comment and stylistic change in treesit.el
Yuan Fu [Tue, 13 Dec 2022 23:59:29 +0000 (15:59 -0800)]
; Comment and stylistic change in treesit.el

* lisp/treesit.el (treesit-defun-skipper): Docstring change.
(treesit--navigate-defun): Comment and stylistic change.

2 years ago* doc/misc/Makefile.in (need_emacsver): Add use-package.
Stefan Kangas [Tue, 13 Dec 2022 23:36:30 +0000 (00:36 +0100)]
* doc/misc/Makefile.in (need_emacsver): Add use-package.

2 years agoFix bug when calling `rgrep` non-interactively
Stefan Kangas [Tue, 13 Dec 2022 21:01:45 +0000 (22:01 +0100)]
Fix bug when calling `rgrep` non-interactively

* lisp/progmodes/grep.el (rgrep): Fix bug where running
non-interactively requires running it interactively
first.  (Bug#60024)

2 years agoAdapt Tramp specific tests in eglot-tests.el
Michael Albinus [Tue, 13 Dec 2022 19:06:48 +0000 (20:06 +0100)]
Adapt Tramp specific tests in eglot-tests.el

* test/lisp/progmodes/eglot-tests.el (tramp): Move up.
(tramp-sh): Don't require.
(eglot--cleanup-after-test): Delete Tramp buffers if needed.
(eglot-tests-lsp-abiding-column): Rename from `eglot-lsp-abiding-column'.
(tramp-histfile-override): Declare.
(eglot--call-with-tramp-test):
Use `ert-remote-temporary-file-directory'.  Skip if needed.
(eglot--tramp-test, eglot--tramp-test-2): Don't skip.

2 years ago* lisp/textmodes/texinfo.el (texinfo-flymake): Improve docstring.
Stefan Kangas [Tue, 13 Dec 2022 17:57:25 +0000 (18:57 +0100)]
* lisp/textmodes/texinfo.el (texinfo-flymake): Improve docstring.

2 years agoSupport a function in the BUFFER-LIST arg of list-buffers-noselect (bug#59935)
Juri Linkov [Tue, 13 Dec 2022 17:47:47 +0000 (19:47 +0200)]
Support a function in the BUFFER-LIST arg of list-buffers-noselect (bug#59935)

* lisp/buff-menu.el (Buffer-menu-buffer-list): New buffer-local variable.
(list-buffers-noselect): Set Buffer-menu-buffer-list to 'buffer-list'
that now keeps the buffer-local value of the provided buffer list
or a function that returns the buffer list.
(list-buffers--refresh): Handle buffer-list and Buffer-menu-buffer-list
as a function and as a list.

* lisp/progmodes/project.el (project-list-buffers): Let-bind
'buffer-list-function' used by both legacy code and the new version
of list-buffers-noselect that supports its arg BUFFER-LIST as a function.

2 years ago; Fix typos
Stefan Kangas [Mon, 12 Dec 2022 07:50:21 +0000 (08:50 +0100)]
; Fix typos

2 years agoDon't allow lazy highlight from recursive minibuffers
Augusto Stoffel [Mon, 12 Dec 2022 22:07:28 +0000 (23:07 +0100)]
Don't allow lazy highlight from recursive minibuffers

See bug#59918.

* lisp/isearch.el (minibuffer-lazy-highlight-setup): Don't activate
when starting a recursive minibuffer.

2 years agoImprove resetting face attributes when looking for suitable fonts
Eli Zaretskii [Tue, 13 Dec 2022 15:35:17 +0000 (17:35 +0200)]
Improve resetting face attributes when looking for suitable fonts

* src/xfaces.c (syms_of_xfaces)<face-font-lax-matched-attributes>:
Change the default value to t.  Update doc string.
(realize_gui_face): When 'Vface_font_lax_matched_attributes' is t,
reset the 3 default font attributes efficiently.  Call
'font_maybe_unset_attribute' only if the value is neither nil nor
t.  (Bug#59347)

2 years ago; Fix typos in doc strings
Eli Zaretskii [Tue, 13 Dec 2022 14:01:13 +0000 (16:01 +0200)]
; Fix typos in doc strings

* lisp/treesit.el (treesit-defun-tactic)
(treesit-default-defun-skipper): Fix typos in doc strings.

2 years ago; * lisp/bs.el (bs-attributes-list): Doc fix
Juanma Barranquero [Tue, 13 Dec 2022 13:45:58 +0000 (14:45 +0100)]
; * lisp/bs.el (bs-attributes-list): Doc fix

2 years agoAdd lexical-binding to example package header
Stefan Kangas [Tue, 13 Dec 2022 06:27:16 +0000 (07:27 +0100)]
Add lexical-binding to example package header

* doc/lispref/package.texi (Simple Packages): Add lexical-binding
cookie to example package header.

2 years agoAdd improved tree-sitter navigation
Yuan Fu [Tue, 13 Dec 2022 04:25:53 +0000 (20:25 -0800)]
Add improved tree-sitter navigation

This new set of functions (and tests) should eliminate
defun-navigation bugs and limitations we currently have.  This commit
doesn't change any existing bahavior: treesit-beginning/end-of-defun
and friends are unchanged.  The plan is to later switch gear and
replace the current functions with the new ones introduced in this
change.

This is a relatively big change, but I've setup a comprehensive test,
and it should fix current bugs, so I think it's ok to put it on the
release branch.

The gist of the new navigation is to use treesit--defuns-around to
find the previous sibling defun, next sibling defun, and the parent
defun, then use this information to move to previous/next
beginning/end of defun in treesit--navigate-defun.

I also added comprehensive testing that tests all four possible
operations (prev-beg, next-beg, prev-end, next-end) starting at all
possible positions (between two sibling defuns, inside a sibling
defun, etc).

* lisp/treesit.el (treesit-defun-type-regexp): Expand definition to
allow (REGEXP . FILTER).  Old functions don't support this, but it
should be fine since we are soon replacing them.

(treesit-defun-tactic)
(treesit-defun-skipper): New variables.

(treesit-default-defun-skipper)
(treesit--defuns-around)
(treesit--top-level-defun)
(treesit--navigate-defun): New functions.

* test/src/treesit-tests.el (treesit--ert-insert-and-parse-marker)
(treesit--ert-collect-positions)
(treesit--ert-test-defun-navigation): New helper functions.

(treesit--ert-defun-navigation-python-program)
(treesit--ert-defun-navigation-js-program)
(treesit--ert-defun-navigation-bash-program)
(treesit--ert-defun-navigation-nested-master): New variables.

(treesit-defun-navigation-nested-1)
(treesit-defun-navigation-nested-2)
(treesit-defun-navigation-nested-3)
(treesit-defun-navigation-top-level): New tests.

2 years ago; * test/src/treesit-tests.el: Add outline headers.
Yuan Fu [Tue, 13 Dec 2022 02:14:30 +0000 (18:14 -0800)]
; * test/src/treesit-tests.el: Add outline headers.

2 years agoAdd cross-reference to flush-lines
Stefan Kangas [Tue, 13 Dec 2022 00:43:48 +0000 (01:43 +0100)]
Add cross-reference to flush-lines

* lisp/replace.el (flush-lines, kill-matching-lines): Add
cross-references between commands, using the names
'(kill|delete)-matching-lines' for symmetry.  (Bug#59934)

2 years agoUse font-lock-number-face for numeric values in csharp-mode
Jostein Kjønigsen [Mon, 12 Dec 2022 11:50:22 +0000 (12:50 +0100)]
Use font-lock-number-face for numeric values in csharp-mode

(bug#60004)

* lisp/progmodes/csharp-mode.el: update fontification code.

2 years agoMake treesit-query-validate create a read-only buffer
Jostein Kjønigsen [Mon, 12 Dec 2022 07:42:33 +0000 (08:42 +0100)]
Make treesit-query-validate create a read-only buffer

* lisp/treesit.el: use view-mode for generated validation buffer.

2 years agoImprove dockerfile-ts-mode imenu generation (Bug#59979)
Randy Taylor [Mon, 12 Dec 2022 01:50:54 +0000 (20:50 -0500)]
Improve dockerfile-ts-mode imenu generation (Bug#59979)

* lisp/progmodes/dockerfile-ts-mode.el (treesit-node-child-by-field-name):
Declare.
(dockerfile-ts-mode--imenu-1): Use stage name if available.

2 years agoAdd "->" to python--treesit-operators (bug#59968)
Daniel Martín [Sun, 11 Dec 2022 16:33:13 +0000 (17:33 +0100)]
Add "->" to python--treesit-operators (bug#59968)

* lisp/progmodes/python.el (python--treesit-operators): Add "->", used
to specify the return types of functions in Python.

2 years ago; * admin/notes/tree-sitter/build-module/build.sh: Add -fPIC.
lu4nx [Sun, 11 Dec 2022 15:33:33 +0000 (23:33 +0800)]
; * admin/notes/tree-sitter/build-module/build.sh: Add -fPIC.

(bug#59967)

2 years agoAlign C++ access specifiers to their enclosing class/struct/union
Daniel Martín [Sun, 11 Dec 2022 14:57:43 +0000 (15:57 +0100)]
Align C++ access specifiers to their enclosing class/struct/union

(bug#59966)

The default style in c++-mode aligns access specifiers like "private",
"public" or "protected" to their enclosing class, struct, or union.
The "ellemtel" style indents access specifiers, but this C++ style is
not supported by c++-ts-mode yet.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Align access
specifiers to their enclosing class/struct/union.

2 years agoAdd cmake-ts-mode
Randy Taylor [Sun, 11 Dec 2022 02:40:25 +0000 (21:40 -0500)]
Add cmake-ts-mode

* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add cmake support.
* etc/NEWS: Mention it.
* lisp/progmodes/cmake-ts-mode.el: New major mode with
tree-sitter support.
* lisp/progmodes/eglot.el (eglot-server-programs): Add it.

2 years agoTweak various ts-mode's indent and fontification (bug#59931)
Theodor Thornhill [Fri, 9 Dec 2022 21:36:03 +0000 (22:36 +0100)]
Tweak various ts-mode's indent and fontification (bug#59931)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Add raw
string literal font-locking.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add
text_block indent rule.
(java-ts-mode--font-lock-settings): Add text_block font-locking.
* lisp/progmodes/js.el (js-ts-mode): Prefer top-level navigation.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--font-lock-settings):
Add comment feature.
(json-ts-mode): Use comment feature.
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode):
Prefer top-level navigation.

2 years agoAdd expression for generic_name in csharp-ts-mode (bug#59897)
Theodor Thornhill [Thu, 8 Dec 2022 10:08:28 +0000 (11:08 +0100)]
Add expression for generic_name in csharp-ts-mode (bug#59897)

Given the below example, we want 'services' to be font-locked in
'font-lock-variable-name-face' in all cases.  Previously this only
worked in the first case, and the other was font-locked as
'font-lock-function-name-face'.

namespace Foo {
    void Foo() {
        services.Add();
        services.Add<MyType>();
    }
}

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add new query that makes the mentioned example work.

2 years ago; Adjust eglot test to recent autopep8/pycodestyle
Stefan Kangas [Mon, 12 Dec 2022 21:44:55 +0000 (22:44 +0100)]
; Adjust eglot test to recent autopep8/pycodestyle

* test/lisp/progmodes/eglot-tests.el (python-autopep-formatting):
Support more recent autopep8/pycodestyle.

2 years ago; Avoid compilation warning on MS-Windows
Eli Zaretskii [Mon, 12 Dec 2022 18:01:23 +0000 (20:01 +0200)]
; Avoid compilation warning on MS-Windows

* src/timefns.c (sys_clock): Declare, to avoid compilation
warning.

2 years ago* lisp/outline.el: Fix the value 'insert' of outline-minor-mode-use-buttons.
Juri Linkov [Mon, 12 Dec 2022 17:37:02 +0000 (19:37 +0200)]
* lisp/outline.el: Fix the value 'insert' of outline-minor-mode-use-buttons.

(outline--insert-button): Keep text properties around point
on the inserted whitespace placeholder.

* lisp/apropos.el (apropos-mode):
* lisp/progmodes/xref.el (xref--xref-buffer-mode):
Change outline-minor-mode-use-buttons from t to 'insert'.

2 years ago* lisp/minibuffer.el (completions-group-separator): Revert f7816c94b6.
Juri Linkov [Mon, 12 Dec 2022 17:30:55 +0000 (19:30 +0200)]
* lisp/minibuffer.el (completions-group-separator): Revert f7816c94b6.

Change face attribute from :underline back to :strike-through.
https://lists.gnu.org/archive/html/emacs-devel/2022-10/msg01792.html

2 years ago; Skip two eglot tests when typescript is missing
Stefan Kangas [Mon, 12 Dec 2022 10:50:38 +0000 (11:50 +0100)]
; Skip two eglot tests when typescript is missing

* test/lisp/progmodes/eglot-tests.el
(javascript-basic, project-wide-diagnostics-typescript): Skip tests
when the npm package "typescript" is not installed.

2 years ago; Remove outdated text describing overlays
Eli Zaretskii [Mon, 12 Dec 2022 13:37:49 +0000 (15:37 +0200)]
; Remove outdated text describing overlays

* doc/lispref/display.texi (Overlays): Remove outdated text.
(Bug#59996)

2 years agoSkip Eglot rust-analyzer tests if 'cargo' isn't available
João Távora [Mon, 12 Dec 2022 09:39:32 +0000 (09:39 +0000)]
Skip Eglot rust-analyzer tests if 'cargo' isn't available

* test/lisp/progmodes/eglot-tests.el
(project-wide-diagnostics-rust-analyzer)
(diagnostic-tags-unnecessary-code): Skip unless "cargo" is found.