1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-15 19:31:29 -07:00
Commit graph

4411 commits

Author SHA1 Message Date
Stefan Monnier
e2004eb56f Merge remote-tracking branch 'origin/scratch/error-API' 2026-03-15 17:17:21 -04:00
Eli Zaretskii
17aa3a7e13 ; Fix last change
* lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify):
Fix capitalization and whitespace of last change.
2026-03-14 12:46:19 +02:00
Timon Reinold
87d13146b2 Fix auto-correct previous word with 'flyspell-prog-mode'
* lisp/textmodes/flyspell.el (flyspell-generic-progmode-verify):
Take into account the word 'flyspell-auto-correct-previous-word'
moved to (i.e., the word starting at point, not the character
before point), when checking whether it should be checked/corrected
by flyspell-prog-mode.  (Bug#80289)

Copyright-paperwork-exempt: yes
2026-03-14 12:43:35 +02:00
Stefan Monnier
9348c19b82 Use single-arg form of signal to re-throw an error
* lisp/vc/smerge-mode.el (smerge-extend):
* lisp/vc/diff-mode.el (diff-beginning-of-file-and-junk):
* lisp/transient.el (transient--with-emergency-exit):
* lisp/textmodes/tex-mode.el (latex-forward-sexp):
* lisp/tar-mode.el (tar-mode):
* lisp/savehist.el (savehist--reload):
* lisp/progmodes/octave.el (inferior-octave-resync-dirs):
* lisp/progmodes/js.el (js--re-search-forward):
* lisp/plstore.el (plstore--decrypt):
* lisp/net/dbus.el (dbus-ignore-errors, dbus-register-signal)
(dbus-handle-event):
* lisp/mouse.el (mouse-drag-track, mouse-drag-region-rectangle):
* lisp/minibuffer.el (completion-pcm--find-all-completions):
* lisp/mail/rfc2231.el (rfc2231-parse-string):
* lisp/mail/rfc2047.el (rfc2047-encode-region):
* lisp/jit-lock.el (jit-lock-fontify-now):
* lisp/international/ja-dic-utl.el (skkdic-lookup-key):
* lisp/gnus/nnselect.el (nnselect-generate-artlist):
* lisp/gnus/mml-sec.el (mml-secure-epg-encrypt, mml-secure-epg-sign):
* lisp/gnus/mail-source.el (mail-source-fetch-pop)
(mail-source-check-pop):
* lisp/gnus/gnus-art.el (gnus-article-read-summary-keys):
* lisp/files.el (basic-save-buffer-2, files--ensure-directory)
(files--force, copy-directory):
* lisp/eshell/esh-io.el (eshell-output-object-to-target):
* lisp/epa.el (epa-decrypt-file, epa-verify-file, epa-sign-file)
(epa-encrypt-file, epa-decrypt-region, epa-verify-region)
(epa-sign-region, epa-encrypt-region, epa-delete-keys)
(epa-export-keys, epa-insert-keys):
* lisp/emacs-lisp/package.el (package--unless-error):
* lisp/emacs-lisp/multisession.el (multisession--read-file-value):
* lisp/emacs-lisp/lisp.el (up-list-default-function):
* lisp/desktop.el (desktop-kill):
* lisp/calendar/time-date.el (date-to-time):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calc/calc.el (calc-do):
* lisp/bookmark.el (bookmark-handle-bookmark):
* src/fileio.c (report_file_errno):
* lisp/vc/vc.el (vc-checkout, vc-pull): Use `(signal err)` instead
of `(signal (car err) (cdr err))`.
2026-03-10 10:48:22 -04:00
Sean Whitton
a61d25d411 unfill-paragraph: Use most-positive-fixnum
* lisp/textmodes/fill.el (unfill-paragraph): Use
most-positive-fixnum.
2026-03-10 11:57:49 +00:00
Eli Zaretskii
c108a28203 Fix 'emacs-news-find-heading'
* lisp/textmodes/emacs-news-mode.el (emacs-news-find-heading):
HEADING must be a complete line, otherwise we have false positives
and false negatives.  (Bug#80569)
2026-03-09 19:14:51 +02:00
Eli Zaretskii
139fb8423f ; Fix documentation of 'emacs-news-mode' commands
* lisp/textmodes/emacs-news-mode.el (emacs-news-next-untagged-entry)
(emacs-news-previous-untagged-entry, emacs-news-cycle-tag)
(emacs-news-count-untagged-entries, emacs-news-goto-section)
(emacs-news-find-heading, emacs-news-open-line)
(emacs-news-delete-temporary-markers): Doc fixes.  (Bug#80569)
2026-03-08 20:12:17 +02:00
Sean Whitton
467069635b * lisp/textmodes/fill.el (unfill-paragraph): Fix for wide chars. 2026-03-08 14:55:10 +00:00
Sean Whitton
d7fda971f1 unfill-paragraph: Reimplement in terms of fill-region
* lisp/textmodes/fill.el (unfill-paragraph): Reimplement in
terms of fill-region.
2026-03-05 16:14:43 +00:00
Sean Whitton
39abb7ec8f ; Move unfill-paragraph to fill.el. Document it in (elisp)Filling. 2026-03-05 15:48:03 +00:00
Sean Whitton
7d63d267f2 Rename 'any' to 'member-if' and deprecate 'cl-member-if'
* lisp/subr.el (any): Rename from this ...
(member-if): ... to this.  All uses changed.
(any): New function alias.
* lisp/emacs-lisp/cl-seq.el (cl-member-if): Mark obsolete.
* lisp/obsolete/cl.el (member-if): Delete obsolete function
alias.
* doc/lispref/lists.texi (List Elements):
* doc/misc/cl.texi (Lists as Sets):
* etc/NEWS: Document the change.
2026-03-04 14:43:05 +00:00
Mattias Engdegård
7eba545a4e Revert "Rename 'any' to 'member-if' and deprecate 'cl-member-if'"
This reverts commit 2bdf15f6d8.

There is no consensus for this change.
2026-03-03 17:21:35 +01:00
Sean Whitton
2bdf15f6d8 Rename 'any' to 'member-if' and deprecate 'cl-member-if'
* lisp/subr.el (any): Rename from this ...
(member-if): ... to this.  All uses changed.
Implement '&key KEY-FN' for backwards compatibility.
(any): New function alias.
* lisp/emacs-lisp/cl-seq.el (cl-member-if): Make an alias for
'member-if'.
* lisp/obsolete/cl.el (member-if): Delete obsolete function
alias.
* doc/lispref/lists.texi (List Elements):
* doc/misc/cl.texi (Lists as Sets):
* etc/NEWS: Document the change.
2026-03-03 13:57:07 +00:00
Stefan Monnier
3a2a095dff Fix broken FOO-mode-indent-offset convention
Variable names to control indentation have never been
standardized, but over the years some conventions have naturally
arisen, mostly the use of `FOO-indent-offset`,
`FOO-basic-offset`, or `FOO-indent-level` for `FOO-mode`.

When the new TS modes were introduced, a mistake was made that
I failed to catch at the time, where those modes used
`FOO-mode-indent-offset` instead of the "standard" `FOO-indent-offset`.
In order to save packages like `editorconfig-mode` and `indent-bars-mode`
from having to cater to yet-another-convention, rename those
vars to what they should have been all along.

* lisp/editorconfig.el (editorconfig-indentation-alist): Remove the
ad-hoc entries for the deviating modes using `FOO-mode-indent-offset`.

* lisp/textmodes/toml-ts-mode.el (toml-ts-indent-offset):
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-js-css-indent-offset)
(mhtml-ts--js-css-indent-offset):
* lisp/textmodes/html-ts-mode.el (html-ts-indent-offset):
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-indent-offset):
* lisp/progmodes/php-ts-mode.el (php-ts-indent-offset)
(php-ts-js-css-indent-offset, php-ts-html-indent-offset):
* lisp/progmodes/json-ts-mode.el (json-ts-indent-offset):
* lisp/progmodes/java-ts-mode.el (java-ts-indent-offset)
(java-ts-method-chaining-indent-offset):
* lisp/progmodes/go-ts-mode.el (go-ts-indent-offset):
* lisp/progmodes/csharp-mode.el (csharp-ts-indent-offset):
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-indent-offset):
* lisp/progmodes/c-ts-mode.el (c-ts-indent-offset):
Rename `FOO-mode-indent-offset` to `FOO-indent-offset`,
with obsolete alias.
2026-02-22 18:48:57 -05:00
Eli Zaretskii
2ae21d78ec ; Use 'treesit-declare-unavailable-functions' in markdown-ts-mode. 2026-02-22 10:46:01 +02:00
Rahul Martim Juliato
11476d1ce7
Add support for hiding markup delimiters in markdown-ts-mode
* lisp/textmodes/markdown-ts-mode.el
(markdown-ts-hide-markup): New defcustom controlling
visibility of markup delimiters.
(markdown-ts--fontify-delimiter): Fontify delimiter nodes and
conditionally apply invisibility.
(markdown-ts--set-hide-markup): Internal helper to update
invisibility state.
(markdown-ts-toggle-hide-markup): Interactive command to toggle
delimiter visibility.
(markdown-ts-setup): Initialize delimiter hiding according to
'markdown-ts-hide-markup' and register managed properties.
(markdown-ts--treesit-settings): Use
'markdown-ts--fontify-delimiter' for delimiter nodes.
(require 'outline): Ensure outline faces are available so
headings are fontified correctly on first load.
2026-02-21 23:38:44 -08:00
Eli Zaretskii
a444f2c7f9 ; Fix last change
* lisp/textmodes/page-ext.el (pages-directory-list-all-headers-p)
(pages-directory-count-lines-p): Doc fixes.
2026-02-14 13:59:26 +02:00
Marco Wahl
8aa8ab8b03 Add revert capability for page directory buffer
* lisp/textmodes/page-ext.el (pages-directory-revert-function): New
function.
(pages-directory-list-all-headers-p, pages-directory-count-lines-p)
(pages-directory-regexp): New variables to store the page directory
style.  (Bug#80319)
2026-02-14 13:56:26 +02:00
Stefan Monnier
f38b0872f0 (yaml-ts-mode-yamllint-options): Use a list of strings
It is both simpler to code and marginally more general (allows
spaces in arguments).

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-yamllint-options): Use
a list.
(yaml-ts-mode-flymake): Adjust accordingly.
2026-02-04 11:03:57 -05:00
Daniel Mendler
e8f26d554b Support cons cell for 'line-spacing'
* etc/NEWS: Announce the change.
* src/dispextern.h (struct glyph_row): Add
'extra_line_spacing_above' member.
(struct it): Add 'extra_line_spacing_above' member.
* src/frame.h (struct frame): Add 'extra_line_spacing_above'
member.  Update comment for 'extra_line_spacing.'
* src/buffer.c (syms_of_buffer): Update the docstring of
'line-spacing' to describe the cons cell usage.
* src/buffer.h (struct buffer): Update comment for
'extra_line_spacing'.
* src/frame.c (gui_set_line_spacing): Handle cons cell value for
'line-spacing'.  Calculate and set 'extra_line_spacing_above'
for both integer and float pairs.
* src/xdisp.c (init_iterator): Initialize 'extra_line_spacing_above'
from buffer or frame 'line-spacing', handling cons cells for both
integer and float values.
(gui_produce_glyphs): Use 'extra_line_spacing_above' to distribute
spacing between ascent and descent.  Update 'max_extra_line_spacing'
calculation.
(resize_mini_window): Take line spacing into account when resizing the
mini window.  Pass height of a single line to 'grow_mini_window' and
'shrink_mini_window'.
* src/window.c (grow_mini_window, shrink_mini_window): Add unit
argument which defines height of a single line.
* src/window.h (grow_mini_window, shrink_mini_window): Adjust function
prototypes accordingly with unit argument.
* lisp/subr.el (total-line-spacing): New function to calculate total
spacing from a number or cons cell.
(posn-col-row): Use total-line-spacing.
* lisp/simple.el (default-line-height): Use 'total-line-spacing'.
* lisp/textmodes/picture.el (picture-mouse-set-point): Use
'total-line-spacing'.
* lisp/window.el (window-default-line-height): Use
'total-line-spacing'.
(window--resize-mini-window): Take 'line-spacing' into account.
* test/lisp/subr-tests.el (total-line-spacing): New test.
* test/src/buffer-tests.el (test-line-spacing): New test.
* doc/emacs/display.texi (Display Custom): Document that
'line-spacing' can be a cons cell.
(Line Height): Document the new cons cell format for 'line-spacing'
to allow vertical centering.

Co-authored-by: Przemysław Alexander Kamiński <alexander@kaminski.se>
Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
2026-01-24 13:32:44 +02:00
Eli Zaretskii
5290b5dddb ; Fix :type of 'yaml-ts-mode-yamllint-options'
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-yamllint-options):
Fix :type and doc string.
2026-01-22 14:52:12 +02:00
Juri Linkov
41c0d254d5 ; * lisp/textmodes/yaml-ts-mode.el: Fix docstring wider than 80 characters. 2026-01-21 20:08:14 +02:00
Vincenzo Pupillo
15d3cc3f65 Flymake support for yaml-ts-mode.
* etc/NEWS: Announce the new customization option (bug#80215).
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): New customization group.
(yaml-ts-mode-yamllint-options): New customization option.
(yaml-ts-mode--flymake-process): New variable that stores the reference
to the flymake process.
(yaml-ts-mode-flymake): New function that implements support for Flymake.
2026-01-21 19:41:40 +02:00
USAMI Kenta
c68c5fbe14 ; Remove redundant cl-lib runtime dependencies across lisp/
* lisp/editorconfig-tools.el:
* lisp/emacs-lisp/shorthands.el:
* lisp/info-xref.el:
* lisp/international/quail.el:
* lisp/international/rfc1843.el:
* lisp/mail/ietf-drums.el:
* lisp/mail/rfc2047.el:
* lisp/mail/yenc.el:
* lisp/net/pop3.el:
* lisp/net/sasl-scram-sha256.el:
* lisp/net/shr-color.el:
* lisp/progmodes/grep.el:
* lisp/scroll-bar.el:
* lisp/textmodes/emacs-news-mode.el:
* lisp/textmodes/reftex-auc.el:
* lisp/textmodes/reftex-dcr.el:
* lisp/textmodes/reftex-global.el:
* lisp/textmodes/reftex-sel.el:
* lisp/url/url-dav.el:
* lisp/vc/vc-src.el:
* lisp/xwidget.el:
* lisp/yank-media.el: Remove redundant (require 'cl-lib).
(Bug#80129)
2026-01-17 15:32:15 +02:00
Amin Bandali
5020d89104 New minor mode center-line-mode
* lisp/textmodes/text-mode.el (center-line-mode--track-changes):
New local variable for storing the id of the change tracker registered
for the current buffer.
(center-line-mode--track-changes-signal): New function to be called by
the track-changes library whenever there is a change in the current
buffer.
(center-line-mode--track-changes-function): New function called from the
above signal function, iterates over the lines of the modified region,
calling 'center-line' for each non-empty line.
(center-line-mode): New minor mode.
* etc/NEWS: Document the new minor mode.
2026-01-17 14:33:35 +02:00
Sean Whitton
02966c8db5 ; Improve docs for last change. 2026-01-14 18:48:56 +00:00
Paul Nelson
ea5d079e26 Allow Ispell to save corrections as abbrevs
* lisp/textmodes/ispell.el (ispell-save-corrections-as-abbrevs):
New user option.
(ispell--abbrev-saving-allowed)
(ispell--save-correction-as-abbrev): New variables.
(ispell--maybe-save-correction-abbrev): New function.
(ispell-word, ispell-process-line): Use them to save corrections
as abbrevs when appropriate (bug#79985).
(ispell-command-loop): Add C-u as command character to toggle
abbrev saving for an immediately following replacement command.
(ispell-help): Document C-u binding.

* doc/emacs/fixit.texi (Spelling): Document new feature.
2026-01-14 18:48:56 +00:00
Stefan Monnier
3e2ee9869d sgml-mode.el: Prefer forward-sexp over forward-list
They're always called immediately before a `<` char, in which case
they do the same anyway.  This saves us from having to touch
 `forward-list-function` in addition to `forward-exp-function`.

While at it, change `sgml-tags-invisible` to use `define-minor-mode`.

* lisp/textmodes/sgml-mode.el (sgml-delete-tag)
(sgml-electric-tag-pair-before-change-function): Prefer `forward-sexp`
over `forward-list`.
(sgml-tags-invisible): Define with `define-minor-mode`.  Don't disable
`cursor-sensor-mode` when we don't need it any more, since some other
package may be using it.  Remove redundant binding of `inhibit-read-only`.
2026-01-13 10:18:46 -05:00
Juri Linkov
52875b51bf * lisp/textmodes/html-ts-mode.el: Special handling of 'show-paren-mode'.
(html-ts-mode--show-paren-data): New function to exclude
unbalanced tags when the closing tag is missing.
(html-ts-mode): Set 'show-paren-data-function' to
'html-ts-mode--show-paren-data' (bug#80151).
2026-01-13 09:54:55 +02:00
Juri Linkov
578750c7c8 * lisp/textmodes/sgml-mode.el: Fix for html-ts-mode.
(sgml-electric-tag-pair-before-change-function):
Let-bind 'forward-list-function' to nil.
(sgml-delete-tag): Let-bind 'forward-sexp-function'
and 'forward-list-function' to nil.
(sgml-tags-invisible): Let-bind 'forward-list-function' to nil.

All this is required to use the default definitions of sexp/list
that significantly differ from treesit definitions (bug#80151).
2026-01-13 09:50:17 +02:00
Arash Esbati
17ddfd66e6 ; Don't mark some symbols as links
* lisp/textmodes/reftex-vars.el (reftex-auto-recenter-toc)
(reftex-label-alist, reftex-index-phrases-logical-and-regexp)
(reftex-index-phrases-logical-or-regexp): Don't mark symbols as
links.
2026-01-01 16:12:43 +01:00
Sean Whitton
c31f6adc31 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
Paul Eggert
481ad70d5c December 2025 spelling fixes
Some of the fixes are to continue to use American
rather than British spelling.
* doc/misc/modus-themes.org (my-modus-themes-engraved-faces):
Fix misspelled ‘:foreground’s.
* etc/themes/modus-themes.el (modus-themes-faces):
Fix misspelled ‘modus-themes-bold’.
* lisp/emacs-lisp/rx.el (rx--normalize-char-pattern):
Rename from rx--normalise-char-pattern.
(rx--optimize-or-args):	Rename from rx--optimise-or-args.
* lisp/frame.el (frame--special-parameters):
Fix misspelled "right-divider-width".
* lisp/net/tramp.el (tramp-fingerprint-prompt-regexp):
Use American spelling “centered”, to match current libfprintf.
* lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers):
Rename from org-fold-core--optimise-for-huge-buffers.
(org-fold-core-update-optimization):
Rename from org-fold-core-update-optimisation,
leaving an alias behind.
(org-fold-core-remove-optimization):
Rename from org-fold-core-remove-optimisation,
leaving an alias behind.
* lisp/org/org.el (org-advertized-archive-subtree):
This alias is now obsolete.
* lisp/play/zone.el (zone-ignored-buffers):
Fix misspelling of ‘zone--buffer-encrypted-p’.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces):
Fix misspelling of ‘csharp’ group.
* lisp/vc/vc.el (vc-clonable-backends-custom-type):
Rename from vc-cloneable-backends-custom-type,
leaving an alias behind.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(bytecomp-tests--warn-arity-non-compiled-callee):
Rename from bytecomp-tests--warn-arity-noncompiled-callee.
(bytecomp-test-defface-spec): Reword a deliberate misspelling
of “default” that is so common I don’t want it to pollute the
spelling dictionary.
* test/lisp/emacs-lisp/package-vc-tests.el:
(package-vc-tests-preserve-artifacts):
Rename from package-vc-tests-preserve-artifacts.
* test/lisp/eshell/em-prompt-tests.el:
(em-prompt-test/forward-backward-paragraph-1):
Reword a deliberate misspelling of “goodbye” that is so common I
don’t want it to pollute the spelling dictionary.
2025-12-26 10:22:12 -08:00
Sean Whitton
44d47caa86 New 'R' code letter for 'interactive' forms
* src/callint.c (callint_argfuns): Add use-region-beginning and
use-region-end.
(syms_of_callint): Protect use-region-beginning and
use-region-end.  Add DEFSYM for Quse_region_p.
(Fcall_interactively): New 'R' code letter.
* lisp/textmodes/paragraphs.el (repunctuate-sentences):
* lisp/vc/diff-mode.el (diff-delete-other-hunks, diff-apply-hunk)
(diff-revert-and-kill-hunk, diff-apply-buffer):
* lisp/vc/log-view.el (log-view-mark-entry)
(log-view-unmark-entry): Use it.
* doc/lispref/commands.texi (Interactive Codes):
* doc/lispref/markers.texi (The Region):
* etc/NEWS:
* lisp/simple.el (use-region-beginning, use-region-end)
(use-region-p):
* src/callint.c (Finteractive): Document it.
2025-12-08 15:01:50 +00:00
Elías Gabriel Pérez
ddf297068c * lisp/textmodes/bibtex.el (bibtex-mode): Fix hs variables (bug#79934). 2025-12-08 09:20:48 +02:00
Roi Martin
5e0414b05c ; Improve documentation of fill-region-as-paragraph-semlf
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Create
hyperlinks to URLs.
2025-12-06 18:48:38 +02:00
Eli Zaretskii
164f76a474 ; Improve documentation of 'fill-region-as-paragraph'
* lisp/textmodes/fill.el (fill-region-as-paragraph-default)
(fill-separate-heterogeneous-words-with-space): Doc fixes.
(Bug#79575)
2025-12-06 14:18:55 +02:00
Kristoffer Balintona
21f9295aa9 Improve performance of 'flyspell-goto-next-error'
* lisp/textmodes/flyspell.el (flyspell-goto-next-error): Use
'next-overlay-change' and 'previous-overlay-change'.
(Bug#79933)
2025-12-04 14:19:51 +02:00
Eli Zaretskii
4b55e56232 Fix whitespace in remember.el
* lisp/textmodes/remember.el (remember-mode): Remove redundant
whitespace.  Patch by Huang Jing <rne.kou@icloud.com> (bug#79928).
2025-12-01 15:16:49 +02:00
Roi Martin
b208b08371 Fix bug in semantic linefeed filling
Fix bug in semantic linefeed filling related to wide characters and
`sentence-end-without-space'.
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Fix the
calculation of the maximum column.  Do not depend on where
`fill-region-as-paragraph-default' leaves point after being called.
(Bug#79575)
2025-11-30 11:41:49 +02:00
Yuan Fu
2c19f6087e
Remove the cached values in tree-sitter modes (bug#79363)
The cached values are not needed anymore since Emacs now caches
the compiled queries.

* lisp/progmodes/cmake-ts-mode.el:
(cmake-ts-mode--indent-rules-cached): Remove.
(cmake-ts-mode--indent-rules): Return values directly.
(cmake-ts-mode--font-lock-settings-cached): Remove.
(cmake-ts-mode--font-lock-settings): Return values directly.
* lisp/progmodes/php-ts-mode.el:
(php-ts-mode--font-lock-settings-cached): Remove.
(php-ts-mode--font-lock-settings): Return values directly.
(php-ts-mode--custom-html-font-lock-settings-cached): Remove.
(php-ts-mode--custom-html-font-lock-settings): Return values directly.
* lisp/textmodes/mhtml-ts-mode.el:
(mhtml-ts-mode--treesit-font-lock-settings-cached): Remove.
(mhtml-ts-mode--treesit-font-lock-settings): Return values directly.
(mhtml-ts-mode--treesit-indent-rules-cached): Remove.
(mhtml-ts-mode--treesit-indent-rules): Return values directly.
* lisp/progmodes/cmake-ts-mode.el:
(cmake-ts-mode--indent-rules-cached): Remove
(cmake-ts-mode--indent-rules): Return values directly.
(cmake-ts-mode--font-lock-settings-cached): Remove.
(cmake-ts-mode--font-lock-settings): Return values directly.
* lisp/progmodes/csharp-mode.el:
(csharp-ts-mode--font-lock-settings-cached): Remove.
(csharp-ts-mode--font-lock-settings): Return values directly.
2025-11-28 00:12:28 -08:00
Reuben Thomas
e1f851e840 Fix ispell’s handling of comment-end when adding local words
* lisp/textmodes/ispell.el (ispell-add-per-file-word-list): Deal
with `comment-end' in a way that works for comments that don’t
nest.

We proceed as follows: when `comment-end' is non-empty, we only
ever insert one start and one end comment, the first time we add
a local word.  This works with both C-style (which don’t nest)
and Rust-style comments (which do).

If we’re using line comments (i.e. comments that only have a
`comment-start'), then continue to insert one on each line.

* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-add-per-file-word-list/nxml): Adjust test.

Bug#79871
2025-11-22 13:15:45 +02:00
Juri Linkov
9709cb8d16 Improve hideshow support for heex-ts-mode and yaml-ts-mode
* lisp/progmodes/heex-ts-mode.el (heex-ts--thing-settings): Add 'defun' thing.
(heex-ts-mode): Use it in 'hs-treesit-things'.

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): Set 'hs-treesit-things'
and 'hs-adjust-block-end-function'.
2025-11-10 21:46:29 +02:00
Elías Gabriel Pérez
ef2584585b hideshow: Rework previous changes
* lisp/progmodes/hideshow.el: Set default values of buffer-local variables.
(hs-inside-comment-p): Restore.
(hs--set-variable): Rename from 'hs--get-mode-value'.
(hs-grok-mode-type): Rework.
* lisp/nxml/nxml-mode.el:
* lisp/progmodes/f90.el:
* lisp/progmodes/fortran.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/lua-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/verilog-mode.el:
* lisp/progmodes/vhdl-mode.el:
* lisp/textmodes/mhtml-mode.el:
* lisp/textmodes/sgml-mode.el:
* lisp/treesit.el (treesit-major-mode-setup): Rename
'hs-forward-sexp-func' to 'hs-forward-sexp-function',
'hs-adjust-block-beginning' to 'hs-adjust-block-beginning-function',
'hs-find-block-beginning-func' to 'hs-find-block-beginning-function',
'hs-find-next-block-func' to 'hs-find-next-block-function',
'hs-looking-at-block-start-p-func' to 'hs-looking-at-block-start-predicate',
'hs-inside-comment-p-func' to 'hs-inside-comment-predicate'.
2025-11-08 20:04:30 +02:00
Elías Gabriel Pérez
cc589d7003 hideshow: Rework previous changes
* doc/emacs/programs.texi (Hideshow):
* etc/NEWS: Fix doc.
* lisp/progmodes/hideshow.el: Update Commentary Header.
(hs-modes-alist): Remove.
(hs--get-mode-value, hs-grok-mode-type): Rework.
* lisp/treesit.el (treesit-major-mode-setup):
* lisp/emacs-lisp/lisp-mode.el:
* lisp/nxml/nxml-mode.el:
* lisp/progmodes/cc-mode.el:
* lisp/progmodes/f90.el:
* lisp/progmodes/fortran.el:
* lisp/progmodes/hideshow.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/js.el:
* lisp/progmodes/lua-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/verilog-mode.el:
* lisp/progmodes/vhdl-mode.el:
* lisp/textmodes/bibtex.el:
* lisp/textmodes/mhtml-mode.el:
* lisp/textmodes/sgml-mode.el:
* lisp/treesit.el: Fix and rework previous changes.
2025-11-06 09:41:12 +02:00
Elías Gabriel Pérez
959345f602 hideshow: Rewrite 'hs-special-modes-alist'
Rewrite the format in 'hs-special-modes-alist' to make easier to
exclude some values, add support for settings inheritance
according to current major mode and parents, and support string
hiding for lisp modes.

Bug#79671

* lisp/progmodes/hideshow.el (hs-modes-alist): New variable.
(hs-special-modes-alist): Mark as obsolete.
(hs-forward-sexp-func, hs-adjust-block-beginning)
(hs-find-block-beginning-func, hs-find-next-block-func)
(hs-looking-at-block-start-p-func): Set default values to nil.
(hs-inside-comment-p): Remove function.
(hs-adjust-block-end, hs-treesit-things): New buffer-local
variables.
(hs-block-positions): Minor updates.
(hs--get-mode-value): New function.
(hs-grok-mode-type): Rewrite.
* lisp/progmodes/f90.el (hs-special-modes-alist):
* lisp/progmodes/fortran.el (hs-special-modes-alist):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/lua-mode.el (lua-mode):
* lisp/progmodes/python.el (python-base-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vhdl-mode.el (vhdl-hs-minor-mode): Rewrite
settings.
* lisp/progmodes/python.el (python-ts-hs-adjust-block-end-fn):
New function.
* lisp/treesit.el (treesit-hs-block-end)
(treesit-hs-find-block-beginning, treesit-hs-find-next-block)
(treesit-hs-looking-at-block-start-p): Minor updates.
* doc/emacs/programs.texi (Hideshow):
* etc/NEWS: Document changes.
2025-11-04 19:15:10 +02:00
Yuan Fu
9e8557fe85
Skip unknown language for code block in markdown-ts-mode (bug#79670)
* lisp/textmodes/markdown-ts-mode.el:
(markdown-ts--convert-code-block-language): Return nil if the
langauge doesn't have a corresponding major mode in
markdown-ts-code-block-source-mode-map.
2025-10-29 21:25:23 -07:00
Juri Linkov
0a4503de3a Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms
* 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)
2025-10-16 09:45:30 +03:00
Arash Esbati
f344f5c4bf Replace obsolete floatfig package with floatflt
* 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.
2025-10-10 11:17:54 +02:00
Arash Esbati
d8448facd9 Remove setting of reference format
* 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.
2025-10-09 11:55:47 +02:00