From: Arash Esbati <esbati@gmx.de>
To: emacs-devel@gnu.org
Subject: Re: Adding % to `ispell-tex-arg-end'
Date: Sat, 09 Jul 2016 11:43:40 +0200 [thread overview]
Message-ID: <nlqh0g$ur4$1@ger.gmane.org> (raw)
In-Reply-To: 83poqngoic.fsf@gnu.org
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Arash Esbati <esbati@gmx.de>
>> Date: Sat, 09 Jul 2016 11:02:27 +0200
>>
>> 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))))
>
> Maybe I'm missing something, but this solution doesn't look right to
> me, because if we do that, any mis-spelling in the comment after %
> will be skipped. E.g., imagine this text:
>
> \begin{figure}% mysspelled word
> [htbp] % <== matched by Ispell
> \caption{foo}
> \end{figure}
>
> We do want the "mysspelled" part highlighted, right? I think your
> suggestion makes Ispell skip it.
Hmm, my Ispell (Hunspell 1.4.1, Emacs 25.0.95.1) does not check comments
at all with `ispell-check-comments' set to t, e.g.:
% mysspelled word
is not matched. It does work when `ispell-check-comments' is set to
exclusive though. Will play more with it and create a new case.
Best, Arash
PS: Also my congratulations to your new role!
prev parent reply other threads:[~2016-07-09 9:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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='nlqh0g$ur4$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.