This fixes bug #61298. The new long-lines code may have narrowed a buffer
before font-lock-default-fontify-region gets called.
* lisp/font-lock.el (font-lock-default-fontify-region): Set `end' to point-max
if it is greater that it.
* lisp/emacs-lisp/byte-opt.el (byte-after-unbind-ops):
Add discardN and discardN-preserve-tos, both of which
commute with unbind. This enables subsequent optimisations.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Remove code forcing forward motion after applying certain
transformations; these were only there to keep output identical across
refactorings.
This is a refactoring step: there is no change in how the optimiser
works.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Instead of re-using local variables through mutation, bind them at
point of use. This ensures that there is no value leakage by mistake
and actually reduces the static size of the bytecode of this function
somewhat.
The lousy variable names (tmp, tmp2 etc) are retained but
can at least now be changed into something more descriptive.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Instead of using the O(n) `delq' to remove single instructions, use
the O(1) `setcdr'. To do this, anchor the instruction list in a cons
cell and use the predecessor cell in iteration.
* lisp/isearch.el (isearch-emoji-by-name): Use 'emoji--read-emoji'
and if that returns derivations, 'completing-read' to select one
of them. This fixes bug#60740.
* lisp/international/emoji.el (emoji--init): Autoload.
(emoji--read-emoji): New function, which doesn't use transient
and returns a list of the glyph and all derivations, if any.
(emoji--choose-emoji): Use 'emoji--read-emoji'.
* doc/emacs/display.texi (Parser-based Font Lock):
Update description of treesit-font-lock-level, moving 'property' to
level 4.
* lisp/treesit.el (treesit-font-lock-level): Likewise, in docstring.
* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Do that here.
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode): Add a comment.
* lisp/progmodes/go-ts-mode.el (go-ts-mode): Add 'definition' to
level 1. Move 'function', 'property' and 'variable' to level 4.
(go-ts-mode--font-lock-settings): Move a bunch of existing rules
to 'definition'. Add highlighting of function parameters.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode)
(rust-ts-mode--font-lock-settings): Same. And also change "scoped
identifiers" highlights to only match capitalized names.
Now c-ts-mode-set-style's effect is local, and there is a new function
c-ts-mode-set-global-style that changes the global setting.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-style-setter): Use c-ts-mode-set-style.
(c-ts-mode-indent-style)
(c-ts-mode--prompt-for-style): Minor change in docstring.
(c-ts-mode-set-global-style): New function (from c-ts-mode-set-style).
(c-ts-mode-set-local-style): Remove function (became c-ts-mode-set-style).
(c-ts-mode-set-style): Renamed from c-ts-mode-set-local-style.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts:
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use
c-ts-mode-set-style.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Uncomment parameter declaration highlighting (bug#61275).
(c-ts-mode--fontify-declarator): Check that identifier was found.
Some declarations can miss identifier name.
* lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules): Add
indentation for type switch and select case blocks
* test/lisp/progmodes/go-ts-mode-resources/indent.erts: New .erts file
to test indentation of Go constructs and prevent regression of bug
fixes.
* test/lisp/progmodes/go-ts-mode-tests.el: New file with go-ts-mode
tests.
Advising interactive forms relies on the ability to distinguish
interactive forms that do nothing else than return a function.
So, be careful to preserve this info.
Furthermore, interactive forms are expected to be evaluated in
the lexical context captured by the closure to which they belong,
so be careful to preserve that context when manipulating those forms.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form) <lambda>:
Preserve the info that an interactive form does nothing else than
return a function.
* lisp/emacs-lisp/nadvice.el (advice--interactive-form-1): New function.
(advice--interactive-form): Use it.
(advice--make-interactive-form): Refine to also accept function values
quoted with `quote`. Remove obsolete TODO.
* test/lisp/emacs-lisp/nadvice-tests.el: Don't disallow byte-compilation.
(advice-test-bug61179): New test.
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): Allow
the `if` arg to be a form.
* lisp/simple.el (oclosure-interactive-form): Adjust accordingly.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Fix a typo.
(ruby-ts--syntax-propertize): Use pcase-exhaustive to avoid typos.
Put the last s-t property after heredoc's end (apparently
parse-partial-sexp likes that more). Move first s-t property on
percent literals to the very beginning (to be refined later).
Differentiate the %r{} literals from /.../ ones -- tree-sitter
parses them exactly the same.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query):
New variable.
(ruby-ts--syntax-propertize): New function.
(ruby-ts--parser-after-change): New function.
(ruby-ts-mode): Use both of them.
This fixes bug #61144. If the space around the * is "symmetric" we leave foo
* bar unfontified, a multiplication operation. If it is "asymmetric" we
fontify it as a pointer declaration.
* lisp/progmodes/cc-engine.el (c-fdoc-assymetric-space-about-asterisk): New
macro, extracted from c-forward-decl-or-cast-1.
(c-forward-decl-or-cast-1): Invoke the new macro twice, in CASE 16 (new) and
CASE 17.5 (the source of the macro). In CASE 16, additionally set
unsafe-maybe when appropriate.
* doc/lispref/modes.texi (Header Lines): Rewrite the documentation
of 'header-line-indent-mode' and its two variables. Fix the
example.
* doc/lispref/display.texi (Pixel Specification): More accurate
description of what happens with :align-to in header-lines.
Improve indexing. (Bug#61239)
* src/buffer.c (syms_of_buffer) <header-line-format>:
* lisp/display-line-numbers.el (header-line-indent)
(header-line-indent-width, header-line-indent-mode): Doc fixes.
* etc/NEWS: Enhance the announcement of 'header-line-indent-mode'.
* lisp/erc/erc-sasl.el (erc-sasl-user): Fix doc string.
(erc-sasl--get-user): Don't apply casemapping when the option
`erc-sasl-user' is set to `:nick'. While many servers and
auth-services providers perform case-folding when comparing SASL
usernames, only some recognize RFC1459 mappings, which ERC previously
applied blindly. Instead, ERC now behaves like other clients in
leaving such preparation in the hands of the server. This bug was
introduced with changes new to ERC 5.5 and Emacs 29 (bug#29108).
* lisp/keymap.el (keymap-global-set, keymap-local-set): Add optional
`interactive' arg and use it to decide when to convert the key
specification to a string. Add `advertised-calling-convention'
declarations. (Bug#61149)
96ea27278b ; Fix c-ts-mode indent test
d963a8f135 Make c-ts-mode indent tests side-effect-free
8a6bdf88b4 Call treesit_record_change in insert_from_gap_1
a2b77c79dc Use c-ts-common-statement-offset for closing brackets too
74e715cb72 ; Go back to original point when filling comments in c-ts...
b8009bbf2d ; Fix error where we pass t to treesit-node-type in c-ts-...
88ccf78b20 ; * src/treesit.c (treesit_predicate_match): Simplify las...
20454128b8 Minor improvements in sqlite.c
3b3c47d977 (treesit_predicate_match): Match node text against regexp...
e8334781c9 Improve documentation of gdb-mi's dedicated windows
c498884059 Avoid spurious pause in kill-ring-save (Bug#60841)
382ab516ce Change the default of 'treesit-defun-tactic' for 'c-ts-mode'
4d3428e95a Fix docstring fontification of CL's 'defstruct'
1c125baa3f Teach 'hs-minor-mode' about tree-sitter based modes
2de0ab5cbd ; Doc fixes in keymap.el
c6660a6d6d Improve documentation of 'repeat-mode' and related variables
be304bb328 ; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750).
# Conflicts:
# etc/NEWS
Running indent tests changes the global value of
c-ts-mode-indent-style. That's not good. This change fixes that.
I also refactored the indent style functions a bit.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--prompt-for-style): New function.
(c-ts-mode-set-local-style): New function.
(c-ts-mode-set-style): Use c-ts-mode--prompt-for-style. Use
derived-mode-p when testing for major mode. Remove check of current
buffer's major mode since it doesn't matter.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts:
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Use
c-ts-mode-set-local-style to set the indent style locally.
Before this change, insert_from_gap calls treesit_record_change but
insert_from_gap_1 doesn't. However, insert_from_gap_1 is a public
function and is called in many other places outside of insdel.c. This
could lead to tree-sitter's parse tree becoming out-of-sync with the
buffer content.
This change might fix bug#60650.
* src/insdel.c (insert_from_gap_1): Call treesit_record_change.
(insert_from_gap): Remove call to treesit_record_change.
* admin/notes/tree-sitter/treesit_record_change: New file.
* src/sqlite.c (Fsqlite_next): Doc fix. Return nil if SQLITE_DONE
was once seen for this statement. (Bug#61151)
(row_to_value): Cons the value in reverse, to avoid the Fnreverse
call. Patch by Helmut Eller <eller.helmut@gmail.com>.
(Bug#61165)
* src/treesit.c (treesit_predicate_match): Match node text against
regexp without creating a new string object (bug#60953).
* src/search.c (search_buffer): Make not static.
Delete declaration near the beginning of the file.
* src/lisp.h: Declare it here.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--builtin-method-p):
Remove function.
(ruby-ts--font-lock-settings): Use the regexp with :match directly.