1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-18 18:05:07 +00:00
Commit Graph

163891 Commits

Author SHA1 Message Date
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
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
Eli Zaretskii
78ad33bb05 ; Minor cleanup of last change in xfaces.c. 2022-12-11 11:59:04 +02:00
Eli Zaretskii
2024ade271 ; 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.
2022-12-11 11:49:29 +02:00
Stefan Kangas
f221105723 ; * doc/misc/use-package.texi: Prepare for GNU ELPA. 2022-12-11 03:14:11 +01: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
Po Lu
05ece1eb8b Improve last change to xfaces.c
* src/xfaces.c (font_unset_attribute): New function.
(realize_gui_face): Improve commentary and use list instead of
bitmask.
(syms_of_xfaces): Get rid of bitmask.  Replace it by a list,
there is no reason any user should have to think about bitmasks
in Emacs lisp.
2022-12-11 09:32:47 +08:00
Stefan Kangas
7013b0179c ; Auto-commit of loaddefs files. 2022-12-11 02:15:56 +01:00
Gregory Heytings
79659416f9 ; * admin/git-bisect-start: Fix commit hash 2022-12-11 00:35:26 +01:00
Stefan Kangas
a9037aa8e8 ; Fix use-package-ensure-system-package macOS footnote
* doc/misc/use-package.texi (use-package-ensure-system-package): Fix
macOS footnote.
2022-12-11 00:31:40 +01:00
Gregory Heytings
7d787564c0 Actually improve detection of long lines
* src/xdisp.c (redisplay_window): Update condition.

* src/xdisp.c (mark_window_display_accurate_1):
* src/pdumper.c (dump_buffer):
* src/buffer.h (BUF_CHARS_UNCHANGED_MODIFIED):
(struct buffer_text):
* src/buffer.c (Fget_buffer_create):
Revert 1c837c42c2, which was misguided.
2022-12-11 00:16:27 +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
Gregory Heytings
30e3cb2135 Unset the weight/slant/width in the spec when realizing a font
Between commits bf0d3f76dc (2014) and 6b1ed2f2c9 (2022),
realize_gui_face called font_load_for_lface with an empty or
partly emptied font spec, i.e. it ignored a part of its attrs
argument.  The rationale given in bug#17973, which led to
bf0d3f76dc, is not clear.  However, 6b1ed2f2c9, which passes
the full font spec to font_load_for_lface and
font_find_for_lface, leads to suboptimal font choices, for
example when the font chosen for the default face has a
weight, slant or width that is not supported by other
available fonts on the system, such as 'medium' or 'heavy'.

If these attributes are not unset here, the call to
font_list_entities in font_find_for_lface arbitrarily limits
the candidate font list to those that are perfect matches for
these attributes, which means that the scoring mechanism is
bypassed.  Note that the size attribute in spec is also unset,
in font_find_for_lface.

Also allow unsetting the other attributes, for debugging purposes.

* src/xfaces.c (realize_gui_face): Unset the weight, slant and
width of the font spec.  Fixes bug#57555 and bug#59347.
(syms_of_xfaces): New variable
'realize-gui-face-ignored-spec-attributes'.
2022-12-10 23:46:16 +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
Stefan Kangas
29b9aeae32 ; * doc/misc/use-package.texi: Fix misplaced @end group. 2022-12-10 21:25:04 +01:00