]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoMake indirect buffers use tree-sitter parsers of their base buffer
Yuan Fu [Wed, 7 Dec 2022 22:50:16 +0000 (14:50 -0800)]
Make indirect buffers use tree-sitter parsers of their base buffer

Fix the problem described in bug#59693.

* src/treesit.c (treesit_record_change): Always use the base buffer.
(Ftreesit_parser_create): Always use the base buffer.  Also change the
for loop into FOR_EACH_TAIL (stylistic change).
(Ftreesit_parser_list): Always use the base buffer.

* doc/lispref/parsing.texi (Using Parser): Update manual.
* test/src/treesit-tests.el (treesit-indirect-buffer): New test.

2 years agoFontify "this" as a keyword in c++-ts-mode (bug#59924)
Brian Leung [Fri, 9 Dec 2022 11:09:31 +0000 (03:09 -0800)]
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.

2 years agoAdd class_body indentation for typescript (bug#59680)
Theodor Thornhill [Tue, 29 Nov 2022 15:12:18 +0000 (16:12 +0100)]
Add class_body indentation for typescript (bug#59680)

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

2 years agoMake more granular defun-type-regexp (bug#59873)
Theodor Thornhill [Wed, 7 Dec 2022 09:07:37 +0000 (10:07 +0100)]
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.

2 years agoAdd dockerfile-ts-mode (Bug#59894)
Randy Taylor [Thu, 8 Dec 2022 01:53:35 +0000 (20:53 -0500)]
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.

2 years agoFix fontification of method-invocations in js-ts-mode (bug#59904)
Jostein Kjønigsen [Thu, 8 Dec 2022 14:45:00 +0000 (15:45 +0100)]
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.

2 years agoFix escape-sequence feature in typescript-ts-mode (bug#59906)
Theodor Thornhill [Thu, 8 Dec 2022 15:17:49 +0000 (16:17 +0100)]
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.

2 years agoImprove fontification in csharp-ts-mode (bug#59909)
Jostein Kjønigsen [Thu, 8 Dec 2022 19:36:49 +0000 (20:36 +0100)]
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

2 years agoUse 'project--value-in-dir' for 'project-vc-include-untracked' too
Dmitry Gutov [Fri, 9 Dec 2022 21:21:10 +0000 (23:21 +0200)]
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.

2 years agoUpdate Turkish Hello
Eli Zaretskii [Fri, 9 Dec 2022 20:02:03 +0000 (22:02 +0200)]
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>.

2 years agoSupport newer glib versions (Bug#59061)
Philipp Stephani [Fri, 9 Dec 2022 18:32:14 +0000 (19:32 +0100)]
Support newer glib versions (Bug#59061)

* lib-src/seccomp-filter.c (main): Allow pidfd_open system call

2 years ago; * doc/misc/use-package.texi: Fix @file.
Eli Zaretskii [Fri, 9 Dec 2022 16:21:38 +0000 (18:21 +0200)]
; * doc/misc/use-package.texi: Fix @file.

2 years agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Fri, 9 Dec 2022 16:21:31 +0000 (18:21 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

2 years ago; * doc/misc/use-package.texi: Fix @acronym.
Eli Zaretskii [Fri, 9 Dec 2022 16:20:04 +0000 (18:20 +0200)]
; * doc/misc/use-package.texi: Fix @acronym.

2 years agoBring back the project--value-in-dir logic
Dmitry Gutov [Fri, 9 Dec 2022 16:15:49 +0000 (18:15 +0200)]
Bring back the project--value-in-dir logic

Essentialy revert commit 2389158a31b4a12, 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.

2 years agoBackport: Enable native speed 2 EMBA build and tests and disable speed 0
Andrea Corallo [Thu, 8 Dec 2022 15:40:54 +0000 (16:40 +0100)]
Backport: Enable native speed 2 EMBA build and tests and disable speed 0

* test/infra/gitlab-ci.yml (build-native-comp-speed2): Uncomment.
(build-native-comp-speed0): Comment.
(test-native-comp-speed0): Remove.
(test-native-comp-speed2): Add.

(cherry picked from commit 06bf218f69a62d5d5c8d3b3767d7db8d9fb4bb9f)

2 years ago* test/infra/test-jobs.yml: Regenerate for the new use-package subdirectory.
Michael Albinus [Fri, 9 Dec 2022 14:53:49 +0000 (15:53 +0100)]
* test/infra/test-jobs.yml: Regenerate for the new use-package subdirectory.

2 years agoAdapt manual names in emacs-news-mode
Michael Albinus [Fri, 9 Dec 2022 14:53:00 +0000 (15:53 +0100)]
Adapt manual names in emacs-news-mode

* lisp/textmodes/emacs-news-mode.el (emacs-news--buttonize):
Allow hyphen in manual names.

2 years ago; * etc/NEWS: Fix typos.
Michael Albinus [Fri, 9 Dec 2022 14:51:48 +0000 (15:51 +0100)]
; * etc/NEWS: Fix typos.

2 years ago; * doc/misc/use-package.texi: Fix indexing.
Eli Zaretskii [Fri, 9 Dec 2022 14:50:13 +0000 (16:50 +0200)]
; * doc/misc/use-package.texi: Fix indexing.

2 years ago; * lisp/erc/erc.el (erc-default-target): Fix comment.
F. Jason Park [Fri, 9 Dec 2022 14:26:13 +0000 (06:26 -0800)]
; * lisp/erc/erc.el (erc-default-target): Fix comment.

2 years agoRespect some spaces in auth-source-pass--match-regexp
F. Jason Park [Fri, 25 Nov 2022 05:03:03 +0000 (21:03 -0800)]
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.)

2 years ago; Improve the use-package manual
Eli Zaretskii [Fri, 9 Dec 2022 14:32:59 +0000 (16:32 +0200)]
; Improve the use-package manual

* doc/misc/use-package.texi (Top, Basic Concepts)
(Getting Started, Loading Packages, Loading basics)
(Deferring loading, Forcing loading, Conditional loading)
(Loading sequentially, Load dependencies, Load path)
(Manual autoloads, Configuring Packages, Lisp Configuration)
(Preface keyword, Init keyword, Best practices, Key bindings)
(Global keybindings, Binding in keymaps, Binding to a keymap)
(Binding to repeat-maps, Displaying keybindings)
(Modes and interpreters, Magic handlers, User options, Faces)
(Delight, Diminish, Install package, Pinning packages)
(Other package managers, Byte-compiling, Troubleshooting)
(Troubleshooting Options, Gathering Statistics)
(Disabling a package, Keyword extensions)
(use-package-ensure-system-package, Creating an extension): Fix
wording, punctuation, typos, and markup; add indexing.  Add
@group..@end group in code examples.

2 years ago; Prefer HTTPS to HTTP in some URLs
Stefan Kangas [Fri, 9 Dec 2022 14:31:41 +0000 (15:31 +0100)]
; Prefer HTTPS to HTTP in some URLs

2 years agoEglot: Handle LSP progress with Emacs progress reporters (bug#59149)
dannyfreeman [Fri, 9 Dec 2022 12:49:26 +0000 (12:49 +0000)]
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.

2 years agoEglot: cleanup whitespace and indentation
dannyfreeman [Fri, 9 Dec 2022 11:40:53 +0000 (11:40 +0000)]
Eglot: cleanup whitespace and indentation

Co-authored-by: João Távora <joaotavora@gmail.com>
* lisp/progmodes/eglot: Misc whitespace fixes.

2 years agoBetter test-custom-opts diagnostics
Mattias Engdegård [Fri, 9 Dec 2022 11:04:01 +0000 (12:04 +0100)]
Better test-custom-opts diagnostics

Make it easier to understand errors from the test-custom-opts test by
reporting variable values and types that didn't match.

* admin/cus-test.el (cus-test-errors): Richer contents.
(cus-test--format-error): New.
(cus-test-apropos, cus-test-errors-display, cus-test-opts):
Use new format.

2 years ago; Fix groff warnings in man pages
Stefan Kangas [Sun, 27 Nov 2022 23:00:11 +0000 (00:00 +0100)]
; Fix groff warnings in man pages

This fixes check-man-pages warnings such as:
troff: doc/man/etags.1:203: warning: escape character ignored before '='

* doc/man/etags.1: Fix groff warnings.

2 years agoNew script admin/check-man-pages
Stefan Kangas [Sun, 27 Nov 2022 17:37:37 +0000 (18:37 +0100)]
New script admin/check-man-pages

* admin/check-man-pages: New file with script used to check man pages
for errors.  (Bug#59631)
* admin/make-tarball.txt: Document when to use the above script.

2 years ago; Mention flush-lines in kill-matching-lines docstring
Stefan Kangas [Fri, 9 Dec 2022 10:05:34 +0000 (11:05 +0100)]
; Mention flush-lines in kill-matching-lines docstring

* lisp/replace.el (kill-matching-lines): Add cross-reference to
flush-lines.

2 years ago; Fix typos
Stefan Kangas [Fri, 9 Dec 2022 09:18:00 +0000 (10:18 +0100)]
; Fix typos

2 years ago; Improve use-package-autoload-keymap docstring
Stefan Kangas [Fri, 9 Dec 2022 05:55:48 +0000 (06:55 +0100)]
; Improve use-package-autoload-keymap docstring

* lisp/use-package/use-package-bind-key.el
(use-package-autoload-keymap): Improve docstring.

2 years agoImprove :delight keyword example in use-package manual
Stefan Kangas [Fri, 9 Dec 2022 05:27:33 +0000 (06:27 +0100)]
Improve :delight keyword example in use-package manual

* use-package.texi (Diminish, Delight): Clarify what happens if the
pre-requisite packages are not installed.  Change an example with
performance issues to one without any.

Resolves https://github.com/jwiegley/use-package/issues/835

2 years ago; Refer to the manual in use-package docstring
Stefan Kangas [Fri, 9 Dec 2022 04:12:51 +0000 (05:12 +0100)]
; Refer to the manual in use-package docstring

* lisp/use-package/use-package-core.el (use-package): Refer to manual.

2 years agoClarify :after keyword in use-package docstring
Stefan Kangas [Fri, 9 Dec 2022 04:12:03 +0000 (05:12 +0100)]
Clarify :after keyword in use-package docstring

* lisp/use-package/use-package-core.el (use-package): Clarify the
effect of :after in docstring.

Resolves https://github.com/jwiegley/use-package/issues/825

2 years agoAdd conditional loading examples to use-package manual
Stefan Kangas [Fri, 9 Dec 2022 03:15:32 +0000 (04:15 +0100)]
Add conditional loading examples to use-package manual

* doc/misc/use-package.texi (Conditional loading): Expand section with
examples.

Resolves https://github.com/jwiegley/use-package/issues/693

2 years agoRevert "; * src/emacs.c (main): Improvements to last change."
Po Lu [Fri, 9 Dec 2022 01:25:42 +0000 (09:25 +0800)]
Revert "; * src/emacs.c (main): Improvements to last change."

This reverts commit c774e83e36784ab96539c5c083b3bcb6d0158a8c.  It
causes crashes on GNU/Linux systems using libgmp, as there a shared
library initializer is used to set the malloc functions on startup, so
they are not dumped.

2 years agoserver-eval-at: Don't call server--file-name
Sean Whitton [Thu, 8 Dec 2022 23:29:44 +0000 (16:29 -0700)]
server-eval-at: Don't call server--file-name

* lisp/server.el (server-eval-at): Revert to old code for determining
the server file.  The recent change to call server--file-name meant
that the SERVER argument to server-eval-at was ignored.

2 years ago; Improve use-package Commentary sections
Stefan Kangas [Thu, 8 Dec 2022 23:24:15 +0000 (00:24 +0100)]
; Improve use-package Commentary sections

* lisp/use-package/bind-key.el:
* lisp/use-package/use-package-bind-key.el:
* lisp/use-package/use-package-core.el:
* lisp/use-package/use-package-ensure-system-package.el:
* lisp/use-package/use-package-ensure.el:
* lisp/use-package/use-package.el: Improve Commentary sections.

2 years ago; Don't say to require bind-key in use-package manual
Stefan Kangas [Thu, 8 Dec 2022 23:18:49 +0000 (00:18 +0100)]
; Don't say to require bind-key in use-package manual

* doc/misc/use-package.texi (Getting Started): Remove instruction to
require 'bind-key'; it is already required by 'use-package' and the
entry points are autoloaded.

2 years ago; Normalize GPLv3 license statements in new files
Stefan Kangas [Thu, 8 Dec 2022 22:56:24 +0000 (23:56 +0100)]
; Normalize GPLv3 license statements in new files

2 years agoMerge branch 'feature/use-package' into emacs-29
Stefan Kangas [Thu, 8 Dec 2022 17:01:30 +0000 (18:01 +0100)]
Merge branch 'feature/use-package' into emacs-29

2 years ago* etc/USE-PACKAGE-NEWS: Delete file. feature/use-package
Stefan Kangas [Thu, 8 Dec 2022 17:00:19 +0000 (18:00 +0100)]
* etc/USE-PACKAGE-NEWS: Delete file.

Ref: https://lists.gnu.org/r/emacs-devel/2022-11/msg01535.html

2 years ago* admin/git-bisect-start: Prune use-package merge commits.
Stefan Kangas [Thu, 8 Dec 2022 16:49:30 +0000 (17:49 +0100)]
* admin/git-bisect-start: Prune use-package merge commits.

2 years ago; Minor doc fixes in bind-key.el
Stefan Kangas [Thu, 8 Dec 2022 16:14:31 +0000 (17:14 +0100)]
; Minor doc fixes in bind-key.el

* lisp/use-package/bind-key.el (bind-key-segregation-regexp)
(bind-key): Minor doc fixes.

2 years agoUpdate use-package defgroups
Stefan Kangas [Thu, 8 Dec 2022 16:10:47 +0000 (17:10 +0100)]
Update use-package defgroups

* lisp/use-package/bind-key.el (bind-key):
* lisp/use-package/use-package-core.el (use-package):
* lisp/use-package/use-package-ensure.el (use-package-ensure): Add
:link, :version and :group to defgroups.

2 years agoDrop key-chord.el support from use-package
Stefan Kangas [Thu, 8 Dec 2022 00:12:02 +0000 (01:12 +0100)]
Drop key-chord.el support from use-package

* lisp/use-package/bind-chord.el:
* lisp/use-package/use-package-chords.el:
* test/lisp/use-package/use-package-chords-tests.el: Delete files.
* doc/misc/use-package.texi (use-package-chords): Delete section.
Ref: https://lists.gnu.org/r/emacs-devel/2022-12/msg00052.html

2 years ago; lisp/progmodes/java-ts-mode.el: Fix more typos.
Stefan Kangas [Thu, 8 Dec 2022 15:51:59 +0000 (16:51 +0100)]
; lisp/progmodes/java-ts-mode.el: Fix more typos.

2 years ago; * lisp/progmodes/java-ts-mode.el (java-ts-mode--keywords): Fix typo.
Eli Zaretskii [Thu, 8 Dec 2022 15:49:55 +0000 (17:49 +0200)]
; * lisp/progmodes/java-ts-mode.el (java-ts-mode--keywords): Fix typo.

2 years agoRemove unneeded (require 'edebug) from which-func.el
Juanma Barranquero [Thu, 8 Dec 2022 12:00:34 +0000 (13:00 +0100)]
Remove unneeded (require 'edebug) from which-func.el

* lisp/progmodes/which-func.el: Don't require edebug.  This is
code from an attempted fix to bug#49592, installed in 55cc8b040b
(2022-08-08) and left behind after 48b0f2606b (2022-08-23).

2 years agoChange use-package custom :group to `initialization`
Stefan Kangas [Thu, 8 Dec 2022 07:48:24 +0000 (08:48 +0100)]
Change use-package custom :group to `initialization`

* lisp/use-package/use-package-core.el (use-package): Move
defgroup to custom :group 'initialization'.

2 years ago; Fix typos
Stefan Kangas [Tue, 6 Dec 2022 15:55:39 +0000 (16:55 +0100)]
; Fix typos

2 years agoTreat escaped newlines in Eshell as the empty string
Jim Porter [Sat, 26 Nov 2022 19:52:18 +0000 (11:52 -0800)]
Treat escaped newlines in Eshell as the empty string

This fixes a regression introduced during Emacs 29's development.

* lisp/eshell/esh-arg.el (eshell-parse-argument): Handle
'eshell-empty-token' as the result of an argument-parsing hook.
(eshell-parse-argument-hook): Document 'eshell-empty-token'.
(eshell-parse-backslash): Return 'eshell-empty-token' when
encountering an escaped newline.

* test/lisp/eshell/eshell-tests.el (eshell-test/escape-nonspecial)
(eshell-test/escape-nonspecial-unicode)
(eshell-test/escape-nonspecial-quoted)
(eshell-test/escape-special-quoted): Move from here...

* test/lisp/eshell/esh-arg-tests.el (esh-arg-test/escape/nonspecial)
(esh-arg-test/escape/nonspecial-unicode)
(esh-arg-test/escape-quoted/nonspecial)
(esh-arg-test/escape-quoted/special): ... to here.
(esh-arg-test/escape/special, esh-arg-test/escape/newline)
(esh-arg-test/escape-quoted/newline): New tests.

* doc/misc/eshell.texi (Arguments): Explain escaping logic in more
detail (bug#59622).

2 years ago; Document use-package-reset-statistics
Stefan Kangas [Thu, 8 Dec 2022 05:36:44 +0000 (06:36 +0100)]
; Document use-package-reset-statistics

* doc/misc/use-package.texi (Gathering Statistics): Document
use-package-reset-statistics.

2 years ago; use-package: Improve :ensure-system-package docstrings
Stefan Kangas [Thu, 8 Dec 2022 05:27:22 +0000 (06:27 +0100)]
; use-package: Improve :ensure-system-package docstrings

* lisp/use-package/use-package-ensure-system-package.el
(use-package-ensure-system-package--custom-packages)
(use-package-ensure-system-package-consify)
(use-package-ensure-system-package-update-custom-packages)
(use-package-normalize/:ensure-system-package)
(use-package-ensure-system-package-exists?): Improve docstrings.

2 years agouse-package: Improve :mode keyword documentation
Stefan Kangas [Thu, 8 Dec 2022 01:25:53 +0000 (02:25 +0100)]
use-package: Improve :mode keyword documentation

* doc/misc/use-package.texi (Modes and interpreters): Improve
section and document the use of a list of regexps.

Resolves https://github.com/jwiegley/use-package/issues/996

2 years agoImprove bind-keys* and override-global-mode docstrings
Stefan Kangas [Thu, 8 Dec 2022 01:00:13 +0000 (02:00 +0100)]
Improve bind-keys* and override-global-mode docstrings

* lisp/use-package/bind-key.el (bind-keys*): Add docstring.
(override-global-mode) Improve docstring.

2 years ago; * src/emacs.c (main): Improvements to last change.
Po Lu [Thu, 8 Dec 2022 00:55:36 +0000 (08:55 +0800)]
; * src/emacs.c (main): Improvements to last change.

2 years agoFix crash on Windows 9X
Po Lu [Tue, 6 Dec 2022 01:30:00 +0000 (09:30 +0800)]
Fix crash on Windows 9X

* src/emacs.c (main): Call init_bignum before init_window_once.

2 years ago; * doc/misc/use-package.texi: Improve indexing.
Stefan Kangas [Thu, 8 Dec 2022 00:49:04 +0000 (01:49 +0100)]
; * doc/misc/use-package.texi: Improve indexing.

2 years agoAdd recursion limit to treesit--children-covering-range-recurse
Yuan Fu [Thu, 8 Dec 2022 00:36:07 +0000 (16:36 -0800)]
Add recursion limit to treesit--children-covering-range-recurse

* lisp/treesit.el (treesit--children-covering-range-recurse): Add
limit.

2 years agoImprove tree-sitter fontification in edge-cases (bug#59738)
Yuan Fu [Thu, 8 Dec 2022 00:02:53 +0000 (16:02 -0800)]
Improve tree-sitter fontification in edge-cases (bug#59738)

* lisp/treesit.el (treesit-font-lock-fontify-region): Use
treesit--children-covering-range-recurse.

2 years agoAdd new use-package manual
Stefan Kangas [Wed, 7 Dec 2022 23:47:04 +0000 (00:47 +0100)]
Add new use-package manual

* doc/misc/use-package.texi: Rewrite manual.

2 years agoAdd c-ts-mode-indent-defun (bug#59662)
Theodor Thornhill [Fri, 2 Dec 2022 15:05:35 +0000 (16:05 +0100)]
Add c-ts-mode-indent-defun (bug#59662)

Add in this function to mimic 'c-indent-defun'.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-defun): New function.
(c-ts-mode-map): New mode map that uses said function.

2 years agoFix syntax-table for tree-sitter modes
Theodor Thornhill [Mon, 5 Dec 2022 12:37:58 +0000 (13:37 +0100)]
Fix syntax-table for tree-sitter modes

When adapting the 'c-populate-syntax-table' for tree-sitter, I misread
the code, and thus some crucial entries were missing.  For the
relevant modes we use the same table as specified in the
non-tree-sitter major mode.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--syntax-table): Add new
entries.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode): Add new entries.
* lisp/progmodes/java-ts-mode.el (java-ts-mode--syntax-table): Add new
entries.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--syntax-table): Add new
entries.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--syntax-table): Add new entries.
* lisp/textmodes/css-mode.el (css-ts-mode): Add new entries.

2 years agoc++-ts-mode: Highlight nullptr as a constant
Brian Leung [Wed, 7 Dec 2022 10:12:05 +0000 (02:12 -0800)]
c++-ts-mode: Highlight nullptr as a constant

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Add
nullptr.

2 years agoImprove parameter checking in tree-sitter functions
Yuan Fu [Wed, 7 Dec 2022 03:56:25 +0000 (19:56 -0800)]
Improve parameter checking in tree-sitter functions

* src/treesit.c (treesit_check_position): Extract out new function.
(Ftreesit_node_first_child_for_pos)
(Ftreesit_node_descendant_for_range): Replace code with the new
function.
(Ftreesit_query_capture): Add missing check for node and parser.  Add
check for range for BEG and END.  Move treesit_initialize to the
beginning of the function.

* test/src/treesit-tests.el (treesit-node-api)
(treesit-query-api): Add tests for out-of-range error.

2 years ago; * test/lisp/comint-tests.el (w32-application-type): Fix typo.
Eli Zaretskii [Wed, 7 Dec 2022 19:52:00 +0000 (21:52 +0200)]
; * test/lisp/comint-tests.el (w32-application-type): Fix typo.

2 years agoFix comint-tests on MS-Windows
Eli Zaretskii [Wed, 7 Dec 2022 19:23:42 +0000 (21:23 +0200)]
Fix comint-tests on MS-Windows

* test/lisp/comint-tests.el (comint-tests/test-password-function):
On MS-Windows, call 'w32-native-executable-find' instead of
'executable-find', to find the native version of the 'cat'
program.
(w32-native-executable-p, w32-native-executable-find): New
functions.

2 years agoUse new external-completion.el in Eglot
João Távora [Wed, 7 Dec 2022 10:59:30 +0000 (10:59 +0000)]
Use new external-completion.el in Eglot

This refactor simplifies Eglot's source code.

* lisp/progmodes/eglot.el:
(Package-Requires): Require external-completion.
(external-completion): Require it.
(xref-backend-identifier-completion-table): Use external-completion-table.
(completion-category-overrides): No longer set it.
("Backend Completion"): Delete section.

2 years agoDon't override completion-category-defaults in fido-mode
João Távora [Wed, 7 Dec 2022 10:43:59 +0000 (10:43 +0000)]
Don't override completion-category-defaults in fido-mode

To more closely emulate ido-mode, fido-mode and fido-vertical-mode
strongly lean to the 'flex completion style.  But overriding
completion-category-defaults is not the correct way to do it, since
sometimes even the 'flex style isn't possible.

* lisp/icomplete.el (icomplete--fido-mode-setup): Don't set
completion-category-defaults here.

2 years agoAdd lisp/external-completion.el for completions from external tools
João Távora [Fri, 25 Nov 2022 13:03:45 +0000 (13:03 +0000)]
Add lisp/external-completion.el for completions from external tools

This table uses a new 'external' completion style which has been in
use in Eglot and other third-party extensions for a long time.  It's
meant for libraries that interface with an external tool which
provides completions, such as a shell utility, an inferior process, an
http server.

The new file lisp/external-completion.el provides a helper function,
external-completion-table which is given an interfacing function to
the external tool and returns a "programmed completion" table that is
bound to the 'external' completion style.  That table can then be used
with completing-read or any other facility expecting a completion
table.

When the 'external' is in use, the usual styles configured by the user
or other in 'completion-styles' are completely overriden.  This
relatively minor inconvenience is the price to pay for responsive
completion where the full set of completion candidates doesn't need to
be transfered into Emacs's address space.

* lisp/external-completion.el: New file.

* etc/NEWS: (Lisp Changes in Emacs 29.1): Mention
  external-completion-table.

2 years agoEglot: fix setting of flymake-list-only-diagnostics (bug#59824)
João Távora [Wed, 7 Dec 2022 11:30:34 +0000 (11:30 +0000)]
Eglot: fix setting of flymake-list-only-diagnostics (bug#59824)

When Eglot receives diagnostics for a file not yet visited in Emacs,
it stores them in flymake-list-only-diagnostics, which feed M-x
flymake-show-project-diagnostics.  If the file is eventually visited
in a buffer and Eglot starts receibing diagnostics for it, the
flymake-list-only-diagnostics database has to be updated accordingly,
since the previous diagnostics are now stale.

* lisp/progmodes/eglot.el (eglot-handle-notification): Reset
flymake-list-only-diagnostics

2 years ago* test/src/sqlite-tests.el (sqlite-version): Declare.
Mattias Engdegård [Tue, 6 Dec 2022 21:21:00 +0000 (22:21 +0100)]
* test/src/sqlite-tests.el (sqlite-version): Declare.

2 years agoEUDC: Outline deprecation plans in NEWS
Thomas Fitzsimmons [Wed, 7 Dec 2022 02:41:51 +0000 (21:41 -0500)]
EUDC: Outline deprecation plans in NEWS

* etc/NEWS (EUDC): Mention deprecation plans.

2 years agoFix admin/notes/tree-sitter/build-module/build.sh (bug#59789)
Yuan Fu [Tue, 6 Dec 2022 23:55:14 +0000 (15:55 -0800)]
Fix admin/notes/tree-sitter/build-module/build.sh (bug#59789)

Besides the problem mentioned by Juri, which is fixed by removing

-cp tree-sitter-lang.in "tree-sitter-${lang}/src"
-cp emacs-module.h "tree-sitter-${lang}/src"

(we removed those files in an earlier commit, because they are not
used anymore.)

Now it also more parameterized and builds typescript and tsx
separately.

* admin/notes/tree-sitter/build-module/build.sh (topdir)
(repo, sourcedir, grammardir): New variables.
(Build): Make it parametric.
(Copy out): Use absolute path.

* admin/notes/tree-sitter/build-module/batch.sh (languages): Add tsx.

2 years ago* doc/misc/eww.texi (Overview): Improve introduction.
Stefan Kangas [Wed, 7 Dec 2022 00:02:48 +0000 (01:02 +0100)]
* doc/misc/eww.texi (Overview): Improve introduction.

2 years agoConsistent fontification of using-directives in csharp-ts-mode
Jostein Kjønigsen [Tue, 6 Dec 2022 08:40:03 +0000 (09:40 +0100)]
Consistent fontification of using-directives in csharp-ts-mode

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
New rules.

2 years ago; Rename c-ts-fontify-error to c-ts-mode--fontify-error
Yuan Fu [Tue, 6 Dec 2022 08:26:51 +0000 (00:26 -0800)]
; Rename c-ts-fontify-error to c-ts-mode--fontify-error

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings)
(c-ts-fontify-error): Rename.

2 years ago; Improve docstring of c-ts-mode--fontify-variable
Yuan Fu [Tue, 6 Dec 2022 08:17:04 +0000 (00:17 -0800)]
; Improve docstring of c-ts-mode--fontify-variable

* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-variable): Improve
docstring.

2 years agoFontify some keywords in type face in c-ts-mode
Yuan Fu [Tue, 6 Dec 2022 08:15:30 +0000 (00:15 -0800)]
Fontify some keywords in type face in c-ts-mode

* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Remove some keywords.
(c-ts-mode--type-keywords): New variables.
(c-ts-mode--font-lock-settings): New rule.

2 years ago; Minor cleanup in treesit.c
Eli Zaretskii [Tue, 6 Dec 2022 17:28:02 +0000 (19:28 +0200)]
; Minor cleanup in treesit.c

* src/treesit.c (Ftreesit_query_capture)
(Ftreesit_parser_set_included_ranges): Minor cleanups.

2 years ago; * lib-src/etags.c (escape_shell_arg_string): Minor doc fix.
Stefan Kangas [Tue, 6 Dec 2022 17:05:08 +0000 (18:05 +0100)]
; * lib-src/etags.c (escape_shell_arg_string): Minor doc fix.

2 years agoFix etags builds on non-Windows non-MS-DOS machines
Mattias Engdegård [Tue, 6 Dec 2022 16:37:22 +0000 (17:37 +0100)]
Fix etags builds on non-Windows non-MS-DOS machines

* lib-src/etags.c: In this file, MSDOS is always defined but can be
either `true` or `false`, so don't used `defined MSDOS` as a condition.

2 years ago; Fix last change in etags.c.
Eli Zaretskii [Tue, 6 Dec 2022 16:13:41 +0000 (18:13 +0200)]
; Fix last change in etags.c.

2 years agoFix etags local command injection vulnerability
lu4nx [Tue, 6 Dec 2022 07:42:40 +0000 (15:42 +0800)]
Fix etags local command injection vulnerability

* lib-src/etags.c: (escape_shell_arg_string): New function.
(process_file_name): Use it to quote file names passed to the
shell.  (Bug#59817)

2 years agoAvoid crashes in a build --without-modules
Eli Zaretskii [Tue, 6 Dec 2022 15:15:35 +0000 (17:15 +0200)]
Avoid crashes in a build --without-modules

* src/lread.c (syms_of_lread): Move the definitions of
'dynamic-library-suffixes' outside of the HAVE_MODULES
conditional.  (Bug#59832)

2 years agoFix 'add-display-text-property' when OBJECT is non-nil
Eli Zaretskii [Tue, 6 Dec 2022 12:41:36 +0000 (14:41 +0200)]
Fix 'add-display-text-property' when OBJECT is non-nil

* lisp/emacs-lisp/subr-x.el (add-display-text-property): Fix the
case where OBJECT is not nil.  (Bug#59857)

* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-add-display-text-property): Add test for this case.

2 years agoDo not run slow tests on EMBA
Michael Albinus [Tue, 6 Dec 2022 11:36:15 +0000 (12:36 +0100)]
Do not run slow tests on EMBA

* test/infra/gitlab-ci.yml (.filenotify-gio-template): Do not run
scheduled.
(build-native-comp-speed1, build-native-comp-speed2): Comment out.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-part1): Skip also on EMBA.

2 years agoLisp reader undefined behaviour excision
Mattias Engdegård [Tue, 6 Dec 2022 11:13:18 +0000 (12:13 +0100)]
Lisp reader undefined behaviour excision

* src/lread.c (read_bool_vector, skip_lazy_string):
Replace `|` with `||` to explicitly introduce sequence points since
the variables, `length` and `nskip`, are mutated more than once.

The `|` was just a weak attempt at micro-optimisation in any case;
sorry about that.

2 years ago; Fix typo in js--treesit-imenu
Randy Taylor [Tue, 6 Dec 2022 01:30:56 +0000 (20:30 -0500)]
; Fix typo in js--treesit-imenu

* lisp/progmodes/js.el (js--treesit-imenu): Fix a typo.  (Bug#59849)

2 years agoFix treesit-query-capture
Yuan Fu [Tue, 6 Dec 2022 02:37:47 +0000 (18:37 -0800)]
Fix treesit-query-capture

Before this change Ftreesit_query_capture doesn't convert character
position to byte position for BEG and END parameters.  I observed
fontification issue in css files but couldn't figure out why, now I
know :-)

I decide to keep treesit--font-lock-query-expand-range, since it might
provide a escape hatch for problems we discover in the future, and it
should be very cheap so no downside of keeping it.

* lisp/textmodes/css-mode.el (css-ts-mode): Stop setting
treesit--font-lock-query-expand-range.
* lisp/treesit.el (treesit--font-lock-query-expand-range): Update
docstring.
* src/treesit.c (Ftreesit_query_capture): Convert BEG and END to byte
position.  Also added parentheses wround "beg_byte - visible_beg" in
the call to ts_query_cursor_set_byte_range (i.e., style change).

2 years agoImprove fontification of typescript-ts-mode (bug#59831)
Jostein Kjønigsen [Mon, 5 Dec 2022 08:31:58 +0000 (09:31 +0100)]
Improve fontification of typescript-ts-mode (bug#59831)

- Highlight property and field definitions in class declaration.
- Highlight property-keys in object initializaters.
- Highlight variable-names in function/method return-statements.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Add fontification rules.

2 years agoAdd back pair feature in json-ts-mode fontification (bug#59833)
Theodor Thornhill [Mon, 5 Dec 2022 14:59:41 +0000 (15:59 +0100)]
Add back pair feature in json-ts-mode fontification (bug#59833)

* lisp/progmodes/json-ts-mode.el (json-ts-mode--font-lock-settings):
Add back in removed pair feature.  Also alphabetize features.
(json-ts-mode): Use the new feature.

2 years agoFix mouse clicks on a non-selected frame
Eli Zaretskii [Mon, 5 Dec 2022 19:55:25 +0000 (21:55 +0200)]
Fix mouse clicks on a non-selected frame

* lisp/mouse-drag.el (mouse-drag-drag): Skip switch-frame events
while tracking mouse.  (Bug#59785)

2 years ago; Clarify description of display on the margins
Eli Zaretskii [Mon, 5 Dec 2022 19:45:01 +0000 (21:45 +0200)]
; Clarify description of display on the margins

* doc/lispref/display.texi (Display Margins): More accurate
explanation of how to show text in the display margin without
concealing buffer text.  (Bug#59841)

2 years agoImprove treesit-fontify-with-override
Yuan Fu [Sun, 4 Dec 2022 08:22:28 +0000 (00:22 -0800)]
Improve treesit-fontify-with-override

This also fixes fontification problem with c-ts-mode--fontify-defun.

Now treesit-fontify-with-override clips the fontification region for
the user, so no need for (max start node-start) shenanigans anymore.
More importantly it doesn't fontify unless the region between
node-start and node-end intersects with the region between start and
end, which fixes the problem with c-ts-mode--fontify-defun.

* lisp/treesit.el (treesit-fontify-with-override): Add optional
parameter BOUND-START and BOUND-END.  Wrap the function body in a
when-form.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-declarator)
(c-ts-mode--fontify-variable)
(c-ts-mode--fontify-defun)
(c-ts-fontify-error)
* lisp/progmodes/js.el (js--fontify-template-string)
* lisp/progmodes/python.el (python--treesit-fontify-string): Use the
new signature.

2 years agoMake killing a non-last client work the same no matter the auto-stop setting
Jim Porter [Fri, 2 Dec 2022 20:14:50 +0000 (12:14 -0800)]
Make killing a non-last client work the same no matter the auto-stop setting

Previously, if 'server-stop-automatically' was configured for
'kill-terminal' or 'delete-frame', killing a client via
'save-buffers-kill-terminal' wouldn't prompt about the saving files in
the client's buffer list (as it does when not using those settings).
This change ensures that those settings only apply when killing the
last client, as described in the manual (bug#51993).

* lisp/server.el (server-save-buffers-kill-terminal): Handle
'server-stop-automatically' behavior in this function, rather than
calling 'server-stop-automatically--handle-delete-frame'.

2 years agoUse the function 'window-system' on the tab-bar/tab-line (bug#59620)
Juri Linkov [Sun, 4 Dec 2022 19:30:34 +0000 (21:30 +0200)]
Use the function 'window-system' on the tab-bar/tab-line (bug#59620)

* lisp/tab-bar.el (tab-bar-separator)
(tab-bar-format-align-right, tab-bar-auto-width):
* lisp/tab-line.el (tab-line-format-template): Replace the variable
'window-system' with the function call '(window-system)'.

2 years agoRestore font-lock-type-face for lisp mode &symbols
Tom Gillespie [Sun, 4 Dec 2022 06:41:15 +0000 (22:41 -0800)]
Restore font-lock-type-face for lisp mode &symbols

* lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2)
(lisp-el-font-lock-keywords-2): Restore use of type face instead of
builtin face for &symbol keywords.  This fixes what appears to be
a copy paste error that changed the face for common lisp and emacs
lisp &symbol style keywords that was introduced in commit
a498e5f83 by restoring the type face to font-lock-type-face as
consistent with the comments.