aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Check if treesit-major-mode-remap-alist is bound in ts-modes autoload formsJuri Linkov2025-10-165-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/c-ts-mode.el: * lisp/progmodes/cmake-ts-mode.el: * lisp/progmodes/csharp-mode.el: * lisp/progmodes/dockerfile-ts-mode.el: * lisp/progmodes/elixir-ts-mode.el: * lisp/progmodes/go-ts-mode.el: * lisp/progmodes/heex-ts-mode.el: * lisp/progmodes/java-ts-mode.el: * lisp/progmodes/js.el: * lisp/progmodes/json-ts-mode.el: * lisp/progmodes/lua-ts-mode.el: * lisp/progmodes/php-ts-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-ts-mode.el: * lisp/progmodes/rust-ts-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/typescript-ts-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/markdown-ts-mode.el: * lisp/textmodes/mhtml-ts-mode.el: * lisp/textmodes/toml-ts-mode.el: * lisp/textmodes/yaml-ts-mode.el: In autoload forms replace '(treesit-available-p)' with (boundp 'treesit-major-mode-remap-alist). Calling 'treesit-available-p' in loaddefs.el is too early since the tree-sitter library might not be loaded yet. Checking if 'treesit-major-mode-remap-alist' is bound is equivalent to checking if Emacs is compiled with tree-sitter support. (bug#79622)
* Replace obsolete floatfig package with floatfltArash Esbati2025-10-101-4/+5
| | | | | | | | | | | * doc/misc/reftex.texi (Builtin Label Environments): Mention the floatflt LaTeX package instead of the obsolete floatfig. * lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin): Replace obsolete floatfig entry with floatflt. Add entry for "floatingtable". Fix type indicator for "tabwindow". (reftex-default-label-alist-entries): Use floatflt as well.
* Remove setting of reference formatArash Esbati2025-10-091-2/+2
| | | | | | * lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin): Don't set the reference format for ?f and ?t type indicators in entries of subfig.
* ; (read-string-from-buffer): Fix thinko and typo.Eshel Yaron2025-09-271-4/+2
|
* Fix font lock and cache indent rules in mhtml-ts-modeRoi Martin2025-09-211-39/+50
| | | | | | | | | | | | Fix font lock in mhtml-ts-mode when the required tree-sitter grammars are automatically installed (bug#79363). Also, cache tree-sitter indent rules. * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--treesit-font-lock-settings): Evaluate the rules only after the tree-sitter grammars are installed. (mhtml-ts-mode--treesit-indent-rules): Cache indent rules. (mhtml-ts-mode): Call the new `mhtml-ts-mode--treesit-font-lock-settings' function.
* * lisp/textmodes/mhtml-ts-mode.el: Fix for recent changes in js-ts-mode.Juri Linkov2025-09-181-2/+2
| | | | | | | (mhtml-ts-mode--treesit-font-lock-settings): Replace variable 'js--treesit-font-lock-settings' with the function call. (mhtml-ts-mode--treesit-indent-rules): Replace variable 'js--treesit-indent-rules' with the function call (bug#79363).
* Add tests to ispell.el interactive functionsLockywolf2025-09-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/textmodes/ispell.el (ispell-accept-output): Fix variable init. * test/lisp/textmodes/ispell-resources/fake-aspell-new.bash: Update mock aspell to be able to serve all tests. * test/lisp/textmodes/ispell-tests/ispell-aspell-tests.el: (ispell/aspell/ispell-word/english/correct): Implement. (ispell/aspell/ispell-word/english/incorrect): Implement. (ispell/aspell/ispell-word/english/wrong-language): Implement. * test/lisp/textmodes/ispell-tests/ispell-hunspell-tests.el Fix byte compilation errors. * test/lisp/textmodes/ispell-international-ispell-tests.el Fix byte compilation errors. * test/lisp/textmodes/ispell-tests/ispell-tests-common.el (with-ispell-global-dictionary): Implement a macro to set and restore ispell.el's global dictionary. * test/lisp/textmodes/ispell-tests/ispell-tests.el: (ispell/ispell-buffer-local-words/ispell-words-keyword): Fix CI run. (ispell/ispell-accept-buffer-local-defs/simple): Fix skip condition. (ispell/ispell--run-on-word/default): Fix skip condition. (ispell/ispell-word/default/check-only/correct): Fix global variable. (ispell/ispell-word/default/check-only/correct/add-init): Fix global variable. (ispell/ispell-word/default/check-only/incorrect): Fix skip condition. (ispell/ispell-region/incorrect): Fix postcondition. (ispell/ispell-call-process/simple): Fix emacs path. (ispell/ispell-call-process/simple-writable): Fix emacs path. (ispell/ispell-call-process-region/cat-empty): Fix emacs path. (ispell/ispell-call-process-region/cat-random): Fix emacs path. (ispell/ispell-kill-ispell): Implement. (ispell/ispell/buffer): Implement. (ispell/ispell/region): Implement. (ispell/ispell-change-dictionary): Implement. (ispell/ispell-comments-and-strings/correct): Implement. (ispell/ispell-comments-and-strings/incorrect): Implement. (ispell/ispell-comment-or-string-at-point): Implement. (ispell/ispell-pdict-save): Implement. (ispell/ispell-pdict-save/force): Implement. (ispell/ispell-pdict-save/modified): Implement. (ispell/ispell-pdict-save/unmodified): Implement. (ispell/ispell-lookup-words/simple): Implement. (ispell/ispell-complete-word/ispell-completion-at-point): Implement. (ispell/ispell-complete-word-interior-frag/simple): Implement. (ispell/ispell-minor-mode/simple): Implement. (ispell/ispell-message/correct): Implement. (ispell/ispell-message/incorrect): Implement.
* * lisp/textmodes/markdown-ts-mode.el: Fix embed settings.Juri Linkov2025-08-291-22/+28
| | | | | | | (markdown-ts--range-settings): Move embed settings for html/toml/yaml to 'markdown-ts-setup'. (markdown-ts-setup): Append range rules to 'treesit-range-settings' only when grammars for html/toml/yaml are installed.
* Silence byte-compile warnings when treesit is not availableJuri Linkov2025-08-185-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/c-ts-mode.el: * lisp/progmodes/cmake-ts-mode.el: * lisp/progmodes/csharp-mode.el: * lisp/progmodes/dockerfile-ts-mode.el: * lisp/progmodes/elixir-ts-mode.el: * lisp/progmodes/go-ts-mode.el: * lisp/progmodes/heex-ts-mode.el: * lisp/progmodes/java-ts-mode.el: * lisp/progmodes/js.el: * lisp/progmodes/json-ts-mode.el: * lisp/progmodes/lua-ts-mode.el: * lisp/progmodes/php-ts-mode.el: * lisp/progmodes/ruby-ts-mode.el: * lisp/progmodes/rust-ts-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/typescript-ts-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/markdown-ts-mode.el: * lisp/textmodes/mhtml-ts-mode.el: * lisp/textmodes/toml-ts-mode.el: * lisp/textmodes/yaml-ts-mode.el: Declare 'treesit-major-mode-remap-alist' and 'treesit-language-available-p' to silence warnings that are false alarms. Also improve docstrings.
* New user option 'treesit-enabled-modes' (bug#79180)Juri Linkov2025-08-146-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-enabled-modes): New user option. * src/treesit.c (treesit-major-mode-remap-alist): New variable. * lisp/progmodes/c-ts-mode.el: * lisp/progmodes/csharp-mode.el: * lisp/progmodes/java-ts-mode.el: * lisp/progmodes/js.el: * lisp/progmodes/json-ts-mode.el: * lisp/progmodes/ruby-ts-mode.el: * lisp/progmodes/sh-script.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/mhtml-ts-mode.el: * lisp/textmodes/toml-ts-mode.el: Add ts-mode mapping to 'treesit-major-mode-remap-alist' for ts-modes that already have the corresponding non-ts mode association in 'auto-mode-alist'. * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode-maybe): * lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode-maybe): * lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode-maybe): * lisp/progmodes/go-ts-mode.el (go-ts-mode-maybe) (go-mod-ts-mode-maybe, go-work-ts-mode-maybe): * lisp/progmodes/heex-ts-mode.el (heex-ts-mode-maybe): * lisp/progmodes/lua-ts-mode.el (lua-ts-mode-maybe): * lisp/progmodes/php-ts-mode.el (php-ts-mode-maybe): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode-maybe): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode-maybe) (tsx-ts-mode-maybe): * lisp/textmodes/markdown-ts-mode.el (markdown-ts-mode-maybe): * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-maybe): Add a wrapper function to 'auto-mode-alist' for ts-modes that have no corresponding non-ts mode. Also add a mapping to 'treesit-major-mode-remap-alist' for the case when a non-ts mode is installed from an external source to be able to customize it with 'treesit-enabled-modes'.
* Fix build without tree-sitterPo Lu2025-08-121-1/+2
| | | | | | * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--range-settings): Don't invoke `treesit-language-available-p' unless bound.
* ; Fix last change in mhtml-ts-mode.elEli Zaretskii2025-08-111-1/+1
| | | | | * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--range-settings): Avoid asking about grammar installation when loading. (Bug#79215)
* 'php-ts-mode' depends on 'mhtml-ts-mode' instead of JS,CSS and HTMLVincenzo Pupillo2025-08-101-35/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The direct dependence on 'js-ts-mode', 'css-ts-mode' and html-ts-mode has now been replaced by 'mhtml-ts-mode'. Additional benefits are: 1. Imenu now exposes symbols for all of all languages, 2. navigation now works correctly for all languages, 3. outline works for all languages. Additional new features are: 1. indentation of PHP in mixed buffers with HTML now works much better and allows three different behaviors, an option allows you to choose the behavior. 2. a new feature shows where PHP ini files are both locally and remotely, if the buffer is associated with a remote PHP file. * etc/NEWS: Mention the rationale for those changes, the new command, and the new options. * admin/tree-sitter/treesit-admin.el (treesit-admin--builtin-modes): Added 'mhtml-ts-mode'. (treesit-admin--builtin-features): Added 'mhtml-ts-mode'. * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--range-settings): New variable that store range settings. (mhtml-ts-mode--treesit-aggregated-outline-predicate): New variable that stores outline predicates. (mhtml-ts-mode): Use those two new variables. * lisp/progmodes/php-ts-mode.el: Update doc string. Removed old dependecies. (php-ts-mode--language-source-alist): Updated parsers version. (php-ts-mode-install-parsers): Removed old dependencies, now relies on mhtml-ts-mode-install-parsers'. Update doc string. (php-ts-mode-js-css-indent-offset): Update doc string. (php-ts-mode-css-fontify-colors): Removed option, now relies on 'php-ts-mode-css-fontify-colors'. (php-ts-mode-html-indent-offset): New user option. (php-ts-mode-html-relative-indent): New user option. (php-ts-mode-php-default-executable): Assume "php" instead of "/usr/bin/php" if 'executable-find' fails. (php-ts-mode-php-config): Fix tag. (php-ts-mode-find-sibling-rules): New user option with the rules for finding siblings of a file. (php-ts-mode-phpdoc-highlight-errors): New user option, if non-nil highlight unkown PHPDOC nodes. (php-ts-mode--indent-style-setter): Indentation fix. (php-ts-mode-indent-style): Indentation fix. (php-ts-mode-flymake-php): Indentation fix. (php-ts-mode--executable): Indentation fix. (php-ts-mode-show-ini): New command that show the locations of PHP ini files. (php-ts-mode--get-indent-style): Indentation fix. (php-ts-mode--set-indent-property): Indentation fix. (php-ts-mode-set-style): Indentation fix. (php-ts-mode--get-parser-ranges): Indentation fix. (php-ts-mode--possibly-braceless-keyword-re): Removed no longer used constant. (php-ts-mode--open-statement-group-heuristic): Removed no longer used function. (php-ts-mode--else-heuristic): Indentation fix. (php-ts-mode--first-sibling): Indentation fix. (php-ts-mode--js-css-tag-bol): Function removed, now using 'mhtml-ts-mode--js-css-tag-bol'. (php-ts-mode--parent-html-bol): Removed no longer used function. (php-ts-mode--parent-html-heuristic): Now more reliably handles the mixed indentation of PHP and HTML. The new option 'php-ts-mode-html-relative-indent' changes the behavior of the function. When 'php-ts-mode-html-relative-indent' is 't' the new option 'php-ts-mode-html-indent-offset' controls the offset of PHP code relative to HTML tags. (php-ts-mode--array-element-heuristic): Indentation fix. (php-ts-mode--anchor-prev-sibling): Indentation fix.. (php-ts-mode--indent-styles): The indentation rules for 'program' and text_interpolation' are now common to all indentation styles, thanks to the new version of 'php-ts-mode-arent-html-heuristic'. New rules for 'namespace_use_clause', 'use_declaration', 'use_list', 'attribute_group' and 'string_content'. (php-ts-mode--prettify-symbols-alist): New variable to support 'prettify-symbols-alist'. (php-ts-mode--test-visibility-modifier-operation-clause-p): Rename ... (php-ts-mode--test-visibility-modifier-operation-p): ... to this more correct name. (php-ts-mode--test-property-hook-clause-p): Rename ... (php-ts-mode--test-property-hook-p): ... to this more correct name. (php-ts-mode--test-relative-name-p): New function to test if 'relative_name' is supported by the PHP parser. (php-ts-mode--font-lock-settings): Use the new function for highlight 'relative_name'. Highlight 'error_suppression_expression'. Refactoring using the renamed functions. Indentation fix. (php-ts-mode--custom-html-font-lock-settings): Replace the rules with 'mhtml-ts-mode--treesit-font-lock-settings'. Fix docs string. (php-ts-mode--phpdoc-font-lock-settings): Added support for "array" and "list" array_type. New "phpdoc-error" feature to highlight unknown nodes via new 'php-ts-mode--phpdoc-fontify-error' function. (php-ts-mode--colorize-css-value): Removed function no longer used, now highlighting is handled directly by 'mhtml-ts-mode'. (php-ts-mode--phpdoc-fontify-error): New function used by 'php-ts-mode--phpdoc-font-lock-settings'. (php-ts-mode--parent-object): Indentation fix. (php-ts-mode--defun-name-separator): Indentation fix. (php-ts-mode--defun-object-name): Indentation fix. (php-ts-mode--defun-name): The function now also returns the defun name of 'mhtml-ts-mode'. (php-ts-mode--treesit-defun-type-regexp): New regexp for 'treesit-defun-type-regexp' support. (php-ts-mode--indent-defun): Indentation fix. (php-ts-mode--defun-valid-p): Fix indentation (php-ts-mode--comment-indent-new-line): Indentation fix. (php-ts-mode--comment-current-plist): New local variable that stores the state of the PHP comment style. (php-ts-mode--comment-setup): The function now handles changing, for different languages, comment styles, using "php-ts-mode--comment-current-plist" to store and retrieve the comment style for the PHP language. (php-ts-mode-comment-setup): Now store the PHP comment style in 'php-ts-mode--comment-current-plist'. (php-ts-mode-menu): Indentation fix. (php-ts-mode): Replace dependency from JS, CSS and HTML width 'mhtml-ts-mode'. Navigation, Imenu and Outline now support PHP, HTML, Javascript and CSS. Added support for 'prettify-symbol-mode'. Added support for 'electric-layout-rules'. (php-ts-mode-run-php-webserver, php-ts-mode--webserver-read-args) (php-ts-mode--webserver-read-args, inferior-php-ts-mode, run-php) (inferior-php-ts-mode-startup, php-ts-mode-inferior--write-history) (php-ts-mode-send-region): Indentation fixes. * lisp/treesit.el (treesit-range-rules): Check if treesit is available before compiling a query. (treesit-ensure-installed): Check if treesit is available before trying to ensure if a grammar library is installed. (Bug#78994)
* Revert "`php-ts-mode' depends on `mhtml-ts-mode' instead of JS,CSS and HTML"Eli Zaretskii2025-08-091-43/+35
| | | | | This reverts commit e1fd7b5d89ec7f2df40fa01bf4041c0d1df147b4. It fails the build without treew-sitter.
* `php-ts-mode' depends on `mhtml-ts-mode' instead of JS,CSS and HTMLVincenzo Pupillo2025-08-091-35/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The direct dependence on js-ts-mode, css-ts-mode and html-ts-mode has now been replaced by 'mhtml-ts-mode'. Additional benefits are: 1. Imenu now exposes symbols for all of all languages, 2. navigation now works correctly for all languages, 3. outline works for all languages. Additional new features are: 1. indentation of PHP in mixed buffers with HTML now works much better and allows three different behaviors, an option allows you to choose the behavior. 2. a new feature shows where PHP ini files are both locally and remotely, if the buffer is associated with a remote PHP file. * etc/NEWS: Mention the rationale for those changes, the new command, and the new options. * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--range-settings): New variable that store range settings. (mhtml-ts-mode--treesit-aggregated-outline-predicate): New variable that store outline predicates. (mhtml-ts-mode): Use those two new variables. * lisp/progmodes/php-ts-mode.el: Update doc string. Removed old dependencies. (php-ts-mode--language-source-alist): Updated parsers version. (php-ts-mode-install-parsers): Removed old dependencies, now relies on (mhtml-ts-mode-install-parsers). Update doc string. (php-ts-mode-js-css-indent-offset): Update doc string. (php-ts-mode-css-fontify-colors): Removed option, now relies on 'php-ts-mode-css-fontify-colors'. (php-ts-mode-html-indent-offset): New user option. (php-ts-mode-html-relative-indent): New user option. (php-ts-mode-php-default-executable): Assume \"php\" instead of \"/usr/bin/php\" if 'executable-find' fails. (php-ts-mode-php-config): Fix tag. (php-ts-mode-find-sibling-rules): New user option with the rules for finding siblings of a file. (php-ts-mode-phpdoc-highlight-errors): New user option, if non-nil highlight unkown PHPDOC nodes. (php-ts-mode--indent-style-setter): Indentation fix. (php-ts-mode-indent-style): Indentation fix. (php-ts-mode-flymake-php): Indentation fix. (php-ts-mode--executable): Indentation fix. (php-ts-mode-show-ini): New command that show the locations of PHP ini files. (php-ts-mode--get-indent-style): Indentation fix. (php-ts-mode--set-indent-property): Indentation fix. (php-ts-mode-set-style): Indentation fix. (php-ts-mode--get-parser-ranges): Indentation fix. (php-ts-mode--possibly-braceless-keyword-re): Removed no longer used constant. (php-ts-mode--open-statement-group-heuristic): Removed no longer used function. (php-ts-mode--else-heuristic): Indentation fix. (php-ts-mode--first-sibling): Indentation fix. (php-ts-mode--js-css-tag-bol): Function removed, now using 'mhtml-ts-mode--js-css-tag-bol'. (php-ts-mode--parent-html-bol): Removed no longer used function. (php-ts-mode--parent-html-heuristic): Now more reliably handles the mixed indentation of PHP and HTML. The new option 'php-ts-mode-html-relative-indent' changes the behavior of the function. When 'php-ts-mode-html-relative-indent' is 't' the new option 'php-ts-mode-html-indent-offset' controls the offset of PHP code relative to HTML tags. (php-ts-mode--array-element-heuristic): Indentation fix. (php-ts-mode--anchor-prev-sibling): Indentation fix.. (php-ts-mode--indent-styles): The indentation rules for 'program' and 'text_interpolation' are now common to all indentation styles, thanks to the new version of 'php-ts-mode-arent-html-heuristic'. New rules for 'namespace_use_clause', 'use_declaration', 'use_list', 'attribute_group' and 'string_content'. (php-ts-mode--prettify-symbols-alist): New variable to support 'prettify-symbols-alist'. (php-ts-mode--test-visibility-modifier-operation-clause-p): Rename ... (php-ts-mode--test-visibility-modifier-operation-p): ... to this more correct name. (php-ts-mode--test-property-hook-clause-p): Rename ... (php-ts-mode--test-property-hook-p): ... to this more correct name. (php-ts-mode--test-relative-name-p): New function to test if 'relative_name' is supported by the PHP parser. (php-ts-mode--font-lock-settings): Use the new function for highlight 'relative_name'. Highlight 'error_suppression_expression'. Refactoring using the renamed functions. Indentation fix. (php-ts-mode--custom-html-font-lock-settings): Replace the rules with 'mhtml-ts-mode--treesit-font-lock-settings'. Fix docs string. (php-ts-mode--phpdoc-font-lock-settings): Added support for "array" and "list" array_type. New "phpdoc-error" feature to highlight unknown nodes via new 'php-ts-mode--phpdoc-fontify-error' function. (php-ts-mode--colorize-css-value): Removed function no longer used, now highlighting is handled directly by 'mhtml-ts-mode'. (php-ts-mode--phpdoc-fontify-error): New function used by 'php-ts-mode--phpdoc-font-lock-settings'. (php-ts-mode--parent-object): Indentation fix. (php-ts-mode--defun-name-separator): Indentation fix. (php-ts-mode--defun-object-name): Indentation fix. (php-ts-mode--defun-name): The function now also returns the defun name of 'mhtml-ts-mode'. (php-ts-mode--treesit-defun-type-regexp): New regexp for 'treesit-defun-type-regexp' support. (php-ts-mode--indent-defun): Indentation fix. (php-ts-mode--defun-valid-p): Fix indentation. (php-ts-mode--comment-indent-new-line): Indentation fix. (php-ts-mode--comment-current-plist): New local variable that stores the state of the PHP comment style. (php-ts-mode--comment-setup): The function now handles changing, for different languages, comment styles, using "php-ts-mode--comment-current-plist" to store and retrieve the comment style for the PHP language. (php-ts-mode-comment-setup): Now store the PHP comment style in 'php-ts-mode--comment-current-plist'. (php-ts-mode-menu): Indentation fix. (php-ts-mode): Replace dependency from JS, CSS and HTML width 'mhtml-ts-mode'. Navigation, Imenu and Outline now support PHP, HTML, Javascript and CSS. Added support for 'prettify-symbol-mode'. Added support for 'electric-layout-rules'. (php-ts-mode-run-php-webserver, php-ts-mode--webserver-read-args) (php-ts-mode--webserver-read-args, inferior-php-ts-mode, run-php) (inferior-php-ts-mode-startup, php-ts-mode-inferior--write-history) (php-ts-mode-send-region): Indentation fixes. (Bug#78994)
* Add multi-character pairs to lua-ts-mode and texinfo-modeElías Gabriel Pérez2025-08-091-0/+9
| | | | | | | | | | | | | * etc/NEWS: Add entry for lua-ts-mode changes. * lisp/progmodes/lua-ts-mode.el (lua-ts-auto-close-block-comments): New user option. (lua-ts-mode): Add '--[[ ]]' pairs to 'electric-pair-pairs' only if 'lua-ts-auto-close-block-comments' is non-nil. * lisp/textmodes/texinfo.el (texinfo-mode): Add "`` ''" pairs to 'electric-pair-pairs'. * test/lisp/progmodes/lua-ts-mode-tests.el (lua-ts-test-auto-close-block-comments): Add new test. (Bug#79047)
* bibtex.el - improve last change e6c1ec71b72Roland Winkler2025-07-261-4/+5
| | | | | | * lisp/textmodes/bibtex.el: Use defvar to silence byte compiler * lisp/textmodes/bibtex.el (bibtex-generate-url-list-init): Use setq-local.
* Define setfunction for bibtex-generate-url-list (bug#78798)Roland Winkler2025-07-201-7/+27
| | | | | | | | * lisp/textmodes/bibtex.el (bibtex-generate-url-list-init): New function. * lisp/textmodes/bibtex.el (bibtex-generate-url-list) (bibtex-font-lock-url-regexp): Use it.
* Move some RefTeX 'setq's to major mode definitionPengji Zhang2025-07-142-6/+6
| | | | | | | | | | | Move two 'setq' expressions from the RefTeX label selection loop to the body of the major mode definition, so to make it easier to adjust the settings of the buffer via the mode hook. * lisp/textmodes/reftex-ref.el (reftex-offer-label-menu): Move two 'setq' expressions from here... * lisp/textmodes/reftex-sel.el (reftex-select-label-mode): ...to here. (bug#77335)
* Improve prettification of (La)TeX symbolsPaul Nelson2025-07-141-21/+26
| | | | | | | | * lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Remove entry for "\\newline", which resulted in an invisible display. Prettify "\\ " with OPEN BOX instead of BOTTOM SQUARE BRACKET. (tex--prettify-symbols-compose-p): Skip composition when the control backslash is itself escaped (bug#78752).
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Use \Stefan Monnier2025-07-141-8/+8
| | | | | This is the "standard" way to avoid those indentation problems without relying on funny numbers.
* Update `fill-region-as-paragraph-semlf' to follow fill.el protocolsRoi Martin2025-06-301-54/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the `fill-region-as-paragraph-semlf' function to follow the `fill-region-as-paragraph-function' protocol. This allows us to reimplement the `fill-paragraph-semlf' function using `fill-paragraph' and `fill-region-as-paragraph-function'. * lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Make this function compatible with `fill-region-as-paragraph-function'. Avoid narrowing. (fill-paragraph-semlf): Reimplement using `fill-paragraph' and `fill-region-as-paragraph-function'. * test/lisp/textmodes/fill-tests.el (fill-test-semlf-fill-region): Add test. (fill-test-fill-paragraph-semlf-fill-paragraph-function): Remove test. (fill-test-fill-paragraph-semlf, fill-test-semlf) (fill-test-fill-paragraph-semlf-justify, fill-test-semlf-justify) (fill-test-fill-paragraph-semlf-sentence-end-double-space) (fill-test-semlf-sentence-end-double-space) (fill-test-fill-paragraph-semlf-fill-column, fill-test-semlf-fill-column) (fill-test-fill-paragraph-semlf-punctuation-marks) (fill-test-semlf-punctuation-marks, fill-test-fill-paragraph-semlf-twice) (fill-test-semlf-twice, fill-test-fill-paragraph-semlf-fill-prefix) (fill-test-semlf-fill-prefix) (fill-test-fill-paragraph-semlf-indented-block) (fill-test-semlf-indented-block, fill-test-fill-paragraph-semlf-revert) (fill-test-semlf-revert, fill-test-fill-paragraph-semlf-emacs-lisp-mode) (fill-test-semlf-emacs-lisp-mode, fill-test-fill-paragraph-semlf-c-mode) (fill-test-semlf-c-mode, fill-test-fill-paragraph-semlf-org-mode) (fill-test-semlf-org-mode, fill-test-fill-paragraph-semlf-markdown-mode) (fill-test-semlf-markdown-mode): User shorter function names consistent with erts file names. * test/lisp/textmodes/fill-resources/semlf-fill-region.erts: Add test data. * test/lisp/textmodes/fill-resources/semlf-fill-paragraph-function.erts: Delete file. * test/lisp/textmodes/fill-resources/semlf-emacs-lisp-mode.erts: Remove newlines around indented block. * doc/lispref/text.texi (Filling): Highlight that `fill-region-as-paragraph-function' changes the behavior of `fill-paragraph'.
* Add variable `fill-region-as-paragraph-function'Roi Martin2025-06-291-13/+49
| | | | | | | | | | | | | | | | | | | | | | | Add the variable `fill-region-as-paragraph-function' to provide a way to override how functions like `fill-region' fill text. * doc/lispref/text.texi (Filling): Document `fill-region-as-paragraph-function' variable. * doc/emacs/text.texi (Fill Commands): Reference `fill-region-as-paragraph-function' variable. * lisp/textmodes/fill.el (fill-region-as-paragraph-function): Add variable. (fill-region-as-paragraph): Convert into `fill-region-as-paragraph-function' wrapper. (fill-region-as-paragraph-default): Rename old `fill-region-as-paragraph' function. (fill-region-as-paragraph-semlf): Update calls to `fill-region-as-paragraph-default'. (fill-region): Add reference to `fill-region-as-paragraph-function' in doc string. * test/lisp/textmodes/fill-tests.el (fill-test-fill-region): Add test case for the `fill-region' function. * test/lisp/textmodes/fill-resources/fill-region.erts: Add test data. (Bug#78816)
* 'C-u C-x .' clears the fill prefixSean Whitton2025-06-271-10/+13
| | | | | | | | * lisp/textmodes/fill.el (set-fill-prefix): When called interactively with a prefix argument, clear the fill prefix, just like how 'C-u C-x C-n' clears the goal column. * doc/emacs/text.texi (Fill Prefix): * etc/NEWS: Document the change.
* Fix yaml-ts-mode comment-start-skip to improve commenting/uncommentingJames Cherti2025-06-251-1/+1
| | | | | | | | | | * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): Fix 'comment-start-skip' value to resolve an issue when commenting/uncommenting using the 'comment-or-uncomment-region' function. The previous 'comment-start-skip' value left some "-" uncommented after commenting and uncommenting multiple YAML indented blocks (bug#78892). Copyright-paperwork-exempt: yes
* ; * lisp/textmodes/reftex.el: Update author email (bug#77850).Jeremy Bryant2025-06-241-1/+1
|
* Use keyword :commit with full hashes for treesit-language-source-alist.Juri Linkov2025-06-205-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-language-source-alist): Document the format that uses keywords. (treesit--install-language-grammar-1): Remove args 'revision', 'source-dir', 'cc', 'c++', 'commit'. Use 'args' to process the keywords, and use the remaining list as the previous list of arguments. (treesit--install-language-grammar-1): Let-bind 'treesit--install-language-grammar-full-clone' and 'treesit--install-language-grammar-blobless' to t when 'commit' is non-nil (bug#78542). * lisp/progmodes/c-ts-mode.el: * lisp/progmodes/cmake-ts-mode.el: * lisp/progmodes/csharp-mode.el: * lisp/progmodes/dockerfile-ts-mode.el: * lisp/progmodes/elixir-ts-mode.el: * lisp/progmodes/go-ts-mode.el: * lisp/progmodes/heex-ts-mode.el: * lisp/progmodes/java-ts-mode.el: * lisp/progmodes/js.el: * lisp/progmodes/json-ts-mode.el: * lisp/progmodes/php-ts-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-ts-mode.el: * lisp/progmodes/rust-ts-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/typescript-ts-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/html-ts-mode.el: * lisp/textmodes/markdown-ts-mode.el: * lisp/textmodes/toml-ts-mode.el: * lisp/textmodes/yaml-ts-mode.el: Use the keyword :commit with full hashes instead of tags in 'treesit-language-source-alist'. * lisp/treesit-x.el (define-treesit-generic-mode): Simplify the keyword :copy-queries. (gitattributes-generic-ts-mode, liquid-generic-ts-mode): Add keywords :commit and :copy-queries to :source. * admin/tree-sitter/treesit-admin.el (treesit-admin--unversioned-treesit-language-source-alist): Handle :revision and :commit as well. (treesit-admin--find-latest-compatible-revision): Process the keywords in the recipe.
* Add semantic linefeed support for paragraph fillingRoi Martin2025-06-141-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Add function to fill a region using semantic linefeeds as if it were a single paragraph. (fill-paragraph-semlf): Add function to fill paragraph using semantic linefeeds. * test/lisp/textmodes/fill-tests.el (fill-test-fill-region-as-paragraph-semlf) (fill-test-fill-paragraph-semlf) (fill-test-fill-paragraph-semlf-fill-paragraph-function) (fill-test-fill-paragraph-semlf-justify) (fill-test-fill-paragraph-semlf-sentence-end-double-space) (fill-test-fill-paragraph-semlf-fill-column) (fill-test-fill-paragraph-semlf-punctuation-marks) (fill-test-fill-paragraph-semlf-twice) (fill-test-fill-paragraph-semlf-fill-prefix) (fill-test-fill-paragraph-semlf-indented-block) (fill-test-fill-paragraph-semlf-revert) (fill-test-fill-paragraph-semlf-emacs-lisp-mode) (fill-test-fill-paragraph-semlf-c-mode) (fill-test-fill-paragraph-semlf-org-mode) (fill-test-fill-paragraph-semlf-markdown-mode): Add tests. * test/lisp/textmodes/fill-resources/semlf-c-mode.erts: * test/lisp/textmodes/fill-resources/semlf-emacs-lisp-mode.erts: * test/lisp/textmodes/fill-resources/semlf-fill-column.erts: * test/lisp/textmodes/fill-resources/semlf-fill-paragraph-function.erts: * test/lisp/textmodes/fill-resources/semlf-fill-prefix.erts: * test/lisp/textmodes/fill-resources/semlf-fill-region-as-paragraph.erts: * test/lisp/textmodes/fill-resources/semlf-indented-block.erts: * test/lisp/textmodes/fill-resources/semlf-justify.erts: * test/lisp/textmodes/fill-resources/semlf-markdown-mode.erts: * test/lisp/textmodes/fill-resources/semlf-org-mode.erts: * test/lisp/textmodes/fill-resources/semlf-punctuation-marks.erts: * test/lisp/textmodes/fill-resources/semlf-revert.erts: * test/lisp/textmodes/fill-resources/semlf-sentence-end-double-space.erts: * test/lisp/textmodes/fill-resources/semlf-twice.erts: * test/lisp/textmodes/fill-resources/semlf.erts: Add test data. (Bug#78561)
* ; reftex.el: Checkdoc fixes, comments to docstringsJeremy Bryant2025-05-301-101/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/textmodes/reftex.el (reftex-next-multifile-index): (reftex-TeX-master-file, reftex-is-multi): (reftex-get-cite-format, reftex-ensure-compiled-variables): (reftex-erase-all-selection-and-index-buffers): (reftex-compile-variables, reftex-parse-args): (reftex-access-scan-info, reftex-check-parse-consistency): (reftex-select-external-document, reftex-find-file-externally): (reftex-access-search-path, reftex-find-file-on-path): (reftex-parse-colon-path, reftex-expand-path): (reftex-recursive-directory-list, reftex-typekey-check): (reftex-check-recursive-edit, reftex-no-props): (reftex-match-string, reftex-kill-buffer): (reftex-erase-buffer, reftex-this-word, reftex-all-assq): (reftex-all-assoc-string, reftex-last-assoc-before-elt): (reftex-sublist-nth, reftex-make-selection-buffer-name): (reftex-make-index-buffer-name, reftex-truncate): (reftex-nearest-match, reftex-auto-mode-alist): (reftex-enlarge-to-fit, reftex-select-with-char): (reftex-make-regexp-allow-for-ctrl-m, reftex-visited-files): (reftex-get-file-buffer-force, reftex-kill-temporary-buffers): (reftex-splice-symbols-into-list, reftex-uniquify): (reftex-uniquify-by-car, reftex-nicify-text, reftex-refontify): (reftex-fontify-select-label-buffer): (reftex-select-font-lock-fontify-region): (reftex-verified-face, reftex-highlight-shall-die): Convert comment to docstring in functions. (reftex-silence-toc-markers): Convert comment to docstring and capitalize argument. (reftex-set-cite-format): Capitalize argument. (AUCTeX bug#77864)
* ; RefTeX: Update author emailJeremy Bryant2025-05-0711-11/+11
| | | | | | | | | | | | | | | | | Update Carsten's email across related reftex* files: lisp/textmodes/reftex.el lisp/textmodes/reftex-auc.el lisp/textmodes/reftex-cite.el lisp/textmodes/reftex-dcr.el lisp/textmodes/reftex-global.el lisp/textmodes/reftex-index.el lisp/textmodes/reftex-parse.el lisp/textmodes/reftex-ref.el lisp/textmodes/reftex-sel.el lisp/textmodes/reftex-toc.el lisp/textmodes/reftex-vars.el lisp/textmodes/reftex.el (AUCTeX bug#77850)
* New variable 'comment-setup-function' for multi-language modes.Juri Linkov2025-05-051-2/+21
| | | | | | | | | | | | | | * lisp/newcomment.el (comment-setup-function): New variable. (comment-normalize-vars): Call non-nil 'comment-setup-function'. * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--comment-current-lang): New internal variable. (mhtml-ts-mode--comment-setup): New function. (mhtml-ts-mode): Set 'comment-setup-function' to 'mhtml-ts-mode--comment-setup' instead of using 'c-ts-common-comment-setup' only for JavaScript. https://lists.gnu.org/archive/html/emacs-devel/2025-05/msg00025.html
* Avoid duplication in defining tree-sitter grammar sources.Juri Linkov2025-05-041-18/+5
| | | | | | | | | | | | | | | | | * lisp/progmodes/php-ts-mode.el: Require 'html-ts-mode'. (php-ts-mode--language-source-alist): Remove duplicate source info for html, css, javascript, jsdoc. (php-ts-mode-install-parsers): Install pre-defined grammars. (php-ts-mode): Move 'require' to the top. * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--language-source-alist): Remove variable since 'treesit-language-source-alist' is pre-filled by requiring 'html-ts-mode', 'css-mode', 'js'. (mhtml-ts-mode-install-parsers): Install pre-defined grammars. * test/infra/Dockerfile.emba: Remove 'mhtml-ts-mode' that doesn't define own grammars.
* * lisp/textmodes/markdown-ts-mode.el: Improve.Juri Linkov2025-05-041-10/+9
| | | | | | | | | | | | (markdown-ts-list-marker): Inherit from 'shadow' like in non-ts mode. (markdown-ts-block-quote): Inherit from 'italic' like in non-ts mode. (markdown-ts--treesit-settings): Use 'shadow' for parens in 'markdown-inline' only under 'inline_link' and 'image'. Use @markdown-ts-block-quote for 'block_quote'. Override with 'append' for links. (markdown-ts--range-settings): Use global html parser for 'html_tag' since its ranges are interconnected. (markdown-ts-setup): Create the 'html' parser.
* ; * lisp/textmodes/markdown-ts-mode.el (treesit-node-child): Declare.Eli Zaretskii2025-05-031-0/+1
|
* Embed html, yaml and toml in markdown-ts-mode.Juri Linkov2025-05-013-16/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/textmodes/markdown-ts-mode.el (markdown-ts--treesit-settings): Use @italic on the whole 'block_quote'. (markdown-ts-outline-predicate): New function. (markdown-ts--range-settings): Embed 'yaml' in host 'markdown', embed 'toml' in host 'markdown', embed 'html' in host 'markdown-inline', and use local 'html_block'. (markdown-ts-setup): Append html/yaml/toml to treesit-font-lock-settings and treesit-font-lock-feature-list when their grammars are ready. (markdown-ts-mode): Set comment-start/comment-end. Set treesit-outline-predicate to 'markdown-ts-outline-predicate'. * lisp/textmodes/toml-ts-mode.el (toml-ts-mode--font-lock-feature-list): New variable. (toml-ts-mode): Use it. * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--font-lock-feature-list): New variable. (yaml-ts-mode): Use it. (yaml-ts-mode--outline-nodes): New variable. (yaml-ts-mode--outline-predicate): Use it. * lisp/treesit-x.el (liquid-generic-ts-mode): Use 'treesit-ready-p' on optional 'yaml' grammar. Merge 'yaml-ts-mode--font-lock-feature-list'.
* Avoid adding duplicate items to 'treesit-language-source-alist'.Juri Linkov2025-05-011-3/+2
| | | | | | | | | | | | | | * lisp/textmodes/mhtml-ts-mode.el: * lisp/progmodes/php-ts-mode.el: Use 'add-to-list' on items in language-source-alist that should check for duplicate items. * test/infra/Dockerfile.emba: Move multi-language mhtml-ts-mode and php-ts-mode to the end to give their dependent grammars a lower priority. * test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation): Skip the test when 'jsdoc' is missing since 'js-ts-mode' depends on the 'jsdoc' grammar.
* Merge from origin/emacs-30Eli Zaretskii2025-04-301-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | cc5b1a01a2c ; * doc/misc/efaq-w32.texi (Location of init file): Fix a... 6c2aaedfceb Fix compilation errors in emacsclient.c with MinGW GCC 15 d56e5ba97ee ; * etc/DEBUG: Add link to GCC bug #78685. 80cbd1e31cc ; Fix key notation in Introduction to Emacs Lisp 1224e5fd961 ; * lisp/files.el (revert-buffer-restore-functions): Doc ... 79e7eeb3296 ; Improve documentation of 'format-time-string' 2838b64fc8b ; * lisp/textmodes/text-mode.el (text-mode-variant): Fix ... 9adb05422ea ; Improve obsolescence of 'text-mode-variant' 4858d818488 ; * lisp/files.el (revert-buffer-restore-functions): Doc ... 2a8e223b8d7 ; Mention early-init file in Emacs FAQ for Windows 14c707b42d9 ; Isearch: Fix key bindings in docstrings
| * ; * lisp/textmodes/text-mode.el (text-mode-variant): Fix last change.Eli Zaretskii2025-04-291-1/+1
| |
| * ; Improve obsolescence of 'text-mode-variant'Eli Zaretskii2025-04-291-1/+3
| | | | | | | | | | | | | | | | * lisp/textmodes/text-mode.el (text-mode-variant): Improve obsolescence announcement text. * doc/lispref/modes.texi (Example Major Modes): Update example. (Bug#78125).
* | ; Fix compilation warning in string-edit.elEli Zaretskii2025-04-261-3/+3
| | | | | | | | | | * lisp/textmodes/string-edit.el (string-edit): Avoid shadowing the global 'major-mode'.
* | Improve help-fns-edit-variable for Lisp editingSpencer Baugh2025-04-261-24/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before d50c82f3e98e ("Simplify 'help-enable-variable-value-editing' using 'string-edit'"), 'help-fns-edit-variable' would open a buffer in 'emacs-lisp-mode' and would not allow exiting that buffer with an invalid Lisp expression. Restore that functionality by enhancing 'string-edit' to allow choosing a major mode and allow passing a function to validate the buffer contents before returning. * lisp/help-fns.el (help-fns-edit-variable): Call 'string-edit', passing 'emacs-lisp-mode' and 'read'. * lisp/textmodes/string-edit.el (string-edit--read): Add. (string-edit): Add :major-mode and :read arguments and avoid passive voice. (read-string-from-buffer): Avoid passive voice in docs. (string-edit-mode-map, string-edit-minor-mode-map) (string-edit-mode, string-edit-minor-mode): Move 'string-edit' keybindings to a minor mode. (string-edit-done): Call 'string-edit--read' before exiting. (Bug#77834)
* | Fix 'yaml-ts-mode' filling of comments (Bug#77095)Randy Taylor2025-04-261-12/+16
| | | | | | | | | | | | * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--fill-paragraph): Handle comment filling differently than block_scalars. (yaml-ts-mode): Set 'comment-start-skip'.
* | Revert addition of electric-block-comment-mode & follow-up commitsSean Whitton2025-04-222-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As presently under discussion in bug#77823, the intended new functionality is not really about comments at all. Remove it for now to allow us to redesign from a clean slate, and to deal with the regression reported in bug#77823. This reverts the following three changesets: Author: Elías Gabriel Pérez <eg642616@gmail.com> AuthorDate: Mon Mar 17 12:56:52 2025 -0600 New minor mode: `electric-block-comment-mode' Author: Elías Gabriel Pérez <eg642616@gmail.com> AuthorDate: Mon Mar 31 17:58:16 2025 -0600 Add block-comment-start and block-comment-end to supported modes Author: Elías Gabriel Pérez <eg642616@gmail.com> AuthorDate: Sun Apr 13 12:26:08 2025 -0600 Add block-comment variables to cc-mode
* | Fix parens inside links in markdown-ts--treesit-settings.Juri Linkov2025-04-181-0/+1
| | | | | | | | | | | | * lisp/textmodes/markdown-ts-mode.el (markdown-ts--treesit-settings): Override paren delimiter inside inline link. https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00655.html
* | Lock tree-sitter language grammars to verified versions.Juri Linkov2025-04-186-18/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/notes/tree-sitter/build-module/build.sh: Update org for toml/yaml. * admin/tree-sitter/treesit-admin.el (treesit-admin--builtin-language-sources): Add verified versions. * lisp/progmodes/c-ts-mode.el: Append language source to treesit-language-source-alist. (c-ts-mode, c++-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/cmake-ts-mode.el: Append language source to treesit-language-source-alist. (cmake-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/csharp-mode.el: Append language source to treesit-language-source-alist. (csharp-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/dockerfile-ts-mode.el: Append language source to treesit-language-source-alist. (dockerfile-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/elixir-ts-mode.el: Append language source to treesit-language-source-alist. (elixir-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/go-ts-mode.el: Append language source to treesit-language-source-alist. (go-ts-mode, go-mod-ts-mode, go-work-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/heex-ts-mode.el: Append language source to treesit-language-source-alist. (heex-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/java-ts-mode.el: Append language source to treesit-language-source-alist. (java-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/js.el: Append language source to treesit-language-source-alist. (js-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/json-ts-mode.el: Append language source to treesit-language-source-alist. (json-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/lua-ts-mode.el: Append language source to treesit-language-source-alist. (lua-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist): Update versions from comments in ts-modes. Append to treesit-language-source-alist. (php-ts-mode-install-parsers): Use treesit-language-source-alist directly. (php-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/ruby-ts-mode.el: Append language source to treesit-language-source-alist. (ruby-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/rust-ts-mode.el: Append language source to treesit-language-source-alist. (rust-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/sh-script.el: Append language source to treesit-language-source-alist. (bash-ts-mode): Use treesit-ensure-installed. * lisp/progmodes/typescript-ts-mode.el: Append language source to treesit-language-source-alist. (typescript-ts-mode, tsx-ts-mode): Use treesit-ensure-installed. * lisp/textmodes/css-mode.el: Append language source to treesit-language-source-alist. (css-ts-mode): Use treesit-ensure-installed. * lisp/textmodes/html-ts-mode.el: Append language source to treesit-language-source-alist. (html-ts-mode): Use treesit-ensure-installed. * lisp/textmodes/markdown-ts-mode.el: Append language source to treesit-language-source-alist. (markdown-ts-mode): Use treesit-ensure-installed. * lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--language-source-alist): Append to treesit-language-source-alist. (mhtml-ts-mode-install-parsers): Use treesit-language-source-alist directly. (mhtml-ts-mode): Use treesit-ensure-installed. * lisp/textmodes/toml-ts-mode.el: Append language source to treesit-language-source-alist. (toml-ts-mode): Use treesit-ensure-installed. * lisp/textmodes/yaml-ts-mode.el: Append language source to treesit-language-source-alist. (yaml-ts-mode): Use treesit-ensure-installed. * test/infra/Dockerfile.emba: Add verified versions to treesit-language-source-alist.
* | * lisp/textmodes/markdown-ts-mode.el: More ts-modes for code blocks.Juri Linkov2025-04-161-4/+32
| | | | | | | | | | | | | | | | (markdown-ts--code-block-language-map): Add more aliases. (markdown-ts-code-block-source-mode-map): Add more mappings for existing core ts-modes. (markdown-ts--convert-code-block-language): Check 'lang-string' with 'symbolp'. Check 'mode' with 'fboundp'.
* | ; Fix documentation of a recent commitEli Zaretskii2025-04-161-13/+13
| | | | | | | | | | | | | | | | | | | | * lisp/textmodes/markdown-ts-mode.el (markdown-ts-delimiter) (markdown-ts-heading-1, markdown-ts-setext-heading) (markdown-ts-heading-2, markdown-ts-heading-3) (markdown-ts-heading-4, markdown-ts-heading-5) (markdown-ts-heading-6, markdown-ts-list-marker) (markdown-ts-block-quote, markdown-ts-language-keyword) (markdown-ts--configured-languages): Doc fixes.
* | Expand markdown-ts-mode and add code block support for javascriptYuan Fu2025-04-151-27/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Define new faces and use them in place of font-lock faces - Add more fontification, add a new feature for headings. - Remove fontification for code blocks, so embedeed parser can fontify them - Add experimental code block support for javascript by using tree-sitter setup from js-ts-mode. - Correctly setup markdown_inline with range settings. * lisp/textmodes/markdown-ts-mode.el: (markdown-ts--code-block-language-map): (markdown-ts-code-block-source-mode-map): New variables. (markdown-ts-faces): New group. (markdown-ts-delimiter): (markdown-ts-heading-1): (markdown-ts-setext-heading): (markdown-ts-heading-2): (markdown-ts-heading-3): (markdown-ts-heading-4): (markdown-ts-heading-5): (markdown-ts-heading-6): (markdown-ts-list-marker): (markdown-ts-block-quote): (markdown-ts-language-keyword): New faces. (markdown-ts--treesit-settings): (markdown-ts--configured-languages): New variables. (markdown-ts--harvest-treesit-configs): (markdown-ts--add-config-for-mode): (markdown-ts--convert-code-block-language): New functions. (markdown-ts--range-settings): New variable. (markdown-ts-setup): Setup range configuration. (markdown-ts-mode): Add heading feature.
* | Add block-comment-start and block-comment-end to supported modesElías Gabriel Pérez2025-04-132-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Add block-comment-start and block-comment-end from here... * lisp/newcomment.el (block-comment-start, block-comment-end):... * lisp/nxml/nxml-mode.el (nxml-mode):... * lisp/progmodes/c-ts-common.el (c-ts-common-comment-setup):... * lisp/progmodes/go-ts-mode.el (go-work-ts-mode):... * lisp/progmodes/js.el (js--mode-setup):... * lisp/progmodes/json-ts-mode.el (json-ts-mode):... * lisp/progmodes/lua-ts-mode.el (lua-ts-mode):... * lisp/progmodes/opascal.el (opascal-mode):... * lisp/progmodes/pascal.el (pascal-mode):... * lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode):... * lisp/textmodes/css-mode.el (css-base-mode, scss-mode):... * lisp/textmodes/sgml-mode.el (sgml-mode): ... to here. (Bug#77424)
* | New command 'treesit-toggle-sexp-mode' (bug#76676).Juri Linkov2025-04-092-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-forward-sexp): Don't use 'treesit-sexp-type-regexp' reserved for list commands to override their default 'list' thing. (treesit-down-list, treesit-up-list): Use 'treesit-sexp-type-regexp' instead of 'list' when it's non-nil. (treesit-toggle-sexp-mode): New command. * lisp/progmodes/c-ts-mode.el (c-ts-mode--thing-settings): Improve 'sexp' thing settings to exclude the top-level "translation_unit" that just moves to EOF and also "comment". * lisp/progmodes/elixir-ts-mode.el (elixir-ts--sexp-regexp): Remove. (elixir-ts--forward-sexp): Remove to use the default 'sexp' navigation. (elixir-ts--with-parens-0-p, elixir-ts--with-parens-1-p): New internal functions. (elixir-ts-mode): Add 'treesit-thing-settings' instead of 'forward-sexp-function' (bug#76788). * lisp/progmodes/heex-ts-mode.el (heex-ts--sexp-regexp): Remove. (heex-ts--forward-sexp): Remove to use the default 'sexp' navigation. (heex-ts--thing-settings): New variable. (heex-ts-mode): Use 'heex-ts--thing-settings' instead of 'forward-sexp-function'. * lisp/progmodes/java-ts-mode.el (java-ts-mode): Improve 'sexp' thing to use settings like in c-ts-mode. * lisp/progmodes/php-ts-mode.el (php-ts-mode): Improve 'sexp' thing settings to exclude the top-level "program" that just moves to EOF and also "comment". * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Improve 'sexp' thing to use settings like in c-ts-mode. * lisp/textmodes/css-mode.el (css--treesit-thing-settings): Add 'sexp' thing. Add "string_value" to 'text' thing. * lisp/textmodes/html-ts-mode.el (html-ts-mode--treesit-things-settings): Improve 'sexp' thing to use settings like in c-ts-mode. Add "doctype" to the 'list' thing.