]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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.

2 years agoPrevent a segfault when deleting a fullscreen frame on NextStep.
Kai Ma [Sat, 3 Dec 2022 10:17:26 +0000 (18:17 +0800)]
Prevent a segfault when deleting a fullscreen frame on NextStep.

* nsterm.m ([EmacsView resetCursorRects:]): Be defensive when
accessing FRAME_OUTPUT_DATA.  [resetCursorRects:] can be called
from the event loop after the frame is deleted.  When this
happens, emacsframe is NULL.  This means there is an underlying
leak of the EmacsView object!  (Bug#59794)
Do not merge to master.

Copyright-paperwork-exempt: yes

2 years ago; * lisp/pcomplete.el (pcomplete-allow-modifications): Fix a typo.
Eli Zaretskii [Sun, 4 Dec 2022 12:42:07 +0000 (14:42 +0200)]
; * lisp/pcomplete.el (pcomplete-allow-modifications): Fix a typo.

2 years agoFix markup in ERC manual
Eli Zaretskii [Sun, 4 Dec 2022 12:31:50 +0000 (14:31 +0200)]
Fix markup in ERC manual

* doc/misc/erc.texi (SASL): Use @table instead of simulating it
with @indentedblock.  Fix markup.  (Bug#59815)

2 years agoFix comment-start-skip in tree-sitter modes (bug#59690)
Yuan Fu [Sat, 3 Dec 2022 01:03:21 +0000 (17:03 -0800)]
Fix comment-start-skip in tree-sitter modes (bug#59690)

* lisp/progmodes/c-ts-mode.el (c-ts-mode)
(c++-ts-mode)
* lisp/progmodes/csharp-mode.el (csharp-ts-mode)
* lisp/progmodes/java-ts-mode.el (java-ts-mode)
* lisp/progmodes/js.el (js-ts-mode)
* lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode): Remove the group
from the regexp.

2 years ago; * lisp/treesit.el (treesit-end-of-defun): Guard against nil value.
Yuan Fu [Fri, 2 Dec 2022 05:19:14 +0000 (21:19 -0800)]
; * lisp/treesit.el (treesit-end-of-defun): Guard against nil value.

2 years ago; * lisp/subr.el (posn-col-row): Revert inadvertent change.
Eli Zaretskii [Sat, 3 Dec 2022 20:09:16 +0000 (22:09 +0200)]
; * lisp/subr.el (posn-col-row): Revert inadvertent change.

2 years ago; Remove debugging leftover message
Eli Zaretskii [Sat, 3 Dec 2022 20:06:34 +0000 (22:06 +0200)]
; Remove debugging leftover message

* lisp/emacs-lisp/comp.el (comp--native-compile): Remove
unnecessary call to 'message'.  (Bug#59766)

2 years agoSpeed up Unicode normalisation tests by a factor of 5
Mattias Engdegård [Sat, 3 Dec 2022 18:19:28 +0000 (19:19 +0100)]
Speed up Unicode normalisation tests by a factor of 5

After this change, ucs-normalize-tests are still very slow but
somewhat less disastrously so (from 100 to 20 min on this machine).

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--normalization-equal-p)
(ucs-normalize-tests--normalization-chareq-p)
(ucs-normalize-tests--rule1-holds-p)
(ucs-normalize-tests--rule2-holds-p)
(ucs-normalize-tests--part1-rule2):
Run only over the Unicode code space.
Hoist `with-current-buffer` to reduce overhead.

2 years agoFix "C-h k" when clicking on another frame
Eli Zaretskii [Sat, 3 Dec 2022 19:43:36 +0000 (21:43 +0200)]
Fix "C-h k" when clicking on another frame

* lisp/help.el (help--analyze-key): Don't barf if the key sequence
includes a switch-frame event.  (Bug#59785)

2 years ago; Fix typos
Stefan Kangas [Sat, 3 Dec 2022 14:31:07 +0000 (15:31 +0100)]
; Fix typos

2 years agoFix and expand tests broken by commit 2772ebe366 of 2022-11-28
Juanma Barranquero [Sat, 3 Dec 2022 11:01:10 +0000 (12:01 +0100)]
Fix and expand tests broken by commit 2772ebe366 of 2022-11-28

* test/lisp/emacs-lisp/comp-tests.el
(with-test-native-compile-prune-cache)
(test-native-compile-prune-cache)
(test-native-compile-prune-cache/delete-only-eln)
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
Check that the last directory in `native-comp-eln-load-path' is
not affected by `native-compile-prune-cache'.

2 years ago; Add cross-reference to string-equal docstring
Stefan Kangas [Sat, 3 Dec 2022 10:29:37 +0000 (11:29 +0100)]
; Add cross-reference to string-equal docstring

* lisp/subr.el (string-equal-ignore-case):
* src/fns.c (Fstring_equal): Doc fix; add cross-references.

2 years agoFix handling of relative directories in "--init-directory=DIR"
Eli Zaretskii [Sat, 3 Dec 2022 10:21:00 +0000 (12:21 +0200)]
Fix handling of relative directories in "--init-directory=DIR"

* lisp/startup.el (command-line): Interpret non-absolute file
names in '--init-directory' relative to the directory from
which Emacs is started.  (Bug#59795)

2 years agoMake sure 'user-emacs-directory' ends in a slash
Eli Zaretskii [Sat, 3 Dec 2022 10:03:13 +0000 (12:03 +0200)]
Make sure 'user-emacs-directory' ends in a slash

* lisp/startup.el (command-line): Make sure 'user-emacs-directory'
has the form of a directory.

2 years agoFix gud-minor-mode-menu
Eli Zaretskii [Sat, 3 Dec 2022 09:32:00 +0000 (11:32 +0200)]
Fix gud-minor-mode-menu

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode)
(easy-mmode-define-keymap): Don't declare obsolete, since we are
still using it in gud.el.  (Bug#59769)  (Bug#59605)
Do not merge to master.

2 years agoRevert "Make easy-mmode-defmap obsolete and adjust only caller"
Eli Zaretskii [Sat, 3 Dec 2022 09:16:41 +0000 (11:16 +0200)]
Revert "Make easy-mmode-defmap obsolete and adjust only caller"

This reverts commit 8bb5c1bfec0929f2ba419e1c503f5acc01c336c2.
That commit lost too many useful features in the GUD menus
and caused several bugs, the last of them bug#59769.

Do not merge to master.

2 years agovc-git-print-log: Don't assume vc-git-log-switches is a list
Sean Whitton [Sat, 3 Dec 2022 06:42:10 +0000 (23:42 -0700)]
vc-git-print-log: Don't assume vc-git-log-switches is a list

* lisp/vc/vc-git.el (vc-git-print-log): Call ensure-list on
vc-git-log-switches to handle the case where it's a singular string.

2 years agoFix use-package tests
Stefan Kangas [Fri, 2 Dec 2022 23:55:56 +0000 (00:55 +0100)]
Fix use-package tests

* test/lisp/use-package/use-package-chords-tests.el:
* test/lisp/use-package/use-package-tests.el: Remove local
variables section.  Require 'ert' and fix copyright header.

2 years ago; server-tests: remove CI debugging
Mattias Engdegård [Fri, 2 Dec 2022 17:26:04 +0000 (18:26 +0100)]
; server-tests: remove CI debugging

2 years ago; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#59779).
Eli Zaretskii [Fri, 2 Dec 2022 17:08:08 +0000 (19:08 +0200)]
; * lisp/subr.el (string-equal-ignore-case): Doc fix (bug#59779).

2 years ago; server-test CI debugging
Mattias Engdegård [Fri, 2 Dec 2022 17:06:00 +0000 (18:06 +0100)]
; server-test CI debugging

2 years agoFix server-tests run noninteractively (bug#59742)
Mattias Engdegård [Fri, 2 Dec 2022 16:27:16 +0000 (17:27 +0100)]
Fix server-tests run noninteractively (bug#59742)

This may or may not fix the test run from CI.

* test/lisp/server-tests.el (server-tests/can-create-frames-p):
Don't attempt to create frames if TERM=dumb, which what we have
if run from M-x compile (for instance).
(server-tests/server-force-stop/keeps-frames): Delete created frame so
that it doesn't cause trouble for other tests.

2 years agoUse file-name-nondirectory to determine default project-name
Randy Taylor [Fri, 2 Dec 2022 03:12:07 +0000 (22:12 -0500)]
Use file-name-nondirectory to determine default project-name

* lisp/progmodes/project.el (project-name):
Use file-name-nondirectory instead of file-name-base (bug#59756).

2 years agoSpeed up auto-completion in 'sh-script-mode'
Yikai Zhao [Tue, 29 Nov 2022 14:30:14 +0000 (22:30 +0800)]
Speed up auto-completion in 'sh-script-mode'

* lisp/progmodes/sh-script.el (sh--cmd-completion-table-gen): New
function, replacement for 'sh--cmd-completion-table'.
(sh--cmd-completion-table): Function removed.
(sh-completion-at-point-function): Use
'sh--cmd-completion-table-gen'.  (Bug#59678)

2 years agoFix error editing multisession variables (bug#59710)
Juanma Barranquero [Fri, 2 Dec 2022 13:14:26 +0000 (14:14 +0100)]
Fix error editing multisession variables (bug#59710)

* lisp/emacs-lisp/multisession.el (multisession-edit-value):
Do not use `bound-and-true-p' on a non-symbol.  This reverts
commit bd586121ac21e046f60f75eeb0200866c38d6f9f.

2 years ago; Fix a typo in .clang-format.
dickmao [Thu, 1 Dec 2022 21:54:06 +0000 (16:54 -0500)]
; Fix a typo in .clang-format.

2 years ago; Make clang-format format indent preprocessor blocks correctly.
Vibhav Pant [Wed, 30 Nov 2022 17:37:44 +0000 (23:07 +0530)]
; Make clang-format format indent preprocessor blocks correctly.

(cherry picked from commit 1abda0c83981a6d35dd4b2dd3e88e9886d13cb09)

2 years agoAdd tsx-ts-mode to eglot-server-programs
Brian Leung [Fri, 2 Dec 2022 11:02:30 +0000 (03:02 -0800)]
Add tsx-ts-mode to eglot-server-programs

* lisp/progmodes/eglot.el (eglot-server-programs): Add
tsx-ts-mode.  (Bug#59770)