From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.devel Subject: Re: flyspell.el and non-word characters in CASECHARS Date: Fri, 20 Apr 2012 17:26:12 +0200 Message-ID: <20120420152612.GA15141@agmartin.aq.upm.es> References: <838vhvsb7q.fsf@gnu.org> <20120417172635.GA26574@agmartin.aq.upm.es> <83y5puqmar.fsf@gnu.org> <20120418162619.GA3478@agmartin.aq.upm.es> <8362cwkhey.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8t9RHnE3ZwKMSgU+" X-Trace: dough.gmane.org 1334935590 31159 80.91.229.3 (20 Apr 2012 15:26:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Apr 2012 15:26:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 20 17:26:29 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SLFjB-0006RD-1u for ged-emacs-devel@m.gmane.org; Fri, 20 Apr 2012 17:26:29 +0200 Original-Received: from localhost ([::1]:37450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLFjA-0001XG-EB for ged-emacs-devel@m.gmane.org; Fri, 20 Apr 2012 11:26:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLFj7-0001Wy-KZ for emacs-devel@gnu.org; Fri, 20 Apr 2012 11:26:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLFix-0004Is-39 for emacs-devel@gnu.org; Fri, 20 Apr 2012 11:26:25 -0400 Original-Received: from edison.ccupm.upm.es ([138.100.198.71]:50258 helo=smtp.upm.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLFiw-0004H5-Nd for emacs-devel@gnu.org; Fri, 20 Apr 2012 11:26:14 -0400 Original-Received: from agmartin.aq.upm.es (Agmartin.aq.upm.es [138.100.41.131]) by smtp.upm.es (8.14.3/8.14.3/edison-001) with ESMTP id q3KFQCGZ002993; Fri, 20 Apr 2012 17:26:12 +0200 Original-Received: by agmartin.aq.upm.es (Postfix, from userid 1000) id A5935405; Fri, 20 Apr 2012 17:26:12 +0200 (CEST) Mail-Followup-To: emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <8362cwkhey.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 138.100.198.71 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149865 Archived-At: --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 18, 2012 at 09:45:41PM +0300, Eli Zaretskii wrote: > > Date: Wed, 18 Apr 2012 18:26:19 +0200 > > From: Agustin Martin > > > > > I actually _added_ to the word-syntax test the test against CASECHARS, > > > like this: > > > > > > ((or (and (= flyspell-pre-point (- (point) 1)) > > > (or (eq (char-syntax (char-after flyspell-pre-point)) ?w) > > > (string-match-p (flyspell-get-casechars) > > > (buffer-substring-no-properties > > > flyspell-pre-point (1+ flyspell-pre-point))))) > > > (= flyspell-pre-point (point)) > > > (= flyspell-pre-point (+ (point) 1))) > > > nil) > > > > I tested with your changes and they do not seem to help here. > > Those were not all of the changes, I just showed them for an > illustration. The full change involved a similar change a few lines > below the above snippet, where again flyspell checks the word syntax. I noticed that part when first looking and later forgot about it. Thanks for reminding. Updated diff attached for wider testing. Regards, -- Agustin --8t9RHnE3ZwKMSgU+ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="flyspell.el_use-otherchars.2.diff" --- flyspell.el.orig 2012-04-12 15:06:12.780784001 +0200 +++ flyspell.el 2012-04-19 11:05:07.936947902 +0200 @@ -739,7 +739,11 @@ (eq flyspell-pre-pre-buffer flyspell-pre-buffer)) nil) ((or (and (= flyspell-pre-point (- (point) 1)) - (eq (char-syntax (char-after flyspell-pre-point)) ?w)) + (or (eq (char-syntax (char-after flyspell-pre-point)) ?w) + (string-match-p (ispell-get-otherchars) + (buffer-substring-no-properties + flyspell-pre-point (1+ flyspell-pre-point))) + )) (= flyspell-pre-point (point)) (= flyspell-pre-point (+ (point) 1))) nil) @@ -753,7 +757,11 @@ ;; If other post-command-hooks change the buffer, ;; flyspell-pre-point can lie past eob (bug#468). (null (char-after flyspell-pre-point)) - (eq (char-syntax (char-after flyspell-pre-point)) ?w))) + (or (eq (char-syntax (char-after flyspell-pre-point)) ?w) + (string-match-p (ispell-get-otherchars) + (buffer-substring-no-properties + flyspell-pre-point (1+ flyspell-pre-point))) + ))) nil) ((not (eq (current-buffer) flyspell-pre-buffer)) t) @@ -815,6 +823,7 @@ (save-excursion (backward-char 1) (and (looking-at (flyspell-get-not-casechars)) + (not (looking-at (ispell-get-otherchars))) (or flyspell-consider-dash-as-word-delimiter-flag (not (looking-at "-")))))) ;; yes because we have reached or typed a word delimiter. @@ -880,6 +889,7 @@ (save-excursion (backward-char 1) (and (and (looking-at (flyspell-get-not-casechars)) 1) + (not (looking-at (ispell-get-otherchars))) (and (or flyspell-consider-dash-as-word-delimiter-flag (not (looking-at "\\-"))) 2)))))) c)))) @@ -895,6 +905,7 @@ (save-excursion (backward-char 1) (and (looking-at (flyspell-get-not-casechars)) + (not (looking-at (ispell-get-otherchars))) (or flyspell-consider-dash-as-word-delimiter-flag (not (looking-at "\\-")))))))) c)) --8t9RHnE3ZwKMSgU+--