From: Arash Esbati <arash@gnu.org>
To: 53390@debbugs.gnu.org
Subject: bug#53390: 29.0.50; [PATCH] Don't look for invalid whitespaces
Date: Thu, 20 Jan 2022 14:28:16 +0100 [thread overview]
Message-ID: <86a6fqwn7z.fsf@gnu.org> (raw)
Hi all,
I'd like to suggest a minor change to `ispell-tex-skip-alists' which
looks for valid code and doesn't fix an apparent bug:
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index ae3b18ed17..6382b402c0 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1673,14 +1673,13 @@ ispell-tex-skip-alists
("\\\\bibliographystyle" ispell-tex-arg-end)
("\\\\makebox" ispell-tex-arg-end 0)
("\\\\e?psfig" ispell-tex-arg-end)
- ("\\\\document\\(class\\|style\\)" .
- "\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}"))
+ ("\\\\document\\(class\\|style\\)" . "\\\\begin[ \t\n]*{document}"))
(;; delimited with \begin. In ispell: displaymath, eqnarray, eqnarray*,
;; equation, minipage, picture, tabular, tabular* (ispell)
("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0)
("list" ispell-tex-arg-end 2)
- ("program" . "\\\\end[ \t\n]*{[ \t\n]*program[ \t\n]*}")
- ("verbatim\\*?" . "\\\\end[ \t\n]*{[ \t\n]*verbatim\\*?[ \t\n]*}"))))
+ ("program" . "\\\\end[ \t]*{program}")
+ ("verbatim\\*?" . "\\\\end[ \t]*{verbatim\\*?}"))))
"Lists of regions to be skipped in TeX mode.
First list is used raw.
Second list has key placed inside \\begin{}.
--8<---------------cut here---------------end--------------->8---
Currently, the regexps would accept the following cases:
1.
\documentclass{article}
\begin{ document}
foo
\end{document}
Running LaTeX on the file gives:
! LaTeX Error: Environment document undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 \begin{ document}
Note that space is significant in environment names.
2.
\documentclass{article}
\usepackage{program}
\begin{document}
\begin{program}
foo bar
\end{ program}
\end{document}
Running LaTeX on the file above says:
! LaTeX Error: \begin{program} on input line 4 ended by \end{ program}.
3.
\documentclass{article}
\begin{document}
\begin{verbatim}
foo
\end {verbatim}
\end{document}
Running LaTeX on the file above says:
Runaway argument?
^^Mfoo^^M\end {verbatim}^^M^^M\end{document}^^M^^M^^M^^M^^M^^M^^M^^M^^M\ETC.
! File ended while scanning use of \@xverbatim.
<inserted text>
\par
This one is delicate since vanilla LaTeX looks exactly for 14 characters
\end{verbatim} and packages like verbatim.sty lift this limitation and
allow a whitespace (and not a linebreak) between \end and {verbatim}.
Please let me know if I should install this change.
Best, Arash
next reply other threads:[~2022-01-20 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 13:28 Arash Esbati [this message]
2022-01-20 14:16 ` bug#53390: 29.0.50; [PATCH] Don't look for invalid whitespaces Lars Ingebrigtsen
2022-01-20 18:29 ` Arash Esbati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86a6fqwn7z.fsf@gnu.org \
--to=arash@gnu.org \
--cc=53390@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.