unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* flyspell.el and non-word characters in CASECHARS
@ 2012-04-16 19:55 Eli Zaretskii
  2012-04-17 17:26 ` Agustin Martin
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2012-04-16 19:55 UTC (permalink / raw)
  To: emacs-devel

In flyspell.el:flyspell-check-pre-word-p we have this snippet:

   ((or (and (= flyspell-pre-point (- (point) 1))
	     (eq (char-syntax (char-after flyspell-pre-point)) ?w))
	(= flyspell-pre-point (point))
	(= flyspell-pre-point (+ (point) 1)))
    nil)
   ((and (symbolp this-command)
	 (not executing-kbd-macro)
	 (or (get this-command 'flyspell-delayed)
	     (and (get this-command 'flyspell-deplacement)
		  (eq flyspell-previous-command this-command)))
	 (or (= (current-column) 0)
	     (= (current-column) flyspell-pre-column)
	     ;; 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)))
    nil)

I think it's wrong to test for word syntax here; we should test for a
match against CASECHARS, or maybe even CASECHARS and OTHERCHARS.
These are what defines a "word" in this context, because flyspell must
be consistent with what the speller does.

I bumped into this spell-checking Hebrew text with Hunspell: the he_IL
dictionary considers " and ' be WORDCHARS (they are indeed used as
part of words of foreign origin and in acronyms), but typing these
characters under flyspell-mode immediately marks the preceding word as
a typo, although self-insert-command is in
flyspell-default-delayed-commands, and so should have triggered a
3-sec delay in spell-checking, letting me to continue typing.  If I
use a match against CASECHARS instead of the word syntax, the problem
goes away.

Am I missing something?



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-20 15:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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