unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
To: 23097@debbugs.gnu.org
Subject: bug#23097: 24.5; ispell.el: lines with both CASECHARS and NOT-CASECHARS get sent to the spell checker
Date: Wed, 23 Mar 2016 21:11:19 +0300	[thread overview]
Message-ID: <56F2DC47.2090600@gmail.com> (raw)

Each entry ispell-dictionary-alist has elements called CASECHARS and 
NOT-CASECHARS. They are used for defining what gets sent to the spell 
checker and what does not.

One use case for them is that, if you have two dictionaries for 
languages with totally different alphabets, you can spellcheck a file 
where both languages are mixed together. In theory.

Here's what happens in practice:
If line contains only CASECHARS, it gets sent to the spell checker.
If line contains only NOT-CASECHARS, it does not get sent to the spell 
checker.
If line contains both CASECHARS and NOT-CASECHARS, the whole line gets 
sent to the spell checker.

Sending the whole line makes NOT-CASECHARS pretty useless. I think the 
reasonable behavior in this case would be sending the line word by word.

Here's how to repeat this with aspell.
1. Starting from emacs -Q eval this:
(setq ispell-program-name "aspell")
(defun ispell-set-my-dictionaries()
   (setq ispell-dictionary-alist (delq (assoc "english" 
ispell-dictionary-alist) ispell-dictionary-alist))
   (add-to-list 'ispell-dictionary-alist
                '("english" "[kcat]" "[dogh]" "[']" nil ("-B") nil 
iso-8859-1)))
(advice-add 'ispell-set-spellchecker-params :after 
#'ispell-set-my-dictionaries)
2. ispell-change-dictionary to english.
3. ispell-buffer a buffer containing this:
kat
doh
kat doh

"Kat" at the first line would get sent to aspell, since it passes 
CASECHARS. This is fine. "Doh" at the second line would be ignored, 
since it's not in CASECHARS. This is fine too. At the line with both 
words, not only "kat" would get sent, but also "doh" and that's what we 
don't want to happen.

-- 
Best Regards,
Nikolay Kudryavtsev






             reply	other threads:[~2016-03-23 18:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 18:11 Nikolay Kudryavtsev [this message]
2016-03-23 18:22 ` bug#23097: 24.5; ispell.el: lines with both CASECHARS and NOT-CASECHARS get sent to the spell checker Eli Zaretskii
2016-03-23 20:12   ` Nikolay Kudryavtsev
2020-08-15  4:22   ` Stefan Kangas
2020-08-15 16:15     ` Eli Zaretskii
2020-08-15 16:40       ` Stefan Kangas
2020-08-17  9:20         ` Nikolay Kudryavtsev
2020-08-17 12:48           ` Stefan Kangas
2020-08-17 16:40           ` Eli Zaretskii
     [not found]             ` <08f3ac29-761c-ced7-1e2f-0f643512b986@gmail.com>
2020-10-13 17:00               ` Eli Zaretskii
     [not found]               ` <83mu0q132o.fsf@gnu.org>
2020-10-14 19:20                 ` Nikolay Kudryavtsev

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=56F2DC47.2090600@gmail.com \
    --to=nikolay.kudryavtsev@gmail.com \
    --cc=23097@debbugs.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).