all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding % to `ispell-tex-arg-end'
@ 2016-07-09  9:02 Arash Esbati
  2016-07-09  9:16 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Arash Esbati @ 2016-07-09  9:02 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-09  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-09  9:02 Adding % to `ispell-tex-arg-end' Arash Esbati
2016-07-09  9:16 ` Eli Zaretskii
2016-07-09  9:43   ` Arash Esbati

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.