Commit graph

89492 commits

Author SHA1 Message Date
Jostein Kjønigsen
0f9e6532b1
Use font-lock-number-face for numeric values in csharp-mode
(bug#60004)

* lisp/progmodes/csharp-mode.el: update fontification code.
2022-12-12 15:08:55 -08:00
Jostein Kjønigsen
4bccb7b211
Make treesit-query-validate create a read-only buffer
* lisp/treesit.el: use view-mode for generated validation buffer.
2022-12-12 15:08:55 -08:00
Randy Taylor
c0fe6c72ce
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.
2022-12-12 15:08:55 -08:00
Daniel Martín
631908f701
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.
2022-12-12 15:08:55 -08:00
Daniel Martín
d264b75669
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.
2022-12-12 15:08:54 -08:00
Randy Taylor
ca67d988d8
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.
2022-12-12 15:08:54 -08:00
Theodor Thornhill
8ec923775d
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.
2022-12-12 15:08:54 -08:00
Theodor Thornhill
647b6a8099
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.
2022-12-12 15:08:54 -08:00
Juri Linkov
40c23c11e8 * 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'.
2022-12-12 19:37:02 +02:00
Juri Linkov
527eb11de2 * 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
2022-12-12 19:30:55 +02:00
Gregory Heytings
24c8c28ae6 Do not pare arguments unnecessarily.
* lisp/pcomplete.el (pcomplete-here-using-help): Do not pare
arguments.  Fixes bug#59803.
2022-12-12 02:02:36 +01:00
João Távora
d3669cfe15 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.
2022-12-11 23:21:40 +00:00
Dmitry Gutov
04b7e01885 ; project.el: Bump version. 2022-12-12 01:14:14 +02:00
Yuan Fu
f2876014ad
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.
2022-12-11 14:51:33 -08:00
Stefan Kangas
3e349ee119 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)
2022-12-11 19:02:44 +01:00
Juri Linkov
733cdeabfb 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'.
2022-12-11 19:24:34 +02:00
Mattias Engdegård
87475f4af2 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.
2022-12-11 16:49:06 +01:00
Mattias Engdegård
4893a15631 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.
2022-12-11 16:48:41 +01:00
Mattias Engdegård
074b7e6f4d ; * lisp/use-package/bind-key.el: Remove ineffective backslashes. 2022-12-11 12:09:42 +01:00
Mattias Engdegård
864ed9dfa1 ; * lisp/progmodes/dockerfile-ts-mode.el: use \' instead of $ 2022-12-11 12:09:42 +01:00
समीर सिंह Sameer Singh
9f7e5584a4 * lisp/language/indian.el: Improve Brahmi composition rules. (bug#58957) 2022-12-11 12:35:49 +02:00
Stefan Kangas
80122cde3d ; Unbreak bootstrap
* lisp/progmodes/dockerfile-ts-mode.el (auto-mode-alist): Wrap
autoloaded definition using the rx macro in eval-and-compile.
2022-12-11 02:55:59 +01:00
Stefan Kangas
7013b0179c ; Auto-commit of loaddefs files. 2022-12-11 02:15:56 +01:00
Stefan Kangas
118465f6fe ; Improve checkdoc.el commentary section
* lisp/emacs-lisp/checkdoc.el: Improve wording of Commentary.
(checkdoc): Link commentary from defgroup.
2022-12-10 23:55:00 +01:00
Kyle Meyer
0115416605 Update to Org 9.6-31-g954a95 2022-12-10 16:59:46 -05:00
Juanma Barranquero
26a8644a58 ; tabulated-list.el: Remove duplicate obsolete declaration
* lisp/emacs-lisp/tabulated-list.el
(tabulated-list-line-number-width): Remove second
`define-obsolete-function-alias' for the same function.
2022-12-10 21:31:59 +01:00
Eli Zaretskii
1753da24cd Fix infloop in 'shell-resync-dirs' with tcsh
* lisp/shell.el (shell-resync-dirs): Remove trailing slash from
output of 'dirs', for csh/tcsh's sake.  (Bug#59804)
2022-12-10 14:55:01 +02:00
Stefan Kangas
44c5f36149 ; Fix two byte-compiler warnings
* lisp/gnus/gnus-icalendar.el (gnus-icalendar--show-org-event):
* test/lisp/progmodes/project-tests.el (project/quoted-directory):
Fix warnings.
2022-12-10 10:48:28 +01:00
Philip Kaludercic
a8ee046fb5 Ensure 'package-vc--version' always returns a version
* lisp/emacs-lisp/package-vc.el (package-vc--version): Return "0" even
if the main file exists, but lacks version headers.
2022-12-10 09:48:02 +01:00
Philip Kaludercic
022ab1061b Ensure 'package-vc--main-file' always returns an existing file
* lisp/emacs-lisp/package-vc.el (require): Explicitly require cl-lib.
(package-vc--main-file): If the expected file name is missing, try and
find the closest match.
2022-12-10 09:48:02 +01:00
Philip Kaludercic
357fe91996 Check if package already exists before installing from checkout
* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Copy check from 'package-vc--unpack'.
2022-12-10 09:48:02 +01:00
Philip Kaludercic
5e8bc79f6b ; Fix reference in docstring to 'package-vc-install-from-checkout'
* lisp/emacs-lisp/package-vc.el (package-vc-checkout): Fix reference.
2022-12-10 09:48:02 +01:00
Matt Armstrong
af88b00b19 Refresh the package quickstart file in package-vc
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Call
`package--quickstart-maybe-refresh', just as
`package-install-from-buffer' does.  (bug#59728)
2022-12-10 09:48:02 +01:00
Brian Leung
8f53fa10d9
Fontify "this" as a keyword in c++-ts-mode (bug#59924)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Following c++-mode, fontify as a keyword instead of a constant.
2022-12-09 16:46:01 -08:00
Theodor Thornhill
8de8f1dc05
Add class_body indentation for typescript (bug#59680)
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): New indent rule.
2022-12-09 16:46:01 -08:00
Theodor Thornhill
839341d737
Make more granular defun-type-regexp (bug#59873)
We don't want to match local_variable_declaration and others to hit on
beginning-of-defun.  The fix is just to make the regexp a bit more
granular.

* lisp/progmodes/java-ts-mode.el (java-ts-mode): Use regexp-opt to
distinguish more granularly.
2022-12-09 16:46:01 -08:00
Randy Taylor
8f49137c9b
Add dockerfile-ts-mode (Bug#59894)
* admin/notes/tree-sitter/build-module/batch.sh: Add dockerfile support.
* admin/notes/tree-sitter/build-module/build.sh: Support different
namespaces and add dockerfile support.
* etc/NEWS: Mention it.
* lisp/progmodes/dockerfile-ts-mode.el: New major mode with
tree-sitter support.
* lisp/progmodes/eglot.el (eglot-server-programs): Add it.
2022-12-09 16:46:01 -08:00
Jostein Kjønigsen
1014bcc8e3
Fix fontification of method-invocations in js-ts-mode (bug#59904)
* lisp/progmodes/js.el (js--treesit-font-lock-settings): Move rules
for property in front of function names, so function names override
property.
2022-12-09 16:46:00 -08:00
Theodor Thornhill
7141920c6a
Fix escape-sequence feature in typescript-ts-mode (bug#59906)
* lisp/progmodes/typescript-ts-mode.el: (typescript-ts-mode,
tsx-ts-mode): Use escape-sequence feature.
2022-12-09 16:46:00 -08:00
Jostein Kjønigsen
4df35e3491
Improve fontification in csharp-ts-mode (bug#59909)
- Fontity escape sequences.
- Highlight syntax errors.

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings)
(csharp-ts-mode): Add new features
2022-12-09 16:46:00 -08:00
Dmitry Gutov
33a8415eb7 Use 'project--value-in-dir' for 'project-vc-include-untracked' too
* lisp/progmodes/project.el (project--vc-list-files): Use
'project--value-in-dir' for 'project-vc-include-untracked' too.
So that is can be reliably set through dir-locals.
2022-12-09 23:21:28 +02:00
Eli Zaretskii
594267395d Update Turkish Hello
* etc/HELLO (Turkish):
* lisp/language/european.el ("Turkish"): Add a Turkish Hello.
Suggested by YUSUF ALPER ÇIKIŞIR <yusufcikisir@std.iyte.edu.tr>.
2022-12-09 22:02:03 +02:00
Dmitry Gutov
d268ab1c5d Bring back the project--value-in-dir logic
Essentialy revert commit 2389158a31, restoring the changes
and fixing the conflicts.  Motivated by the problem brought up in
bug#59722 (behavior of project-find-files/regexp when switching
projects).  We should find other ways to improve performance.

* lisp/progmodes/project.el
(project--value-in-dir, project--vc-merge-submodules-p): Restore.
(project-try-vc, project-files, project--vc-list-files)
(project-ignores, project-buffers): Use.

* test/lisp/progmodes/project-tests.el
(project-vc-supports-project-in-different-dir): New test.

* test/lisp/progmodes/project-resources/.dir-locals.el:
* test/lisp/progmodes/project-resources/foo:
* test/lisp/progmodes/project-resources/etc: New files.
2022-12-09 18:19:36 +02:00
Michael Albinus
5fbd12ff49 Adapt manual names in emacs-news-mode
* lisp/textmodes/emacs-news-mode.el (emacs-news--buttonize):
Allow hyphen in manual names.
2022-12-09 15:53:00 +01:00
F. Jason Park
56a6712bd6 ; * lisp/erc/erc.el (erc-default-target): Fix comment. 2022-12-09 06:35:36 -08:00
F. Jason Park
dcf69a1da4 Respect some spaces in auth-source-pass--match-regexp
* lisp/auth-source-pass.el (auth-source-pass--match-regexp): Allow an
entry's host and user fields to contain spaces, just like other
backends do.
* lisp/erc/erc-compat.el
(erc-compat--29-auth-source-pass--retrieve-parsed): Change regexp to
allow spaces in host and user components of file names.
* test/lisp/auth-source-pass-tests.el (auth-source-pass-any-host):
Silence warning message re wildcards emitted by
`auth-source-pass-search'.
(auth-source-pass-extra-query-keywords--suffixed-user): Add spaces
to users and hosts of some example entries.  (Bug#58985.)
2022-12-09 06:35:36 -08:00
Stefan Kangas
801c1c22de ; Prefer HTTPS to HTTP in some URLs 2022-12-09 15:31:41 +01:00
dannyfreeman
74a009dd96 Eglot: Handle LSP progress with Emacs progress reporters (bug#59149)
Co-authored-by: João Távora <joaotavora@gmail.com>

* lisp/progmodes/eglot.el (eglot-report-progress): New custom variable.
(eglot-lsp-server): New slot for tracking active progress reporters.
(eglot-handle-notification (eql $/progress)): New method.

The LSP spec describes methods for reporting progress on long running
jobs to the client:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgress

This change reports those notifications in the minibuffer as they come
in.  It shows a percent indicator (if the server provides theme), or a
spinner.

This change could open the door for writing a "cancel long running
request" command, which are identified by these progress
notifications.  See
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_workDoneProgress_cancel

* doc/misc/eglot.texi (Customizing Eglot): Describe new variable.
2022-12-09 13:03:57 +00:00
dannyfreeman
0cfeb1c2bc Eglot: cleanup whitespace and indentation
Co-authored-by: João Távora <joaotavora@gmail.com>

* lisp/progmodes/eglot: Misc whitespace fixes.
2022-12-09 13:03:27 +00:00
Stefan Kangas
c2aea9d132 ; Mention flush-lines in kill-matching-lines docstring
* lisp/replace.el (kill-matching-lines): Add cross-reference to
flush-lines.
2022-12-09 11:05:34 +01:00