From: martin rudalics <rudalics@gmx.at>
To: "Michaël Cadilhac" <michael@cadilhac.name>
Cc: emacs-devel@gnu.org, rms@gnu.org,
Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: flypell and check-comments.
Date: Sun, 11 Mar 2007 20:52:43 +0100 [thread overview]
Message-ID: <45F45E0B.50707@gmx.at> (raw)
In-Reply-To: <87bqizsneg.fsf@lrde.org>
>>since on the one hand you don't check for `ispell-check-comments' being
>>eq to 'exclusive
>
>
> I don't think it matters. At least, if it has to be fixed, it's not
> here, but maybe in `flyspell-generic-progmode-verify'. Well, I don't
> really know.
As far as I understand this, `ispell-check-comments' t means check
comments too, 'exclusive means check comments only, somehow inverting
the sense of nil. When using faces, nil means don't check when the face
is font-lock-comment-face, 'exclusive means check iff the face is
font-lock-comment-face, t means faces don't matter. When using
parse-state it's equally simple: nil means don't check for (nth 4
parse-state), exclusive means check iff (nth 4 parse-state), and t means
parse-state doesn't matter. Trivial.
>>while on the other hand you don't check whether you're in a string
>>(hence you don't fully emulate the default of
>>`flyspell-prog-text-faces' either).
>
>
> I don't understand, why should I check that I'm in a string?
Because the default value of `flyspell-prog-text-faces' has
`font-lock-string-face', `font-lock-comment-face' and
`font-lock-doc-face'. To emulate this you would have to spell-check iff
either (nth 3 parse-state) or (nth 4 parse-state) hold. If a user
wanted to spell-check doc-strings only this wouldn't work though.
>>Also `syntax-ppss' may get expensive for `flyspell-large-region'. It's
>>generally better to use it for the first position only, save position
>>and parse-state, and then do `parse-partial-sexp' from the last saved
>>position and parse-state.
>
>
> I probably agree :) However, I don't really see how this can be
> implemented. If ispell has to be mimicked, maybe the test should be
> made using comment-start -- comment-end, but not sure.
It would have to be done in `flyspell-external-point-words' before
`flyspell-word' is called. Never mind. If there are few spelling
errors `syntax-ppss' might be even faster.
>>Hence, IMHO ignoring `ispell-check-comments' here is a viable
>>alternative as well.
>
>
> Well, this is not just for the fun to make a patch, I really want to
> use `ispell-check-comments' (to nil).
In that case you should probably implement the 'exclusive option as
well. Otherwise you should insert a note about this.
next prev parent reply other threads:[~2007-03-11 19:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 14:36 flypell and check-comments Michaël Cadilhac
2007-03-07 18:28 ` martin rudalics
2007-03-07 18:42 ` Michaël Cadilhac
2007-03-07 20:31 ` Stefan Monnier
2007-03-07 21:55 ` martin rudalics
2007-03-11 4:24 ` Richard Stallman
2007-03-11 12:59 ` Michaël Cadilhac
2007-03-11 14:38 ` martin rudalics
2007-03-11 17:25 ` Michaël Cadilhac
2007-03-11 19:52 ` martin rudalics [this message]
2007-03-12 13:01 ` Michaël Cadilhac
2007-03-12 18:59 ` martin rudalics
2007-03-11 21:58 ` Stefan Monnier
2007-03-24 16:55 ` Chong Yidong
2007-03-25 19:48 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45F45E0B.50707@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
--cc=michael@cadilhac.name \
--cc=monnier@iro.umontreal.ca \
--cc=rms@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).