[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Adding % to `ispell-tex-arg-end'
From: |
Arash Esbati |
Subject: |
Adding % to `ispell-tex-arg-end' |
Date: |
Sat, 09 Jul 2016 11:02:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 |
Hi all,
when I run Ispell over the following snippet, the second [htbp] is
matched by Ispell:
\begin{figure}
[htbp]
\caption{foo}
\end{figure}
\begin{figure}%
[htbp] % <== matched by Ispell
\caption{foo}
\end{figure}
It is due to the regexp in `ispell-tex-arg-end':
(defun ispell-tex-arg-end (&optional arg)
"Skip across ARG number of braces."
(condition-case nil
(progn
(while (looking-at "[ \t\n]*\\[") (forward-sexp))
(forward-sexp (or arg 1)))
(error
(message "Error skipping s-expressions at point %d." (point))
(beep)
(sit-for 2))))
Would it be possible to add "%" to this function?
(defun ispell-tex-arg-end (&optional arg)
"Skip across ARG number of braces."
(condition-case nil
(progn
(while (looking-at "[ \t\n%]*\\[") (forward-sexp))
(forward-sexp (or arg 1)))
(error
(message "Error skipping s-expressions at point %d." (point))
(beep)
(sit-for 2))))
I hope that nobody writes such LaTeX code, but Ispell should match valid
code here.
Best, Arash
- Adding % to `ispell-tex-arg-end',
Arash Esbati <=