From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: flypell and check-comments. Date: Sun, 11 Mar 2007 20:52:43 +0100 Message-ID: <45F45E0B.50707@gmx.at> References: <87fy8ht91r.fsf@lrde.org> <45EF0455.6080407@gmx.at> <87slccrl4w.fsf@lrde.org> <45F41466.6010108@gmx.at> <87bqizsneg.fsf@lrde.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1173643040 7066 80.91.229.12 (11 Mar 2007 19:57:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2007 19:57:20 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, Stefan Monnier To: =?ISO-8859-15?Q?Micha=EBl_Cadilhac?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 11 20:57:13 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HQUAI-00014X-L2 for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 20:57:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQUAs-0003r5-4K for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 14:57:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQUAe-0003pP-K8 for emacs-devel@gnu.org; Sun, 11 Mar 2007 15:57:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQUAc-0003oi-EA for emacs-devel@gnu.org; Sun, 11 Mar 2007 15:57:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQUAc-0003oW-9A for emacs-devel@gnu.org; Sun, 11 Mar 2007 14:57:30 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HQUA1-0007rp-KC for emacs-devel@gnu.org; Sun, 11 Mar 2007 15:56:54 -0400 Original-Received: (qmail invoked by alias); 11 Mar 2007 19:56:52 -0000 Original-Received: from N797P003.adsl.highway.telekom.at (EHLO [62.47.43.131]) [62.47.43.131] by mail.gmx.net (mp047) with SMTP; 11 Mar 2007 20:56:52 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+GH3txs0WG91E9OTVvt/s2IZgJn+1IjiqaaNh02s wLxBoK565jP8Pm User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <87bqizsneg.fsf@lrde.org> X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67727 Archived-At: >>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.