Po Lu [Mon, 12 Dec 2022 11:21:10 +0000 (19:21 +0800)]
Add variable to make resizing frames sometimes faster
* etc/PROBLEMS: Add documentation about new variable.
* src/xterm.c (x_set_offset, x_set_window_size_1): Respect new
variable.
(syms_of_xterm): Add a new variable to prevent Emacs from
syncing upon resize or movement.
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.
Introduce a new command that aims to reindent code in a defun, or fill
a paragraph of text. The command uses treesit.el when available,
otherwise falls back to using syntax-ppss and regexps. Treesit.el
needs a new variable that is intended to be set by the major modes so
that this and other future functions can know what kind of node we are
looking at.
* doc/emacs/programs.texi: Mention the new command.
* etc/NEWS: Mention the new command.
* lisp/progmodes/c-ts-mode.el (c++-ts-mode): Add regexp for the new
variable.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode): Add regexp for the
new variable.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Add regexp for the
new variable.
* lisp/progmodes/js.el (js-ts-mode): Add regexp for the new variable.
* list/progmodes/prog-mode.el (prog-mode-map): Bind the new command by
default.
(prog-fill-reindent-defun): New command.
* lisp/progmodes/sh-script.el (bash-ts-mode): Add regexp for the new
variable.
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode): Add
regexp for the new variable.
* lisp/treesit.el (treesit-text-type-regexp): New variable.
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.
* src/itree.c (itree_iterator_start): Fix docstring typo.
* test/manual/noverlay/itree-tests.c: Stop defining unused
ITREE_DEBUG. Replace removed names and APIs with current ones,
e.g. interval_tree_init is now called itree_init, and
itree_iterator_finish no longer exists. Ensure preconditions of
itree API are satisfied before use, e.g. by zero-initializing
instances of itree_node before inserting them into a tree.
Po Lu [Sun, 11 Dec 2022 01:34:03 +0000 (09:34 +0800)]
Merge from origin/emacs-29
44c5f361497 ; Fix two byte-compiler warnings a8ee046fb50 Ensure 'package-vc--version' always returns a version 022ab1061b2 Ensure 'package-vc--main-file' always returns an existing... 357fe91996b Check if package already exists before installing from ch... 5e8bc79f6b2 ; Fix reference in docstring to 'package-vc-install-from-... af88b00b19c Refresh the package quickstart file in package-vc 5a092c8e461 ; * admin/notes/tree-sitter/starter-guide (Indent): Minor... ebef8905b0d Make indirect buffers use tree-sitter parsers of their ba... 8f53fa10d94 Fontify "this" as a keyword in c++-ts-mode (bug#59924) 8de8f1dc051 Add class_body indentation for typescript (bug#59680) 839341d7370 Make more granular defun-type-regexp (bug#59873) 8f49137c9bf Add dockerfile-ts-mode (Bug#59894) 1014bcc8e32 Fix fontification of method-invocations in js-ts-mode (bu... 7141920c6af Fix escape-sequence feature in typescript-ts-mode (bug#59... 4df35e3491c Improve fontification in csharp-ts-mode (bug#59909) 33a8415eb7e Use 'project--value-in-dir' for 'project-vc-include-untra... 594267395d5 Update Turkish Hello 940d9070e97 Support newer glib versions (Bug#59061) 0bd26abf7fb ; * doc/misc/use-package.texi: Fix @file. bcf235acd58 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 2ea7a357fd1 ; * doc/misc/use-package.texi: Fix @acronym. d268ab1c5d7 Bring back the project--value-in-dir logic
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'.
gdb-mi.el: Configure variable order and length in local-vars window
This changes allows users to configure the order of various properties
as well as truncating their length. The full description of each
property is available as a help-text (tooltip).
* lisp/progmodes/gdb-mi.el (gdb-locals-table-row-config): New user
option.
(gdb-locals-value-filter): Don't limit the values here.
(gdb-locals-table-columns-list): New function.
(gdb-locals-handler-custom): Call it. (Bug#59730)
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)
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.
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.
Po Lu [Fri, 9 Dec 2022 10:28:42 +0000 (18:28 +0800)]
Improve some behavior when the X server does not trust Emacs
* src/xterm.c (x_dnd_begin_drag_and_drop): Display error when
Emacs is untrusted instead of hanging indefinitely.
(x_focus_frame): Simply return instead of wasting time when
Emacs is untrusted.
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.