all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arash Esbati <esbati@gmx.de>
To: emacs-devel@gnu.org
Subject: Adding % to `ispell-tex-arg-end'
Date: Sat, 09 Jul 2016 11:02:27 +0200	[thread overview]
Message-ID: <nlqejm$ukb$1@ger.gmane.org> (raw)

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




             reply	other threads:[~2016-07-09  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-09  9:02 Arash Esbati [this message]
2016-07-09  9:16 ` Adding % to `ispell-tex-arg-end' Eli Zaretskii
2016-07-09  9:43   ` 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='nlqejm$ukb$1@ger.gmane.org' \
    --to=esbati@gmx.de \
    --cc=emacs-devel@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.