all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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: Fri, 30 Aug 2024 13:46:16 +0300	[thread overview]
Message-ID: <86o75ae1af.fsf@gnu.org> (raw)
In-Reply-To: <m2ikvia0mw.fsf@macmutant.fritz.box> (message from Arash Esbati on Fri, 30 Aug 2024 10:13:59 +0200)

> From: Arash Esbati <arash@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 30 Aug 2024 10:13:59 +0200
> 
> Yes, at some point, I have to go through the @-Command List section in
> the Texinfo manual.

Then let's discuss them one by one, based on the Texinfo manual (which
documents much more than you can find in our manuals).  Some commands
need to ignore their arguments, some don't.  For example, @var's
argument is more often than not be a real word or a phrase made out of
words, like @var{next-file}.

> > Very simple: press 'a' once on each directive you never want to look
> > at, and leave the rest for judgment calls.
> 
> Thanks, this was also my approach until now, but I didn't find it
> satisfactory.

It's definitely a possibility, I think, so we IMO should support it,
at least as an option.

> We can discuss which macros to include and which to drop once the code
> is working.  I'm currently facing the issue that when I open a .texi
> file, eval (setq ispell-parser 'texinfo) and do M-x ispell RET, also
> comments in the file are checked, the value of `ispell-check-comments'
> is nil, though.  Do you have an idea what's going wrong?  I don't get
> this in a .tex buffer.

Doesn't ispell-check-comments only relevant to
ispell-comments-and-strings?

> +(defvar ispell--texinfo-arg-end-syntax-table
> +  (let ((table (make-syntax-table))
> +        (chars '((?\f . ">") (?\n . ">")
> +                 (?\" . " ") (?\@ . "/")
> +                 (?\( . " ") (?\) . " ")
> +                 (?\[ . " ") (?\] . " ")
> +                 (?\< . " ") (?\> . " ")
> +                 (?\\ . " ")
> +                 (?\{ . "(}") (?\} . "){"))))
> +    (dolist (elt chars)
> +      (modify-syntax-entry (car elt) (cdr elt) table))
> +    table))
> +
> +(defun ispell-texinfo-arg-end (&optional arg)
> +  "Skip across ARG number of braces."
> +  (condition-case nil
> +      (with-syntax-table ispell--texinfo-arg-end-syntax-table
> +        (unless (= (following-char) ?\{)
> +          (skip-chars-forward "^{"))
> +        (forward-sexp (or arg 1)))
> +    (error
> +     (message "Error skipping s-expressions at point %d." (point))
> +     (beep)
> +     (sit-for 2))))

Does this support nested markup, as in

  @w{@code{(@var{file} . @var{buffer})}}

in a way that will allow to spell-check "file" and "buffer"?  I'm not
sure syntax-table feature supports nesting.



  reply	other threads:[~2024-08-30 10:46 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
2024-08-30  8:13   ` Arash Esbati
2024-08-30 10:46     ` Eli Zaretskii [this message]
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=86o75ae1af.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.