1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

163708 commits

Author SHA1 Message Date
Mattias Engdegård
931d97bf56 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.
2022-12-14 12:16:28 +01:00
Michael Albinus
be165f7533 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.
2022-12-14 10:52:04 +01:00
Juri Linkov
8c30cb90ba * lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-temp-file (bug#60011) 2022-12-14 10:05:55 +02:00
Stefan Kangas
3efe4df1d2 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.
2022-12-14 08:21:34 +01:00
Stefan Kangas
33e0a10464 ; * lisp/keymap.el (keymap-substitute): Doc fix. (Bug#60059)
(cherry picked from commit 1568123196)
2022-12-14 06:39:40 +01:00
Kai Ma
fafcf02c85
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
2022-12-13 18:05:48 -08:00
Yuan Fu
91b8d9b7db
; * admin/notes/tree-sitter/build-module/build.sh: Minor name change. 2022-12-13 18:04:32 -08:00
Yuan Fu
1b0e282a7f
; Comment and stylistic change in treesit.el
* lisp/treesit.el (treesit-defun-skipper): Docstring change.
(treesit--navigate-defun): Comment and stylistic change.
2022-12-13 18:04:32 -08:00
Stefan Kangas
489b02d03c * doc/misc/Makefile.in (need_emacsver): Add use-package. 2022-12-14 00:36:30 +01:00
Stefan Kangas
cd5856e403 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)
2022-12-13 23:32:21 +01:00
Michael Albinus
ba4bdd6a25 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.
2022-12-13 20:06:48 +01:00
Stefan Kangas
1d5c35c8e4 * lisp/textmodes/texinfo.el (texinfo-flymake): Improve docstring. 2022-12-13 18:59:07 +01:00
Juri Linkov
a99d0e7e6c 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.
2022-12-13 19:48:45 +02:00
Stefan Kangas
def51dd645 ; Fix typos 2022-12-13 18:44:41 +01:00
Augusto Stoffel
4980ed7a6d 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.
2022-12-13 19:37:57 +02:00
Eli Zaretskii
4ef8b9f544 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)
2022-12-13 17:35:17 +02:00
Eli Zaretskii
c4b8bc90a8 ; Fix typos in doc strings
* lisp/treesit.el (treesit-defun-tactic)
(treesit-default-defun-skipper): Fix typos in doc strings.
2022-12-13 16:01:13 +02:00
Juanma Barranquero
c45eb13845 ; * lisp/bs.el (bs-attributes-list): Doc fix 2022-12-13 14:45:58 +01:00
Stefan Kangas
d6adaf487d Add lexical-binding to example package header
* doc/lispref/package.texi (Simple Packages): Add lexical-binding
cookie to example package header.
2022-12-13 07:27:53 +01:00
Yuan Fu
03ad1a92a2
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.
2022-12-12 21:17:40 -08:00
Yuan Fu
a5272e2a7c
; * test/src/treesit-tests.el: Add outline headers. 2022-12-12 21:12:21 -08:00
Stefan Kangas
489bcacc7c 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)
2022-12-13 01:46:44 +01:00
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
lu4nx
5d4274d9b6
; * admin/notes/tree-sitter/build-module/build.sh: Add -fPIC.
(bug#59967)
2022-12-12 15:08:54 -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
Stefan Kangas
5b178efd85 ; Adjust eglot test to recent autopep8/pycodestyle
* test/lisp/progmodes/eglot-tests.el (python-autopep-formatting):
Support more recent autopep8/pycodestyle.
2022-12-12 22:44:55 +01:00
Eli Zaretskii
58b8ed8b55 ; Avoid compilation warning on MS-Windows
* src/timefns.c (sys_clock): Declare, to avoid compilation
warning.
2022-12-12 20:01:23 +02: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
Stefan Kangas
42d740fb2c ; 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.
2022-12-12 17:54:18 +01:00
Eli Zaretskii
19ef86f775 ; Remove outdated text describing overlays
* doc/lispref/display.texi (Overlays): Remove outdated text.
(Bug#59996)
2022-12-12 15:37:49 +02:00
João Távora
081bf58300 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.
2022-12-12 09:53:10 +00:00
Stefan Kangas
06ef030f93 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.
2022-12-12 08:45:40 +01:00
Po Lu
f4ce6fa7d3 Revert "Revert "Improve last change to xfaces.c" (05ece1eb8b)"
This reverts commit b8d2ec920f.

Not only does it make debugging Emacs harder for users, that change is
unsafe for the Haiku port.
2022-12-12 10:41:38 +08:00
Gregory Heytings
b8d2ec920f Revert "Improve last change to xfaces.c" (05ece1eb8b)
* src/xfaces.c: Revert 05ece1eb8b.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59347#331.
2022-12-12 02:12:09 +01: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
9c0d7bb73b 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.
2022-12-11 23:21:40 +00: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