]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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.

2 years agouse-package.texi: New section "Manual installation"
Stefan Kangas [Mon, 12 Dec 2022 07:45:40 +0000 (08:45 +0100)]
use-package.texi: New section "Manual installation"

* doc/misc/use-package.texi (Manual installation): New section.
(Load path, Manual autoloads): Make into subsections of above new
section.

2 years agoRevert "Revert "Improve last change to xfaces.c" (05ece1eb8b)"
Po Lu [Mon, 12 Dec 2022 02:41:38 +0000 (10:41 +0800)]
Revert "Revert "Improve last change to xfaces.c" (05ece1eb8b)"

This reverts commit b8d2ec920f37f5d77d32440eefc97dd5e8c2c7dc.

Not only does it make debugging Emacs harder for users, that change is
unsafe for the Haiku port.

2 years agoRevert "Improve last change to xfaces.c" (05ece1eb8b)
Gregory Heytings [Mon, 12 Dec 2022 01:12:09 +0000 (02:12 +0100)]
Revert "Improve last change to xfaces.c" (05ece1eb8b)

* src/xfaces.c: Revert 05ece1eb8b.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59347#331.

2 years agoDo not pare arguments unnecessarily.
Gregory Heytings [Sat, 10 Dec 2022 21:40:31 +0000 (21:40 +0000)]
Do not pare arguments unnecessarily.

* lisp/pcomplete.el (pcomplete-here-using-help): Do not pare
arguments.  Fixes bug#59803.

2 years agoAdd automated tests for Eglot
João Távora [Sun, 11 Dec 2022 18:10:43 +0000 (18:10 +0000)]
Add automated tests for Eglot

Most of the tests require a specific LSP server to do their thing, and
skip themselves if this server isn't found.

This file is a modified/overhauled version of the original Eglot
automated tests that were developed in the old GitHub upstream.

* test/lisp/progmodes/eglot-tests.el: New file.

2 years agoEglot: allow skipping compile-time warnings about LSP interfaces
João Távora [Sun, 11 Dec 2022 23:16:58 +0000 (23:16 +0000)]
Eglot: allow skipping compile-time warnings about LSP interfaces

* lisp/progmodes/eglot.el (eglot-strict-mode): Add 'no-unknown-interfaces'.
(eglot--check-object): Honour new eglot-strict-mode value.

2 years ago; project.el: Bump version.
Dmitry Gutov [Sun, 11 Dec 2022 23:14:14 +0000 (01:14 +0200)]
; project.el: Bump version.

2 years agoAdd customizale faces for tree-sitter explorer
Yuan Fu [Sun, 11 Dec 2022 22:43:58 +0000 (14:43 -0800)]
Add customizale faces for tree-sitter explorer

* lisp/treesit.el (treesit-explorer-anonymous-node)
(treesit-explorer-field-name): New face.
(treesit--explorer-draw-node): Use the new faces.
(treesit-explore-mode): Change playground to explorer.

2 years agoFix error message when installing non-existent package
Stefan Kangas [Sun, 11 Dec 2022 18:00:01 +0000 (19:00 +0100)]
Fix error message when installing non-existent package

* lisp/emacs-lisp/package.el (package-compute-transaction): Don't add
trailing dash to package name in non-existent package
error.  (Bug#59923)

2 years agoDon't use diff-mode buffer as a patch when it's visiting a file (bug#59962)
Juri Linkov [Sun, 11 Dec 2022 17:24:34 +0000 (19:24 +0200)]
Don't use diff-mode buffer as a patch when it's visiting a file (bug#59962)

* lisp/vc/vc.el (vc-deduce-fileset-1): Don't call diff-vc-deduce-fileset
for diff-mode when buffer-file-name is non-nil.  This is because in this case
a file with a diff might be committed to VCS.  So don't use it as a patch
to commit with 'C-x v v'.

2 years agoFix pcase rx patterns using rx-let bindings (bug#59814)
Mattias Engdegård [Sun, 4 Dec 2022 14:20:49 +0000 (15:20 +0100)]
Fix pcase rx patterns using rx-let bindings (bug#59814)

Reported by Daniel Pittman.

* lisp/emacs-lisp/rx.el (rx): Move binding of rx--local-definitions...
(rx--to-expr): ...here.
* test/lisp/emacs-lisp/rx-tests.el (rx-let-pcase): New test.

2 years agoFix use-package-defaults defcustom type (bug#59941)
Mattias Engdegård [Sun, 11 Dec 2022 15:26:50 +0000 (16:26 +0100)]
Fix use-package-defaults defcustom type (bug#59941)

* lisp/use-package/use-package-core.el (use-package-defaults):
Enlarge type to allow for keywords such as :ensure and :pin to be
added later, remedying a failure in test-custom-opts.

2 years ago; * lisp/use-package/bind-key.el: Remove ineffective backslashes.
Mattias Engdegård [Sat, 10 Dec 2022 13:13:39 +0000 (14:13 +0100)]
; * lisp/use-package/bind-key.el: Remove ineffective backslashes.

2 years ago; * lisp/progmodes/dockerfile-ts-mode.el: use \' instead of $
Mattias Engdegård [Sat, 10 Dec 2022 13:11:34 +0000 (14:11 +0100)]
; * lisp/progmodes/dockerfile-ts-mode.el: use \' instead of $

2 years ago* lisp/language/indian.el: Improve Brahmi composition rules. (bug#58957)
समीर सिंह Sameer Singh [Wed, 2 Nov 2022 02:35:44 +0000 (08:05 +0530)]
* lisp/language/indian.el: Improve Brahmi composition rules. (bug#58957)

2 years ago; Minor cleanup of last change in xfaces.c.
Eli Zaretskii [Sun, 11 Dec 2022 09:59:04 +0000 (11:59 +0200)]
; Minor cleanup of last change in xfaces.c.

2 years ago; Improve docs of relaxing face-font attribute match (bug#59347)
Eli Zaretskii [Sun, 11 Dec 2022 09:49:29 +0000 (11:49 +0200)]
; Improve docs of relaxing face-font attribute match (bug#59347)

* src/xfaces.c (realize_gui_face): Fix typo and coding style.
(syms_of_xfaces) <face-font-lax-matched-attributes>: A better name.

2 years ago; * doc/misc/use-package.texi: Prepare for GNU ELPA.
Stefan Kangas [Sun, 11 Dec 2022 00:43:25 +0000 (01:43 +0100)]
; * doc/misc/use-package.texi: Prepare for GNU ELPA.