From: Eli Zaretskii <eliz@gnu.org>
To: Arash Esbati <arash@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Ispell: Skipping part of text in texinfo-mode
Date: Thu, 29 Aug 2024 20:51:03 +0300 [thread overview]
Message-ID: <8634mnfcag.fsf@gnu.org> (raw)
In-Reply-To: <m2seuncn4x.fsf@macmutant.fritz.box> (message from Arash Esbati on Thu, 29 Aug 2024 18:25:02 +0200)
> From: Arash Esbati <arash@gnu.org>
> Date: Thu, 29 Aug 2024 18:25:02 +0200
>
> I wanted to spellcheck a .texi file with 'M-x ispell RET' (running
> hunspell) and it occurred to me that skipping part of text like in .tex
> files isn't available OOTB. In my experiment, ispell didn't ignore
> anything and checked every Texinfo macro.
>
> Having no clue about ispell.el, I managed to ease the pain with this
> change:
Thanks. But there be dragons...
> +;;;###autoload
> +(defvar ispell-texinfo-skip-alists
> + (let ((single-arg (regexp-opt '("acronym" "cite" "code" "command" "env"
> + "file" "key" "option" "url" "var")
There are many more, no? @samp, @sc, @item, @itemx, to mention just a
few.
> + (skip-line (regexp-opt '("deffn" "defun" "defopt" "defvar"
> + "findex" "vindex" "kindex" "cindex"
> + "end "
Likewise here: @defmac, @defspec, and many others (see the Texinfo
manual).
> + ;; Special arrangement for things like @kbd{C-(}
> + ("@\\(?:kbd\\|samp\\){" . "[^@]}")
What about @kbd in general? and @key?
> + ;; Envs to skip entirely
> + ("^@\\(?:\\(?:small\\)?example\\|lisp\\|verbatim\\)" .
> + "^@end \\(?:\\(?:small\\)?example\\|lisp\\|verbatim\\)")
Why "entirely"? They frequently include comments, not just code.
> I presume there are some .texi writers here and I'd like to know how
> others handle this.
Very simple: press 'a' once on each directive you never want to look
at, and leave the rest for judgment calls.
> Is the change above useful for ispell.el?
To some degree, I guess. I think we should take only the bare
minimum, the ones that we want _never_ to be marked as mis-spellings,
and leave the rest to the users.
next prev parent reply other threads:[~2024-08-29 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 16:25 Ispell: Skipping part of text in texinfo-mode Arash Esbati
2024-08-29 17:51 ` Eli Zaretskii [this message]
2024-08-30 8:13 ` Arash Esbati
2024-08-30 10:46 ` Eli Zaretskii
2024-08-30 13:19 ` 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=8634mnfcag.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=arash@gnu.org \
--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.