GNU bug report logs - #13109
24.1; flyspell highlights words containing curly quotes which ispell-buffer accepts

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Fri, 7 Dec 2012 00:00:02 UTC

Severity: normal

Found in version 24.1

Done: Reuben Thomas <rrt <at> sc3d.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Reuben Thomas <rrt <at> sc3d.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 13109 <at> debbugs.gnu.org
Subject: bug#13109: 24.1; flyspell highlights words containing curly quotes which ispell-buffer accepts
Date: Fri, 3 May 2013 21:48:27 +0100
[Message part 1 (text/plain, inline)]
On 3 May 2013 21:20, Reuben Thomas <rrt <at> sc3d.org> wrote:

> On 3 May 2013 21:15, Reuben Thomas <rrt <at> sc3d.org> wrote:
>
>> On 11 December 2012 23:07, Juri Linkov <juri <at> jurta.org> wrote:
>>
>>> >> `ispell-aspell-find-dictionary' reads the ispell data from
>>> This fix means that aspell developers added a mapping from
>>> 2019 (RIGHT SINGLE QUOTATION MARK) to 27 (APOSTROPHE)
>>> in their character `compat' table.  This explains why
>>> `ispell-buffer' does work while `ispell-word' and `flyspell' don't.
>>>
>>> `ispell-word' and `flyspell' still use the information from
>>> /usr/lib/aspell/en.dat to parse the buffer to find the next word to
>>> check,
>>> and fail because they don't use the `compat' mappings from
>>> iso-8859-1.cmap.
>>>
>>
>> This finally annoyed me sufficiently that I decided I wanted a
>> workaround. Fortunately, this is easy, as it merely involves reapplying a
>> version of the fix I used to use when ispell-buffer didn't work. I now have
>> the following line in my custom.el:
>>
>>  '(ispell-local-dictionary-alist (quote (("british" "[[:alpha:]]"
>> "[^[:alpha:]]" "'’" t ("-d" "en_GB") nil utf-8))))
>>
>> I've copied the default settings and added a curly single quote to the
>> list of permitted "other characters". I imagine one can do the same for
>> other languages. It's ugly (principally because it copies rather than
>> overwriting information) but that information (the other entries in the
>> record) doesn't change often, so it'll do until a more comprehensive
>> solution is applied.
>>
>
> Belay that, it doesn't work. It seems I have to type a new word for
> flyspell to complain; merely passing the cursor over an old one (which
> suffices to remove a highlight in a word that has been added to the
> dictionary) does not suffice.
>
> If anyone can offer a functioning workaround, I'd be most grateful.
>

I read the documentation for ispell-dictionary-alist more carefully, and
came up with:

 '(ispell-local-dictionary-alist (quote (("british" "[[:alpha:]]"
"[^[:alpha:]]" "['’]" t ("-d" "en_GB") nil utf-8))))

where I made the "others" character set a character class.

I checked the aspell command actually being run (with "ps") to ensure that
it is indeed using "-d en_GB", and if I change the second argument to the
(bizarre) setting of "fr_FR", this is used, so my settings in
ispell-local-dictionary-alist are being used. If I run
ispell-get-otherchars, I get

['’]

as expected. If I run "(looking-at (ispell-get-otherchars))" while sitting
on a curly quote, I get:

t

Actually, now I see something weird is happening. I type:

"didn’", i.e. "didn" followed by a curly quote, and the word is highlighted
as misspelt. If I then type "t" to finish the word, it is unhighlighted,
after a pause.

Is there some other part of flyspell that is more rough-and-ready which I
also have to tweak?

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

This bug report was last modified 10 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.