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.
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.
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'.
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.
Po Lu [Sun, 11 Dec 2022 01:32:20 +0000 (09:32 +0800)]
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.
Gregory Heytings [Sat, 10 Dec 2022 22:13:58 +0000 (22:13 +0000)]
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'.
Jim Porter [Sat, 10 Dec 2022 06:56:24 +0000 (22:56 -0800)]
; Fix a failure when running server-tests via the command line
* test/lisp/server-tests.el
(server-tests/server-force-stop/keeps-frames): Delete every new frame
created during the test. On some systems, 'delete-terminal' will
delete the frames for us, so this ensures that if there are no new
frames, nothing happens.
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.
Matt Armstrong [Wed, 30 Nov 2022 23:58:07 +0000 (15:58 -0800)]
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)
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.
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.
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.
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.
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.)
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:
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.
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.
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.
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.
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.
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.
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).
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).