unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Agustin Martin <agustin.martin@hispalinux.es>
To: emacs-devel@gnu.org
Subject: Re: flyspell.el and non-word characters in CASECHARS
Date: Fri, 20 Apr 2012 17:26:12 +0200	[thread overview]
Message-ID: <20120420152612.GA15141@agmartin.aq.upm.es> (raw)
In-Reply-To: <8362cwkhey.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

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 <agustin.martin@hispalinux.es>
> > 
> > > 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

[-- Attachment #2: flyspell.el_use-otherchars.2.diff --]
[-- Type: text/x-diff, Size: 2046 bytes --]

--- 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))

      reply	other threads:[~2012-04-20 15:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 19:55 flyspell.el and non-word characters in CASECHARS Eli Zaretskii
2012-04-17 17:26 ` Agustin Martin
2012-04-17 17:51   ` Eli Zaretskii
2012-04-18 16:26     ` Agustin Martin
2012-04-18 18:45       ` Eli Zaretskii
2012-04-20 15:26         ` Agustin Martin [this message]

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=20120420152612.GA15141@agmartin.aq.upm.es \
    --to=agustin.martin@hispalinux.es \
    --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 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).