Commit graph

4207 commits

Author SHA1 Message Date
Eli Zaretskii
3954e8d9bb Fix picture-mode with full-width characters
* lisp/textmodes/picture.el (picture-insert): Don't rely on
'move-to-column' to move to the column that is its argument: this
might be false when full-width characters are involved.
2024-11-10 11:48:34 +02:00
Eli Zaretskii
7dabfe9465 Fix movement to the left in picture-mode
* lisp/textmodes/picture.el (picture-insert): Measure width by
counting columns on display, not by using 'string-width', because
the latter is inaccurate when TABs are involved.  (Bug#74255)
2024-11-10 10:56:40 +02:00
Sean Whitton
794bb2a2e3 remember-data-file: Don't unconditionally call set-visited-file-name
* lisp/textmodes/remember.el (remember-data-file): Don't
unconditionally call set-visited-file-name.
2024-09-25 16:02:53 +01:00
Roland Winkler
bd25a98b4e bibtex-mode: fix patch bibtex validation for non-file buffers 2024-09-24 23:14:27 -05:00
Stefan Kangas
4047072c7d Update FSF's address
* doc/emacs/emacs.texi (Distrib):
* doc/lispintro/emacs-lisp-intro.texi:
* doc/lispref/elisp.texi:
* doc/misc/org.org (Link Abbreviations):
* etc/tutorials/TUTORIAL.eo:
* lisp/elide-head.el:
* lisp/textmodes/page-ext.el: Update the FSF address to 31 Milk Street.
2024-09-02 21:02:09 +02:00
Eli Zaretskii
5c1bd99139 Fix 'forward-comment' in 'toml-ts-mode'
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode--syntax-table): Fix
syntax of newline.  Patch from Jostein Kjønigsen
<jostein@secure.kjonigsen.net>.  (Bug#72489)
2024-08-17 12:29:31 +03:00
Stefan Kangas
a799661566 Standardize possessive apostrophe usage in manuals, docs, and comments
See the note in admin/notes/documentation.
Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
2024-07-25 03:35:18 +02:00
Stefan Kangas
67faaead75 Don't refer to obsolete finder group "wp"
* lisp/textmodes/rst.el: Don't refer to obsolete finder group "wp".
2024-07-24 23:47:06 +02:00
Robert Pluim
de9f9add13 Improve 'emacs-news-view-mode' menus and bindings
* lisp/textmodes/emacs-news-mode.el (emacs-news-mode-map): Move
non-editing commands from here...
(emacs-news-common-map): ... to here.
(emacs-news-view-mode): Remove hard-coded 'special-mode' bindings.
(emacs-news-view-mode-map): Inherit from 'special-mode-map' and
'emacs-news-common-map' here instead.
(emacs-news-mode--menu-common-1): New defconst for menu items common to
'news-mode' and 'news-view-mode'.
(emacs-news-mode--menu-common-2): Second new defconst for common items.
(emacs-news-mode-menu): Use them.
(emacs-news-view-mode-menu): New menu, which omits the buffer editing
commands.

This builds on the fix for Bug#72080.
2024-07-23 13:49:40 +02:00
Liu Hui
816c53c2d9 Fix bibtex validation for non-file buffers
* lisp/textmodes/bibtex.el (bibtex-validate): Use buffer name
to show errors in non-file buffers.  (Bug#71946)
2024-07-20 12:48:04 +03:00
Eli Zaretskii
ab7c40ea52 Fix Imenu in 'emacs-news-view-mode'
* lisp/textmodes/emacs-news-mode.el (emacs-news-view-mode): Make
it derived from emacs-news-mode.  Add useful key bindings.
(Bug#72080)
2024-07-20 12:33:23 +03:00
Stefan Kangas
a6cab228d4 ; Fix typos 2024-07-18 11:46:50 +02:00
Eli Zaretskii
33ba72f52f Fix decoding 'display' properties with SVG images in Enriched mode
* lisp/textmodes/enriched.el (enriched-next-annotation): Reject
matches of 'enriched-annotation-regexp' inside strings.  Reported
by Christopher Howard <christopher@librehacker.com> in
https://lists.gnu.org/archive/html/help-gnu-emacs/2024-06/msg00178.html.
2024-07-14 09:06:55 +03:00
Stefan Kangas
336aa6ab17 Checkdoc fixes in textmodes/*.el
* lisp/textmodes/ispell.el (ispell-command-loop):
* lisp/textmodes/mhtml-mode.el (mhtml--construct-submode):
* lisp/textmodes/page-ext.el (pages-set-delimiter):
* lisp/textmodes/refbib.el (r2b-get-field, r2b-put-field):
* lisp/textmodes/refer.el (refer-cache-bib-files):
* lisp/textmodes/reftex-index.el (reftex-index-phrase-selection-or-word):
(reftex-index-phrases-mode):
* lisp/textmodes/table.el (table-insert, table--fill-region-strictly):
Checkdoc fixes.
2024-07-08 17:24:54 +02:00
Stefan Kangas
b2d99c0d0a Improve sentence-end-double-space docstring
* lisp/textmodes/paragraphs.el (sentence-end-double-space):
Improve and expand docstring.
2024-07-01 02:41:52 +02:00
Stefan Kangas
fb11294d41 ; Fix typos 2024-06-23 16:40:06 +02:00
Eli Zaretskii
d802e56182 ; * lisp/textmodes/ispell.el (ispell-aspell-find-dictionary): Doc fix. 2024-06-15 15:02:11 +03:00
Arash Esbati
d05f473285 ; Fix some docstrings. (bug#71532) 2024-06-15 14:58:22 +03:00
Eli Zaretskii
45a191738c Fix doc strings in ispell.el
* lisp/textmodes/ispell.el (ispell-check-version)
(ispell-get-casechars, ispell-get-not-casechars)
(ispell-get-otherchars, ispell-get-many-otherchars-p)
(ispell-get-ispell-args, ispell-get-extended-character-mode)
(ispell-get-coding-system, ispell-word, ispell-get-word)
(ispell-pdict-save, ispell-command-loop, ispell-help)
(ispell-filter, ispell-highlight-spelling-error)
(ispell-change-dictionary, ispell-region, ispell-ignore-fcc)
(ispell-get-line, ispell-message): Doc fixes (bug#71532)
2024-06-15 14:55:31 +03:00
Eli Zaretskii
6d12157fa8 Prevent deletion of separator in *edit string* buffer
* lisp/textmodes/string-edit.el (string-edit): Make the separator
line read-only.  (Bug#71405)
2024-06-15 11:37:34 +03:00
Stefan Kangas
b8873a7080 Fix misspelled symbols in artist.el
* lisp/textmodes/artist.el (artist-key-undraw-continuously)
(artist-key-draw-continuously)
(artist-key-do-continuously-continuously)
(artist-key-do-continuously-poly)
(artist-key-do-continuously-1point)
(artist-key-do-continuously-2points)
(artist-key-do-continuously-common)
(artist-key-set-point-continuously)
(artist-mouse-draw-continuously): Rename functions to fix misspelling of
"continuously".  Leave old function names as obsolete aliases and update
all callers.
(artist-mt, artist-go-get-undraw-fn, artist-go-get-interval-fn)
(artist-go-get-fill-pred, artist-go-get-fill-fn)
(artist-key-undraw-common, artist-key-draw-common)
(artist-key-do-continously-common, artist-key-set-point-common)
(artist-down-mouse-1): Rename symbol to 'artist-do-continuously' to fix
misspelling of "continuously".  Continue supporting the old symbol for
backwards-compatibility.
2024-06-12 18:17:13 +02:00
Eli Zaretskii
bd50c804ec Fix 'string-edit' when abort-callback is omitted
* lisp/textmodes/string-edit.el (string-edit): Set
'string-edit--abort-callback' even if ABORT-CALLBACK is nil.
(Bug#71406)
2024-06-08 16:07:24 +03:00
Basil L. Contovounesios
025c3eaf9c Fix user-error usage in sgml-mode.el
* lisp/textmodes/sgml-mode.el (html-mode--image-yank-handler):
Address recent byte-compiler format string warnings (bug#71379).
2024-06-07 10:48:03 +02:00
Eli Zaretskii
22d9bbe284 Merge from origin/emacs-29
bf50aa38f9 Improve documentation of case-conversion commands
225b426f25 ; Fix typos
2024-06-01 08:34:43 -04:00
Stefan Kangas
225b426f25 ; Fix typos 2024-05-27 10:11:15 +02:00
Stefan Kangas
92cd24f405 Add convenience binding for html-paragraph to mhtml-mode
* lisp/textmodes/sgml-mode.el (html-mode-map): Bind 'C-c C-c p' to
'html-paragraph'.  (Bug#70533)
2024-05-19 10:46:51 +02:00
Eli Zaretskii
48c9285c19 Merge from origin/emacs-29
0ec9a02a0d ; Fix doc strings of two scroll-bar functions.
2f8bccf9d8 ; * doc/emacs/frames.texi (Scroll Bars): Improve formatting.
f9832e80b8 ; * lisp/textmodes/ispell.el (ispell-message): Add commen...
a7d247be90 ; * etc/PROBLEMS: Document macOS problems with Emacs.clr ...
8560ee7b5c ; * doc/misc/auth.texi (The Unix password store): Fix var...
74c6b59af1 ; Advertise scroll bars some more
3d65d4306b Avoid errors in 'image-dired-tag-thumbnail'
2024-05-11 06:50:56 -04:00
Eli Zaretskii
f9832e80b8 ; * lisp/textmodes/ispell.el (ispell-message): Add commentary. 2024-05-09 20:44:52 +03:00
Arash Esbati
ead7252353 Support biblatex field in `reftex-cite-format'
* lisp/textmodes/reftex-cite.el (reftex-format-citation):
Recognize the alternative "journaltitle" field which is preferred
by biblatex.  (bug#38762)

* test/lisp/textmodes/reftex-tests.el
(reftex-format-citation-test): Adjust test.
2024-05-07 15:50:03 +02:00
Ihor Radchenko
15c77f2fce mhtml-mode: Use run-mode-hook' to run prog-mode-hook' (bug#70671)
* lisp/textmodes/mhtml-mode.el (mhtml-mode): When running hooks
simulating inheritance from `prog-mode', use `run-mode-hooks' that
honors `delay-mode-hooks' macro.  Note that `delay-mode-hooks' is bound
to non-nil when major mode body is evaluated, so there is no chance that
any major mode-related hooks are executed twice.
2024-05-03 11:02:54 -04:00
Juri Linkov
598505c4fa Suppress warnings for obsolete display-comint-buffer-action (bug#69983)
* lisp/cmuscheme.el (run-scheme, switch-to-scheme):
* lisp/shell.el (shell):
* lisp/eshell/eshell.el (eshell):
* lisp/progmodes/inf-lisp.el (inferior-lisp):
* lisp/progmodes/sh-script.el (sh-show-shell):
* lisp/textmodes/tex-mode.el (tex-display-shell)
(tex-recenter-output-buffer): Add 'with-suppressed-warnings'
to suppress warnings for obsolete options
'display-comint-buffer-action' and 'display-tex-shell-buffer-action'.
2024-04-25 20:34:28 +03:00
Stefan Monnier
c15c9f4de6 (conf-toml-recognize-section): Fix bug#70383
* lisp/textmodes/conf-mode.el (conf-toml-recognize-section): Move
point, like font-lock matchers are expected to do.
2024-04-17 14:30:10 -04:00
Arash Esbati
845246093f Recognize multicite macros from biblatex
* lisp/textmodes/reftex-cite.el (reftex-all-used-citation-keys):
Match the citation keys used with multicite macros provided by
biblatex.  (bug#38249)

* test/lisp/textmodes/reftex-tests.el
(reftex-all-used-citation-keys): Adjust test accordingly.
2024-04-13 22:33:24 +02:00
Arash Esbati
ca528f7c6a Suppress bogus messages in the echo area
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref-when-idle):
Check if point inside a mandatory argument where the cite/ref key
usually resides.  For example, with \cite[45]{emacs:30} and point
on 4, the following bogus message in the echo area is suppressed:
"cite: no such database entry: \cite[45]".  (bug#38258)
Fix docstring.
2024-04-10 23:08:17 +02:00
Arash Esbati
7236010d2e Move over optional arguments in parentheses correctly
* lisp/textmodes/reftex-parse.el (reftex-move-to-previous-arg):
Recognize ')' as closing delimiter for optional argument.
Fix docstring.
(reftex-what-macro): Identify LaTeX macros with optional arguments
in parentheses correctly.  This is necessary to make
`reftex-view-crossref' work with biblatex on entries like:
\parencites(Glob.Pre)(Glob.Post)[Pre][Post]{key1}[Pre][Post]{key2}
(bug#31132)
2024-04-09 14:08:17 +02:00
Eli Zaretskii
cc8a2c57b5 Merge from origin/emacs-29
3b791ebbe1 ; Fix 'usage:' keyword in Ffile_name_concat doc.
ed48b0d657 ; * CONTRIBUTE: Ask not to use non-ASCII unless necessary.
b708e639d6 ; * src/lread.c (maybe_swap_for_eln): Clarify warning mes...
db027a0697 ; Fix bibtex-biblatex-field-alist docstring typo.
a9be5c7ea9 ; * doc/lispref/control.texi (Conditionals): Add missing ...
db5915f30b Fix 'with-sqlite-transaction'
fe491173e8 ; * doc/emacs/files.texi (Image Mode): Fix typo (bug#69671).
2024-03-16 05:47:41 -04:00
Eli Zaretskii
1c4233b9a3 ; Fix documentation of 'flyspell-check-changes'
* lisp/textmodes/flyspell.el (flyspell-check-changes): Doc fixes.

* etc/NEWS: Improve wording of entry for 'flyspell-check-changes'.
2024-03-15 10:44:23 +02:00
Juri Linkov
f03f14165e * lisp/textmodes/flyspell.el (flyspell-check-changes): New user option.
(flyspell--mode-on): Add flyspell-check-changes to post-command-hook
when flyspell-check-changes is non-nil.
(flyspell--mode-off): Remove flyspell-check-changes from post-command-hook.
(flyspell-check-changes): New function (bug#61874).
2024-03-14 20:11:33 +02:00
Basil L. Contovounesios
db027a0697 ; Fix bibtex-biblatex-field-alist docstring typo. 2024-03-12 22:47:45 +01:00
Stefan Monnier
c79a509384 Add non-TS modes as extra parent of TS modes (bug#68246)
Record the fact that TS modes are alternatives to the non-TS
modes using the new `derived-mode-add-parents` functionality.
Do the same for long standing similar issues with CPerl-mode.

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode):
* lisp/textmodes/toml-ts-mode.el (toml-ts-mode):
* lisp/textmodes/html-ts-mode.el (html-ts-mode):
* lisp/textmodes/css-mode.el (css-ts-mode):
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode, tsx-ts-mode):
* lisp/progmodes/sh-script.el (bash-ts-mode):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
* lisp/progmodes/python.el (python-ts-mode):
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode):
* lisp/progmodes/json-ts-mode.el (json-ts-mode):
* lisp/progmodes/js.el (js-ts-mode):
* lisp/progmodes/java-ts-mode.el (java-ts-mode):
* lisp/progmodes/heex-ts-mode.el (heex-ts-mode):
* lisp/progmodes/go-ts-mode.el (go-ts-mode, go-mod-ts-mode):
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode):
* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode):
* lisp/progmodes/csharp-mode.el (csharp-ts-mode):
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode):
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode):
Add non-TS mode as extra parent.

* lisp/progmodes/cperl-mode.el (cperl-mode): Add `perl-mode` as
extra parent.
2024-03-09 10:29:06 -05:00
Stefan Monnier
2b5d43081a (major-mode-remap(-defaults)): New var and function (bug#69191)
While `major-mode-remap-alist` provides a way for users to indicate the
major mode of their choice, we need a similar variable for the
use of packages.

This patch adds a new `major-mode-remap-defaults` and changes various
packages to obey it or make use of it.
I think it nicely cleans the regexp duplication between CC-mode and
`c-ts-mode.el` and also makes it easier/cleaner for users to override
the changes made by `*-ts-mode.el`.

* lisp/files.el (major-mode-remap-defaults): New variable.
(major-mode-remap): New function.
(set-auto-mode-0): Use it.
* doc/lispref/modes.texi (Auto Major Mode): Document them.

* lisp/textmodes/tex-mode.el (tex--redirect-to-submode):
Use `major-mode-remap`.
(major-mode-remap-defaults): Set it to remap AUCTeX modes by default.
* lisp/progmodes/ruby-ts-mode.el (auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/progmodes/c-ts-mode.el (c-or-c++-ts-mode): Use `major-mode-remap`.
(auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/org/ox.el (org-export-to-buffer): Modernize docstring accordingly.
* lisp/progmodes/cc-mode.el (c-or-c++-mode):
* lisp/org/ox-latex.el (org-latex-export-as-latex):
* lisp/org/ox-koma-letter.el (org-koma-letter-export-as-latex):
* lisp/org/ox-beamer.el (org-beamer-export-as-latex):
Use `major-mode-remap` when available.
2024-03-03 23:58:18 -05:00
Basil L. Contovounesios
bca3c9b466 ; Fix :type of text-mode-ispell-word-completion. 2024-02-28 17:04:20 +01:00
Stefan Monnier
b3eb49a466 tex-mode.el: Increase depth of braces highlighted in $...$ blocks
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Increase depth
of braces supported in $...$ blocks.
(tex-font-lock-keywords-2, tex-font-lock-syntactic-face-function):
Refer directly to font-lock faces.
2024-02-26 14:32:08 -05:00
Arash Esbati
d1fe392f93 ; Fix compiler warning
* lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Fix
character escaping in the docstring.  (bug#69341)
2024-02-24 09:30:16 +01:00
Stefan Monnier
cea72c1757 (tex-font-lock-keywords-1): Fix bug#68827
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Don't
apply `tex-verbatim` in comments.
2024-02-15 15:09:13 -05:00
Jörg Bornemann
6ef8d29f22 ; Resolve a FIXME in rst.el
* lisp/textmodes/rst.el (rst-define-key): Use :documentation for the
dynamically created docstrings of deprecated bindings.  (Bug#69087)

Copyright-paperwork-exempt: yes
2024-02-13 14:08:37 +02:00
Juri Linkov
3b90e5052c Tree-sitter support for outline-minor-mode (bug#68824)
* doc/emacs/text.texi (Outline Format): Add 'outline-search-function'.

* doc/lispref/elisp.texi (Top): Add new menu item "Outline Minor Mode"
after "Imenu".

* doc/lispref/modes.texi (Modes): Add new menu item "Outline Minor Mode"
after "Imenu".
(Major Mode Conventions): Mention "Outline Minor Mode" with @pxref.
(Outline Minor Mode): New node.

* doc/lispref/parsing.texi (Tree-sitter Major Modes): Mention
'treesit-outline-predicate' with @pxref.

* lisp/treesit.el (treesit-outline-predicate): New buffer-local variable.
(treesit-outline-predicate--from-imenu): New internal function.
(treesit-outline-search, treesit-outline-level): New functions.
(treesit-major-mode-setup): Set up treesit-outline-predicate,
outline-search-function and outline-level.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--outline-predicate):
New internal function.
(c-ts-base-mode): Set 'treesit-outline-predicate' to
'c-ts-mode--outline-predicate'.

* lisp/progmodes/heex-ts-mode.el (heex-ts-mode): Kill inherited
local variables 'outline-heading-end-regexp', 'outline-regexp',
'outline-level'.

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove 'outline-regexp'.
Suggested by john muhl <jm@pub.pink>.

* lisp/textmodes/html-ts-mode.el (html-ts-mode): Kill inherited
local variables 'outline-heading-end-regexp', 'outline-regexp',
'outline-level'.
2024-02-12 20:18:24 +02:00
Eli Zaretskii
25bf8d3cdc Merge from origin/emacs-29
b91f0ee2fc ; Fix last change
2f69353e4a Fix incompatibility with tree-sitter-javascript >= 0.20.2
d49124fc14 Avoid signaling errors from 'pixel-fill-region'
a398712761 eglot: Add nushell language server
5f56bc1cdf eglot: Add php-ts-mode to eglot-server-programs
c14c978e3b Support kotlin-ts-mode in Eglot
2024-02-03 06:49:53 -05:00
Eli Zaretskii
d49124fc14 Avoid signaling errors from 'pixel-fill-region'
* lisp/textmodes/pixel-fill.el (pixel-fill-region): Make sure the
selected window displays the current buffer.  This is important
when this function is called inside 'with-current-buffer' or
similar forms which temporarily change the buffer displayed in the
selected window.  (Bug#67791)
2024-02-03 11:09:36 +02:00
Graham Marlow
4adb4b2ac5 Fix 'fill-paragraph' in 'yaml-ts-mode'
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--fill-paragraph):
Avoid 'fill-paragraph' when outside of block_scalar or comment
nodes.  (Bug#68781)
2024-02-01 12:29:53 +02:00