]> git.eshelyaron.com Git - emacs.git/log
emacs.git
22 months agoMinor improvements to labeled narrowing
Gregory Heytings [Mon, 13 Feb 2023 10:23:39 +0000 (10:23 +0000)]
Minor improvements to labeled narrowing

* lisp/subr.el (internal--with-narrowing):
(internal--without-narrowing): Remove unnecessary 'progn'.

* etc/NEWS: Mention 'with-narrowing' in the entry about long
lines.

* doc/lispref/positions.texi (Narrowing): Fix typo.

* doc/lispref/display.texi (Auto Faces): Use @pxref.

* doc/lispref/commands.texi (Command Overview): Use @pxref.

22 months agoSave and restore the absence of narrowing locks
Gregory Heytings [Fri, 10 Feb 2023 20:55:47 +0000 (20:55 +0000)]
Save and restore the absence of narrowing locks

* src/editfns.c (narrowing_locks_save): Return the buffer with a
empty locks list when the current buffer has no narrowing locks.
(narrowing_locks_restore): Remove the narrowing locks if the
buffer had no narrowing locks.

22 months agoAdd an extensive test for labeled (locked) narrowing
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Add an extensive test for labeled (locked) narrowing

* test/src/buffer-tests.el (test-labeled-narrowing): New test.

22 months agoUpdate the documentation about labeled (locked) narrowing
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Update the documentation about labeled (locked) narrowing

* src/xdisp.c (syms_of_xdisp) <fontification-functions>: Update
docstring.

* src/keyboard.c (syms_of_keyboard) <pre-command-hook>:
(syms_of_keyboard) <post-command-hook>: Update docstring.

* src/editfns.c:
(narrowing_locks): Explain why an alist is used instead of a
buffer-local variable.
(reset_outermost_narrowings): Point to recipes that demonstrate
why it is necessary to restore the user narrowing bounds when
redisplay starts.
(Fwiden): Update docstring.
(Fnarrow_to_region): Update docstring.
(Finternal__lock_narrowing): Update docstring.
(Finternal__unlock_narrowing): Update docstring.
(Fsave_restriction): Update docstring.

* src/buffer.c (syms_of_buffer)
<long-line-optimizations-region-size>: Update docstring.
(syms_of_buffer) <long-line-optimizations-bol-search-limit>:
Update docstring.

* lisp/subr.el (with-narrowing): Update docstring.
(without-narrowing): Update docstring.

* etc/NEWS: Mention the 'long-line-optimizations-region-size' and
'long-line-optimizations-bol-search-limit' options.
Announce the 'with-narrowing' and 'without-narrowing' forms.

* doc/lispref/positions.texi (Narrowing): Update the documentation
of 'narrow-to-region', 'widen' and 'save-restriction'.  Document
the 'with-narrowing' and 'without-narrowing' special forms.

* doc/lispref/display.texi (Auto Faces): Update the documentation.

* doc/lispref/commands.texi (Command Overview): Document the fact
that the buffer is narrowed around 'pre-command-hook' and
'post-command-hook' when the buffer text includes very long lines.

22 months agoRename two long line optimizations variables
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Rename two long line optimizations variables

* src/buffer.c (syms_of_buffer): Rename two variables.

* src/xdisp.c (get_locked_narrowing_begv):
(get_locked_narrowing_zv):
(handle_fontified_prop): Use the new names.

* src/keyboard.c (safe_run_hooks_maybe_narrowed): Use the new
names.

22 months agoAdd specific symbols for narrowings
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Add specific symbols for narrowings

* src/xdisp.c (syms_of_xdisp): Define symbol.
(handle_fontified_prop): Use it.

* src/keyboard.c (syms_of_keyboard): Define symbol.
(safe_run_hooks_maybe_narrowed): Use it.

22 months agoAdd 'without-narrowing' macro
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Add 'without-narrowing' macro

* lisp/subr.el (without-narrowing): New macro, companion (and
almost identical) to 'with-narrowing'.

22 months agoMake 'narrowing-lock' and 'narrowing-unlock' internal
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Make 'narrowing-lock' and 'narrowing-unlock' internal

* src/editfns.c (Finternal__lock_narrowing): Renamed from
'narrowing-lock'.
(Finternal__unlock_narrowing): Renamed from 'narrowing-unlock'.
(unwind_narrow_to_region_locked):
(narrow_to_region_locked):
(syms_of_editfns): Use the new names.

* lisp/subr.el (internal--with-narrowing): Use the new name.

22 months agoFix 'save-restriction' for narrowing locks
Gregory Heytings [Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)]
Fix 'save-restriction' for narrowing locks

* src/editfns.c (narrowing_locks_save):
(narrowing_locks_restore): Make them non-static.

* src/lisp.h: Make them externally visible.

* src/bytecode.c (exec_byte_code): Save and restore narrowing
locks.

* lisp/emacs-lisp/bytecomp.el (byte-compile-save-restriction):
Increment unbinding count.

* src/comp.c (helper_save_restriction): Save and restore narrowing
locks.

22 months ago* lisp/iimage.el (iimage-mode-buffer): Handle multiple regexps.
LensPlaysGames [Wed, 8 Feb 2023 18:56:48 +0000 (20:56 +0200)]
* lisp/iimage.el (iimage-mode-buffer): Handle multiple regexps.

Go to the beginning of the buffer before searching every regexp in
iimage-mode-image-regex-alist.

Copyright-paperwork-exempt: yes

22 months ago; Fix memory leak in treesit.c
Eli Zaretskii [Wed, 8 Feb 2023 16:40:50 +0000 (18:40 +0200)]
; Fix memory leak in treesit.c

* src/treesit.c (treesit_load_language): Fix a memory leak.
Reported by Eric Gillespie <epg@pretzelnet.org>.

22 months ago* lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333)
Stefan Monnier [Tue, 7 Feb 2023 23:10:33 +0000 (18:10 -0500)]
* lisp/edmacro.el (edit-kbd-macro): Fix thinko (bug#61333)

Backported from commit 2273cdb40e1939f7c29a669f6a64e6a27738c1a5.

22 months ago; Fix doc strings in iimage.el
Eli Zaretskii [Wed, 8 Feb 2023 12:56:42 +0000 (14:56 +0200)]
; Fix doc strings in iimage.el

* lisp/iimage.el (iimage-mode-image-regex-alist)
(iimage-modification-hook): Doc fixes.

22 months agoFix crashes inside 'xfree' called from treesit.c
Eli Zaretskii [Tue, 7 Feb 2023 19:53:05 +0000 (21:53 +0200)]
Fix crashes inside 'xfree' called from treesit.c

* src/treesit.c (treesit_load_language): Always xstrdup 'c_name',
to avoid crashes inside xfree.  (Bug#61351)

22 months agoMake java-ts-mode use the c-ts-common-indent-type-regexp-alist
Yuan Fu [Tue, 7 Feb 2023 02:48:04 +0000 (18:48 -0800)]
Make java-ts-mode use the c-ts-common-indent-type-regexp-alist

* lisp/progmodes/java-ts-mode.el:
(java-ts-mode): Setup c-ts-common-indent-type-regexp-alist.

22 months agoFix c-ts-mode indentation
Yuan Fu [Mon, 6 Feb 2023 03:32:24 +0000 (19:32 -0800)]
Fix c-ts-mode indentation

Sign, ok, there's another edge case: else if statements.  Because
"else if" is usually implemented as just another if statement nested
in the else branch, this creates additional levels that indentation
needs to ignore.

I converted c-ts-common-indent-block-type-regexp +
c-ts-common-indent-bracketless-type-regexp into a new, more flexible
variable, c-ts-common-indent-type-regexp-alist, to avoid adding yet
more variables in order to recognize else and if statements.

* lisp/progmodes/c-ts-common.el:
(c-ts-common-indent-type-regexp-alist): New variable.
(c-ts-common-indent-block-type-regexp)
(c-ts-common-indent-bracketless-type-regexp): Remove variables.
(c-ts-common--node-is): New function.
(c-ts-common-statement-offset): Use the new variable, and add the
"else if" special case.  Also merge the code of
c-ts-mode--fix-bracketless-indent, because now the code is much more
succinct.
(c-ts-mode--fix-bracketless-indent): Merge into
c-ts-common-statement-offset.

* lisp/progmodes/c-ts-mode.el:
(c-ts-base-mode): Setup c-ts-common-indent-type-regexp-alist.

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

22 months agoFix c-ts-mode indentation
Yuan Fu [Mon, 6 Feb 2023 01:05:21 +0000 (17:05 -0800)]
Fix c-ts-mode indentation

Turns out I shouldn't have removed the explicit rules.  Anyway, now it
indents properly.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add rules.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add tests

22 months agoFix c-ts-mode indentation (bug#61291)
Yuan Fu [Sun, 5 Feb 2023 23:20:52 +0000 (15:20 -0800)]
Fix c-ts-mode indentation (bug#61291)

Fix indentation for the semicolon in

while (str_a[i++] == str_b[j++])
  ;

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

22 months ago(eglot-completion-at-point): Return correct values in :company-kind
Dmitry Gutov [Mon, 6 Feb 2023 22:28:25 +0000 (00:28 +0200)]
(eglot-completion-at-point): Return correct values in :company-kind

* lisp/progmodes/eglot.el (eglot-completion-at-point): Return the
correct values in :company-kind for "EnumMember" and "TypeParameter".
The convention is to use kebab case rather than plain downcasing.
Reported in https://github.com/company-mode/company-mode/issues/1370.

22 months agoTighten and simplify typescript compilation-mode regexps (bug#61104)
Mattias Engdegård [Mon, 6 Feb 2023 10:45:33 +0000 (11:45 +0100)]
Tighten and simplify typescript compilation-mode regexps (bug#61104)

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Tighten regexps and simplify.  Translate to rx.
* etc/compilation.txt: Add examples.

In collaboration with Jostein Kjønigsen.

22 months ago; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibling): Declare.
Eli Zaretskii [Mon, 6 Feb 2023 16:34:39 +0000 (18:34 +0200)]
; * lisp/progmodes/c-ts-common.el (treesit-node-prev-sibling): Declare.

22 months agoClarify bug-reference-auto-setup-functions docstring.
Tassilo Horn [Mon, 6 Feb 2023 16:09:40 +0000 (17:09 +0100)]
Clarify bug-reference-auto-setup-functions docstring.

* lisp/progmodes/bug-reference.el (bug-reference-auto-setup-functions):
Add clarification to docstring that this variable is for packages, not
for users.

22 months ago* lisp/treesit.el (treesit): Fix shortdoc example form (bug#61318).
Aleksandr Vityazev [Mon, 6 Feb 2023 10:39:10 +0000 (13:39 +0300)]
* lisp/treesit.el (treesit): Fix shortdoc example form (bug#61318).

22 months agoUse c-ts-common-statement-offset in java-ts-mode (bug#61142)
Theodor Thornhill [Sun, 5 Feb 2023 07:49:08 +0000 (08:49 +0100)]
Use c-ts-common-statement-offset in java-ts-mode (bug#61142)

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new
matchers to enable c-ts-common machinery.
(java-ts-mode): Add regexps.
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset): Fix
typo in documentation and use the new if statement helpers.
(c-ts-common-if-statement-regexp): New defvar.
(c-ts-common-nestable-if-statement-p): New defvar.
(c-ts-common--fix-nestable-if-statement): New helper.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add test for
complicated bracket matching indentation.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add indent
rules for bracketless statements.

22 months agoAdd array_initializer to java-ts-mode
Theodor Thornhill [Sun, 5 Feb 2023 07:24:14 +0000 (08:24 +0100)]
Add array_initializer to java-ts-mode

Indent strings inside arrray_initializer one step:

public class Java {
    void foo() {
        return new String[]{
            "foo", // These
            "bar"
        }
    }
}

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
matcher.

22 months agogo-ts-mode: Highlight variable declarations
Dmitry Gutov [Mon, 6 Feb 2023 02:42:12 +0000 (04:42 +0200)]
go-ts-mode: Highlight variable declarations

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Highlight variable declarations in 'definition' feature.

22 months agogo-ts-mode: Fix highlighting of function name in call_expression
Dmitry Gutov [Mon, 6 Feb 2023 02:12:25 +0000 (04:12 +0200)]
go-ts-mode: Fix highlighting of function name in call_expression

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Remove :override from the 'property' rules and move them above
'variable' (bug#61302).  Just like in rust-ts-mode.

22 months agoc-ts-mode: Highlight "property functions" as functions
Dmitry Gutov [Mon, 6 Feb 2023 02:05:19 +0000 (04:05 +0200)]
c-ts-mode: Highlight "property functions" as functions

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
Highlight "property functions" as functions (bug#61302).

22 months agorust-ts-mode: Fix highlighting of function name in call_expression
Dmitry Gutov [Sun, 5 Feb 2023 21:42:18 +0000 (23:42 +0200)]
rust-ts-mode: Fix highlighting of function name in call_expression

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Remove :override from the 'property' rules and move them above
'variable' (bug#61302).

22 months agorust-ts-mode--font-lock-settings: Improve consistency
Dmitry Gutov [Sun, 5 Feb 2023 19:34:12 +0000 (21:34 +0200)]
rust-ts-mode--font-lock-settings: Improve consistency

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings):
Remove the rule that highlighted scope identifier in a function call
as type.  The existing rules will handle it when it does look like a
type (capitalized).

22 months agoMake sure 'M-x show-paren-local-mode' turns on right away
Dmitry Gutov [Sun, 5 Feb 2023 19:07:45 +0000 (21:07 +0200)]
Make sure 'M-x show-paren-local-mode' turns on right away

* lisp/paren.el (show-paren--enabled-p): Extract from
'show-paren-function'.
(show-paren-local-mode): Use it in the :variable getter (bug#61098).

22 months agoAdd to bug-reference-auto-setup-functions after its declaring defvar
Tassilo Horn [Sun, 5 Feb 2023 18:54:17 +0000 (19:54 +0100)]
Add to bug-reference-auto-setup-functions after its declaring defvar

If it's the init-value of the defvar, add-hook from a third-party
package will suppress the default functions if it takes place before
bug-reference is loaded.

* lisp/progmodes/bug-reference.el (bug-reference-auto-setup-functions):
Add to bug-reference-auto-setup-functions after its declaring defvar.

22 months ago* lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (bug#61256).
Juri Linkov [Sun, 5 Feb 2023 18:23:57 +0000 (20:23 +0200)]
* lisp/vc/vc.el (vc-find-revision-no-save): Fix parens (bug#61256).

Move '(setq failed nil)' from UNWINDFORMS of 'unwind-protect' to BODYFORM.

22 months ago; Fix byte-compilation warning
Eli Zaretskii [Sun, 5 Feb 2023 17:10:39 +0000 (19:10 +0200)]
; Fix byte-compilation warning

* lisp/progmodes/rust-ts-mode.el (treesit-query-compile): Avoid
byte-compilation warning.

22 months agoFix inability to turn show-paren-local-mode on manually (bug#61098)
Dmitry Gutov [Sun, 5 Feb 2023 17:06:47 +0000 (19:06 +0200)]
Fix inability to turn show-paren-local-mode on manually (bug#61098)

* lisp/paren.el (show-paren-local-mode): Don't kill the local
value when both local and global are t.  Because the
show-paren-predicate check in show-paren-function also checks
whether a local (non-nil) value of this variable exists.

22 months ago; go-ts-mode--indent-rules: Indent to 0 at top level
Dmitry Gutov [Sun, 5 Feb 2023 16:52:57 +0000 (18:52 +0200)]
; go-ts-mode--indent-rules: Indent to 0 at top level

22 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Sun, 5 Feb 2023 16:53:36 +0000 (18:53 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

22 months ago; Fix whitespace of last change
Eli Zaretskii [Sun, 5 Feb 2023 16:52:59 +0000 (18:52 +0200)]
; Fix whitespace of last change

22 months ago; Fix trivial mistake in emoji--choose-emoji
Jonas Bernoulli [Sun, 5 Feb 2023 16:50:10 +0000 (17:50 +0100)]
; Fix trivial mistake in emoji--choose-emoji

* lisp/international/emoji.el (emoji--choose-emoji): The derived
versions are in the cdr not cadr.

22 months ago; * lisp/isearch.el (emoji--read-emoji): Avoid compilation warning.
Eli Zaretskii [Sun, 5 Feb 2023 16:51:11 +0000 (18:51 +0200)]
; * lisp/isearch.el (emoji--read-emoji): Avoid compilation warning.

22 months agorust-ts-mode: Highlight variable declarations
Dmitry Gutov [Sun, 5 Feb 2023 16:49:24 +0000 (18:49 +0200)]
rust-ts-mode: Highlight variable declarations

(rust-ts-mode--font-lock-settings): Change scoped_type_identifier
highlight to match similar cases.  Highlight variable declarations
inside all kinds of destructuring patterns, not just function
definitions.
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--fontify-pattern):
Rename from 'rust-ts-mode--fontify-parameter'.  Check the id node's
parent to avoid touching type identifiers.

22 months agorust-ts-mode--indent-rules: Indent to 0 at top level
Dmitry Gutov [Sun, 5 Feb 2023 16:19:04 +0000 (18:19 +0200)]
rust-ts-mode--indent-rules: Indent to 0 at top level

22 months ago; Move misplaces parenthesis in emoji--choose-emoji
Jonas Bernoulli [Sun, 5 Feb 2023 16:19:15 +0000 (17:19 +0100)]
; Move misplaces parenthesis in emoji--choose-emoji

* lisp/international/emoji.el (emoji--choose-emoji): Move misplaced
parenthesis.

22 months agoEnsure upper bound of font-lock region is less than point-max
Alan Mackenzie [Sun, 5 Feb 2023 15:59:44 +0000 (15:59 +0000)]
Ensure upper bound of font-lock region is less than point-max

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.

22 months ago; * lisp/paren.el (show-paren-predicate): Doc fix. (Bug#61098)
Eli Zaretskii [Sun, 5 Feb 2023 15:27:43 +0000 (17:27 +0200)]
; * lisp/paren.el (show-paren-predicate): Doc fix.  (Bug#61098)

22 months agoHighlight more complex function parameters
Dmitry Gutov [Sun, 5 Feb 2023 14:43:59 +0000 (16:43 +0200)]
Highlight more complex function parameters

* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--fontify-parameter): New function.
(rust-ts-mode--font-lock-settings): Use it.

22 months agoNo longer use transient in isearch-emoji-by-name
Jonas Bernoulli [Wed, 1 Feb 2023 19:25:15 +0000 (20:25 +0100)]
No longer use transient in isearch-emoji-by-name

* 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'.

22 months agoMake highlighting more regular across TS modes (bug#61205)
Dmitry Gutov [Sun, 5 Feb 2023 13:46:28 +0000 (15:46 +0200)]
Make highlighting more regular across TS modes (bug#61205)

* 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.

22 months ago; Improve documentation of 'proper-list-p'
Eli Zaretskii [Sun, 5 Feb 2023 13:15:35 +0000 (15:15 +0200)]
; Improve documentation of 'proper-list-p'

* doc/lispref/lists.texi (Cons Cells): Add cross-reference
to 'proper-list-p' documentation.

22 months agoDocument 'plistp'
Eli Zaretskii [Sun, 5 Feb 2023 12:09:35 +0000 (14:09 +0200)]
Document 'plistp'

* doc/lispref/lists.texi (Property Lists): Document 'plistp'.
(Bug#61293)

22 months agoFix display of raised/lowered composed text
Eli Zaretskii [Sun, 5 Feb 2023 11:57:10 +0000 (13:57 +0200)]
Fix display of raised/lowered composed text

* src/xdisp.c (fill_gstring_glyph_string): Adjust the base line of
the glyph string due to subscript/superscript.  (Bug#61290)

22 months agoFix installation of tree-sitter grammar on MS-Windows
Eli Zaretskii [Sun, 5 Feb 2023 09:14:25 +0000 (11:14 +0200)]
Fix installation of tree-sitter grammar on MS-Windows

* lisp/treesit.el (treesit--install-language-grammar-1): Fix a
failure on MS-Windows when the old DLL is still being used.
(Bug#61289)

22 months agoUpdate the Emacs FAQ for Emacs 29
Eli Zaretskii [Sun, 5 Feb 2023 08:50:12 +0000 (10:50 +0200)]
Update the Emacs FAQ for Emacs 29

* doc/misc/efaq.texi (New in Emacs 29, History of Emacs): Add new
section about Emacs 29.

22 months agoFix byte-compilation of *-ts-mode.el files
Eli Zaretskii [Sun, 5 Feb 2023 06:24:32 +0000 (08:24 +0200)]
Fix byte-compilation of *-ts-mode.el files

* lisp/treesit.el (treesit-font-lock-settings): Move to before
use, to prevent failure in byte-compiling modes which require this
file.  (Bug#61282)

22 months ago; ruby-ts--syntax-propertize: Amend commentary
Dmitry Gutov [Sun, 5 Feb 2023 00:42:52 +0000 (02:42 +0200)]
; ruby-ts--syntax-propertize: Amend commentary

22 months agoMake c-ts-mode-set-style's effect local (bug#61245)
Yuan Fu [Sat, 4 Feb 2023 02:35:33 +0000 (18:35 -0800)]
Make c-ts-mode-set-style's effect local (bug#61245)

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.

22 months ago; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.
Yuan Fu [Fri, 3 Feb 2023 02:54:49 +0000 (18:54 -0800)]
; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.

22 months agoc-ts-mode: Highlight name in parameter declarations
Dmitry Gutov [Sat, 4 Feb 2023 20:46:41 +0000 (22:46 +0200)]
c-ts-mode: Highlight name in parameter declarations

* 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.

22 months agoFix switch statement indentation for go-ts-mode (bug#61238)
Davide Masserut [Thu, 2 Feb 2023 20:00:02 +0000 (21:00 +0100)]
Fix switch statement indentation for go-ts-mode (bug#61238)

* 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.

22 months agoFix bidi reordering of sequence of whitespace characters before a TAB
Eli Zaretskii [Sat, 4 Feb 2023 11:34:42 +0000 (13:34 +0200)]
Fix bidi reordering of sequence of whitespace characters before a TAB

* src/bidi.c (bidi_level_of_next_char): Test the current level
only for characters whose original type is BN.  (Bug#61269)

22 months agoAdd tests for compilation support for TypeScript (bug#61104)
Theodor Thornhill [Fri, 3 Feb 2023 08:05:13 +0000 (09:05 +0100)]
Add tests for compilation support for TypeScript (bug#61104)

* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add new test-cases.
(compile-test-error-regexps): Increase expected errors

22 months agoAdd support for TypeScript compilation to compile.el (bug#61104)
Jostein Kjønigsen [Sat, 28 Jan 2023 14:23:11 +0000 (15:23 +0100)]
Add support for TypeScript compilation to compile.el (bug#61104)

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps.

22 months agoDon't clobber match data in 'y-or-n-p'
Eli Zaretskii [Sat, 4 Feb 2023 08:15:18 +0000 (10:15 +0200)]
Don't clobber match data in 'y-or-n-p'

* lisp/subr.el (y-or-n-p): Avoid clobbering caller's match data.
(Bug#61091)

22 months agoRefine the previous change
Dmitry Gutov [Sat, 4 Feb 2023 02:16:55 +0000 (04:16 +0200)]
Refine the previous change

* 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.

22 months agoAdd syntax-propertize-function to ruby-ts-mode
Dmitry Gutov [Sat, 4 Feb 2023 01:34:22 +0000 (03:34 +0200)]
Add syntax-propertize-function to ruby-ts-mode

* 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.

22 months ago; Fix typos
Stefan Kangas [Fri, 3 Feb 2023 17:02:53 +0000 (18:02 +0100)]
; Fix typos

22 months agoImprove documentation of 'header-line-indent-mode'
Eli Zaretskii [Fri, 3 Feb 2023 14:45:56 +0000 (16:45 +0200)]
Improve documentation of 'header-line-indent-mode'

* 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'.

22 months agoDon't casemap erc-sasl-user when set to :nick
F. Jason Park [Fri, 3 Feb 2023 14:01:04 +0000 (06:01 -0800)]
Don't casemap erc-sasl-user when set to :nick

* 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).

22 months agoImprove keymap-global-set and keymap-local-set interactive use fix
Robert Pluim [Thu, 2 Feb 2023 10:37:45 +0000 (11:37 +0100)]
Improve keymap-global-set and keymap-local-set interactive use fix

* 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)

22 months ago; Fix c-ts-mode indent test
Yuan Fu [Fri, 3 Feb 2023 02:30:11 +0000 (18:30 -0800)]
; Fix c-ts-mode indent test

* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Move the linux
style test case down.

22 months agoMake c-ts-mode indent tests side-effect-free
Yuan Fu [Fri, 3 Feb 2023 02:23:21 +0000 (18:23 -0800)]
Make c-ts-mode indent tests side-effect-free

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.

22 months agoCall treesit_record_change in insert_from_gap_1
Yuan Fu [Fri, 3 Feb 2023 01:22:22 +0000 (17:22 -0800)]
Call treesit_record_change in insert_from_gap_1

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.

22 months agoUse c-ts-common-statement-offset for closing brackets too
Yuan Fu [Thu, 2 Feb 2023 22:57:41 +0000 (14:57 -0800)]
Use c-ts-common-statement-offset for closing brackets too

Merge c-ts-mode--close-bracket-offset into
c-ts-common-statement-offset.

* lisp/progmodes/c-ts-common.el:
(c-ts-common-statement-offset): Handle closing brackets too.
(c-ts-mode--close-bracket-offset): Remove function.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Use
c-ts-common-statement-offset for closing brackets.

22 months ago; Go back to original point when filling comments in c-ts-mode
Yuan Fu [Thu, 2 Feb 2023 22:48:22 +0000 (14:48 -0800)]
; Go back to original point when filling comments in c-ts-mode

* lisp/progmodes/c-ts-common.el:
(c-ts-common--fill-block-comment): Go to original point.

22 months ago; Fix error where we pass t to treesit-node-type in c-ts-common.el
Yuan Fu [Thu, 2 Feb 2023 22:42:42 +0000 (14:42 -0800)]
; Fix error where we pass t to treesit-node-type in c-ts-common.el

* lisp/progmodes/c-ts-common.el:
(c-ts-common-statement-offset): Move the form that sets node to t
down, also add a check for node’s nullness.

22 months ago; * src/treesit.c (treesit_predicate_match): Simplify last change.
Eli Zaretskii [Thu, 2 Feb 2023 19:54:15 +0000 (21:54 +0200)]
; * src/treesit.c (treesit_predicate_match): Simplify last change.

22 months agoMinor improvements in sqlite.c
Eli Zaretskii [Thu, 2 Feb 2023 19:45:44 +0000 (21:45 +0200)]
Minor improvements in sqlite.c

* 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)

22 months ago(treesit_predicate_match): Match node text against regexp without consing
Dmitry Gutov [Thu, 2 Feb 2023 11:32:41 +0000 (13:32 +0200)]
(treesit_predicate_match): Match node text against regexp without consing

* 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.

22 months agoImprove documentation of gdb-mi's dedicated windows
Eli Zaretskii [Thu, 2 Feb 2023 18:49:15 +0000 (20:49 +0200)]
Improve documentation of gdb-mi's dedicated windows

* doc/emacs/building.texi (Other GDB Buffers): Describe the I/O
buffer and commands to show individual specialized windows.
Improve indexing.

22 months agoAvoid spurious pause in kill-ring-save (Bug#60841)
Kévin Le Gouguec [Sun, 29 Jan 2023 10:23:01 +0000 (11:23 +0100)]
Avoid spurious pause in kill-ring-save (Bug#60841)

'indicate-copied-region' checks whether the region is "highlighted"
and if not, briefly moves point to mark to give a visual cue of the
extent of text that was saved to the kill ring.

The region is considered "highlighted" if (a) it is active and (b) its
face specifies a :background.  That latter condition does not account
for the multiple ways in which the face can make the region "visually
distinct" from the default face, so switch to the more extensive
predicate face-differs-from-default-p.

The patch also fixes a couple of issues with the predicate's
implementation, and introduces a new user option in case anyone
happened to enjoy unconditional blinking.

* lisp/faces.el (face-differs-from-default-p): Filter out :extend; add
rationale for the attributes we ignore.
* lisp/simple.el (copy-region-blink-predicate): Add option to let
users explicitly opt into or out of blinking point and mark.
(region-indistinguishable-p): New function to detect
"if there is currently no active region highlighting", leveraging
face-differs-from-default-p.
(indicate-copied-region): Use it.
* src/xfaces.c (merge_face_ref): Allow :stipple to be nil, since it is
a documented valid value for that attribute.
* etc/NEWS: Announce user option.

22 months agoChange the default of 'treesit-defun-tactic' for 'c-ts-mode'
Eli Zaretskii [Thu, 2 Feb 2023 18:21:02 +0000 (20:21 +0200)]
Change the default of 'treesit-defun-tactic' for 'c-ts-mode'

* lisp/progmodes/c-ts-mode.el (c-ts-mode): Set
'treesit-defun-tactic' as appropriate for C.  (Bug#61208)

22 months agoFix docstring fontification of CL's 'defstruct'
Eli Zaretskii [Thu, 2 Feb 2023 18:12:02 +0000 (20:12 +0200)]
Fix docstring fontification of CL's 'defstruct'

* lisp/emacs-lisp/lisp-mode.el (defstruct): Set 'doc-string'
property.  Patch by Nicolas Martyanoff <nicolas@n16f.net>.

Copyright-paperwork-exempt: yes

22 months agoTeach 'hs-minor-mode' about tree-sitter based modes
Eli Zaretskii [Thu, 2 Feb 2023 17:41:09 +0000 (19:41 +0200)]
Teach 'hs-minor-mode' about tree-sitter based modes

* lisp/progmodes/hideshow.el (hs-special-modes-alist): Teach
'hs-minor-mode' about tree-sitter based modes.  (Bug#61232)

22 months ago; Doc fixes in keymap.el
Eli Zaretskii [Thu, 2 Feb 2023 14:14:15 +0000 (16:14 +0200)]
; Doc fixes in keymap.el

* lisp/keymap.el (key-valid-p, key-translate, keymap-lookup)
(define-keymap): Doc fixes.

22 months agoImprove documentation of 'repeat-mode' and related variables
Eli Zaretskii [Thu, 2 Feb 2023 13:34:58 +0000 (15:34 +0200)]
Improve documentation of 'repeat-mode' and related variables

* lisp/bindings.el (next-error-repeat-map)
(page-navigation-repeat-map, undo-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map): Mention repeatable commands in the doc
strings.
* lisp/repeat.el (repeat-exit-timeout, repeat-check-key)
(repeat-echo-function, repeat-mode, repeat-check-key)
(repeat-check-map, repeat-echo-message-string)
(repeat-echo-message, repeat-echo-mode-line)
(describe-repeat-maps): Improve wording of doc strings.
(describe-repeat-maps): Improve wording of the heading line.
(Bug#61183)

* doc/emacs/basic.texi (Repeating): Clarify and improve wording of
'repeat-mode' documentation.

22 months ago; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750).
Eli Zaretskii [Thu, 2 Feb 2023 10:35:16 +0000 (12:35 +0200)]
; * etc/NEWS: Mention the 'utf-8-auto' bugfix (bug#60750).

22 months ago(eshell--complete-commands-list): Fix regression in fix to bug#48995
Nicolas Martyanoff [Thu, 2 Feb 2023 03:17:57 +0000 (22:17 -0500)]
(eshell--complete-commands-list): Fix regression in fix to bug#48995

Copyright-Paperwork-Exempt: Yes

* lisp/eshell/em-cmpl.el (eshell--complete-commands-list):
Fix misuse of `completion-table-dynamic` when completing a file name.

22 months ago* doc/emacs/basic.texi (Repeating): Mention describe-repeat-maps (bug#61183).
Juri Linkov [Wed, 1 Feb 2023 18:05:52 +0000 (20:05 +0200)]
* doc/emacs/basic.texi (Repeating): Mention describe-repeat-maps (bug#61183).

* lisp/repeat.el (describe-repeat-maps): Add more explanation to
the docstring.  Suggested by Robert Pluim <rpluim@gmail.com>.

22 months agoUnbreak the MS-Windows build
Eli Zaretskii [Wed, 1 Feb 2023 12:13:54 +0000 (14:13 +0200)]
Unbreak the MS-Windows build

* src/treesit.c (ts_query_pattern_count) [WINDOWSNT]: Load from
the library and define as macro.

22 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Wed, 1 Feb 2023 04:08:25 +0000 (05:08 +0100)]
; Auto-commit of loaddefs files.

22 months ago; (Ftreesit_query_capture): Fix typo
Dmitry Gutov [Wed, 1 Feb 2023 01:53:38 +0000 (03:53 +0200)]
; (Ftreesit_query_capture): Fix typo

22 months ago(Ftreesit_query_capture): Cache list of predicates for given pattern index
Dmitry Gutov [Wed, 1 Feb 2023 01:45:55 +0000 (03:45 +0200)]
(Ftreesit_query_capture): Cache list of predicates for given pattern index

* src/treesit.c (Ftreesit_query_capture):
Cache list of predicates for given pattern index (bug#60953).

22 months ago* lisp/keymap.el (keymap-global-unset): Correct prompt
Robert Pluim [Tue, 31 Jan 2023 17:17:41 +0000 (18:17 +0100)]
* lisp/keymap.el (keymap-global-unset): Correct prompt

22 months agoFix cursor-in-echo-area on TTY frames
Eli Zaretskii [Tue, 31 Jan 2023 16:03:28 +0000 (18:03 +0200)]
Fix cursor-in-echo-area on TTY frames

* src/dispnew.c (update_frame_1): Fix off-by-one error when
positioning the cursor in the echo-area.  (Bug#61184)

22 months agoUpdate to Transient v0.3.7-196-gb91f509
Jonas Bernoulli [Mon, 30 Jan 2023 21:39:38 +0000 (22:39 +0100)]
Update to Transient v0.3.7-196-gb91f509

22 months agoCC Mode: Fix a coding bug in c-make-keywords-re. This should fix bug #61135
Alan Mackenzie [Mon, 30 Jan 2023 20:02:36 +0000 (20:02 +0000)]
CC Mode: Fix a coding bug in c-make-keywords-re.  This should fix bug #61135

* lisp/progmodes/cc-defs.el (c-make-keywords-re): Generate "\>" components in
result regexp when argument ADORN is `appendable'.  This fully fixes a bug
which was half-fixed on 2019-01-22.

22 months ago* lisp/isearch.el (isearch-emoji-by-name): Disable derived emoji (bug#60740).
Juri Linkov [Mon, 30 Jan 2023 17:39:33 +0000 (19:39 +0200)]
* lisp/isearch.el (isearch-emoji-by-name): Disable derived emoji (bug#60740).

Let-bind emoji--derived to nil to avoid the subsequent selection
of derived emoji that fails in transient.el.

22 months agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Mon, 30 Jan 2023 13:45:54 +0000 (15:45 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

22 months agoFix keymap inheritance in descendants of 'c-ts-base-mode'
Eli Zaretskii [Mon, 30 Jan 2023 13:42:06 +0000 (15:42 +0200)]
Fix keymap inheritance in descendants of 'c-ts-base-mode'

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode-map): Rename from
'c-ts-mode-map'.
(c-ts-base-mode): Adjust accordingly.  (Bug#60983)

22 months agoFix interactive use of `keymap-local-set' and `keymap-global-set'
Robert Pluim [Mon, 30 Jan 2023 09:51:30 +0000 (10:51 +0100)]
Fix interactive use of `keymap-local-set' and `keymap-global-set'

* lisp/keymap.el (keymap-global-set, keymap-local-set): Convert the
read key sequence to a string when called interactively.  Based on a
patch from Stephen Berman <stephen.berman@gmx.net>.  (Bug#61149)