unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
@ 2016-12-19 12:28 Reuben Thomas
  2016-12-19 16:23 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-19 12:28 UTC (permalink / raw)
  To: 25230


[-- Attachment #1.1: Type: text/plain, Size: 703 bytes --]

I noticed that I had not quite finished the work of commit 854ed8a, which
removed the test for support for POSIX character classes, as that is now
guaranteed.

In ispell-set-spellchecker-params, there is code that used to be run
conditionally on support for POSIX character classes, which sets all the
CASECHARS and NOT-CASECHARS entries for built-in dictionaries to
[[:alpha:]] and [^[:alpha:]] respectively.

There is no point doing this unconditionally, so instead, put these
character classes directly into the initial values used in
ispell-dictionary-base-alist. This change also makes the variable's
initialization easier to read.

The attached patch makes these changes.

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 1270 bytes --]

[-- Attachment #2: 0001-Use-alpha-by-default-for-ispell-built-in-dictionarie.patch --]
[-- Type: text/x-patch, Size: 12545 bytes --]

From 73101807ff3abd052b137fb8f881953b9beaa4a7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Mon, 19 Dec 2016 12:17:44 +0000
Subject: [PATCH 1/4] Use [:alpha:] by default for ispell built-in dictionaries

* lisp/textmodes/ispell.el (ispell-dictionary-base-alist)
(ispell-set-spellchecker-params): Since Emacs is now guaranteed to
support named character classes in regexps, use `[:alpha:]' directly
in ispell-dictionary-base-alist rather than setting it in
ispell-set-spellchecker-params.  (This used to be done conditionally
until commit 854ed8a, of which this patch is a logical completion.)
---
 lisp/textmodes/ispell.el | 116 +++++++++++++++--------------------------------
 1 file changed, 36 insertions(+), 80 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 23ee412..0aced0c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -436,114 +436,70 @@ ispell-dictionary-base-alist
      ;; The default dictionary.  It may be English.aff, or any other
      ;; dictionary depending on locale and such things.  We should probably
      ;; ask ispell what dictionary it's using, but until we do that, let's
-     ;; just use a minimal regexp. [:alpha:] will later be set if possible.
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     ;; just use a minimal regexp.
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("american"				; Yankee English
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("brasileiro"			; Brazilian mode
-     "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
-     "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
-     "[']" nil nil nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil iso-8859-1)
     ("british"				; British version
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("castellano"			; Spanish mode
-     "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[-]" nil ("-B") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-]" nil ("-B") "~tex" iso-8859-1)
     ("castellano8"			; 8 bit Spanish mode
-     "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[-]" nil ("-B" "-d" "castellano") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-]" nil ("-B" "-d" "castellano") "~latin1" iso-8859-1)
     ("czech"
-     "[A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]"
-     "[^A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]"
-     "" nil ("-B") nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B") nil iso-8859-2)
     ("dansk"				; Dansk.aff
-     "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
-     "[']" nil ("-C") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-C") nil iso-8859-1)
     ("deutsch"				; Deutsch.aff
-     "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") "~tex" iso-8859-1)
     ("deutsch8"
-     "[a-zA-Z\304\326\334\344\366\337\374]"
-     "[^a-zA-Z\304\326\334\344\366\337\374]"
-     "[']" t ("-C" "-d" "deutsch") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C" "-d" "deutsch") "~latin1" iso-8859-1)
     ("english"				; make English explicitly selectable
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("esperanto"
-     "[A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]"
-     "[^A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]"
-     "[-']" t ("-C") "~latin3" iso-8859-3)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-']" t ("-C") "~latin3" iso-8859-3)
     ("esperanto-tex"
-     "[A-Za-z^\\]" "[^A-Za-z^\\]"
-     "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-3)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-3)
     ("finnish"
-     "[A-Za-z\345\344\366\305\304\326]"
-     "[^A-Za-z\345\344\366\305\304\326]"
-     "[:]" nil ("-C") "~list" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[:]" nil ("-C") "~list" iso-8859-1)
     ("francais7"
-     "[A-Za-z]" "[^A-Za-z]" "[`'^-]" t nil nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[`'^-]" t nil nil iso-8859-1)
     ("francais"				; Francais.aff
-     "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
-     "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
-     "[-'.@]" t nil "~list" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-'.@]" t nil "~list" iso-8859-1)
     ("francais-tex"			; Francais.aff
-     "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
-     "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
-     "[-'^`\".@]" t nil "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-'^`\".@]" t nil "~tex" iso-8859-1)
     ("german"				; german.aff
-     "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") "~tex" iso-8859-1)
     ("german8"				; german.aff
-     "[a-zA-Z\304\326\334\344\366\337\374]"
-     "[^a-zA-Z\304\326\334\344\366\337\374]"
-     "[']" t ("-C" "-d" "german") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C" "-d" "german") "~latin1" iso-8859-1)
     ("italiano"				; Italian.aff
-     "[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
-     "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
-     "[-.]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-.]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
     ("nederlands"			; Nederlands.aff
-     "[A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[^A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[']" t ("-C") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") nil iso-8859-1)
     ("nederlands8"			; Dutch8.aff
-     "[A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[^A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[']" t ("-C") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") nil iso-8859-1)
     ("norsk"				; 8 bit Norwegian mode
-     "[A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
-     "[^A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
-     "[\"]" nil nil "~list" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[\"]" nil nil "~list" iso-8859-1)
     ("norsk7-tex"			; 7 bit Norwegian TeX mode
-     "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"
-     "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
     ("polish"				; Polish mode
-     "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
-     "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
-     "[.]" nil nil nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "[.]" nil nil nil iso-8859-2)
     ("portugues"                        ; Portuguese mode
-     "[a-zA-Z\301\302\307\311\323\340\341\342\351\352\355\363\343\347\372]"
-     "[^a-zA-Z\301\302\307\311\323\340\341\342\351\352\355\363\343\347\372]"
-     "[']" t ("-C") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") "~latin1" iso-8859-1)
     ("russian"				; Russian.aff (KOI8-R charset)
-     "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
-     "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
-     "" nil nil nil koi8-r)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil nil nil koi8-r)
     ("russianw"				; russianw.aff (CP1251 charset)
-     "[\300\301\302\303\304\305\250\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\334\333\332\335\336\337\340\341\342\343\344\345\270\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\374\373\372\375\376\377]"
-     "[^\300\301\302\303\304\305\250\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\334\333\332\335\336\337\340\341\342\343\344\345\270\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\374\373\372\375\376\377]"
-     "" nil nil nil windows-1251)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil nil nil windows-1251)
     ("slovak"				; Slovakian
-     "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "" nil ("-B") nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B") nil iso-8859-2)
     ("slovenian"                        ; Slovenian
-     "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "" nil ("-B" "-d" "slovenian") nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B" "-d" "slovenian") nil iso-8859-2)
     ("svenska"				; Swedish mode
-     "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
-     "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
-     "[']" nil ("-C") "~list" iso-8859-1)
-    ("hebrew" "[\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "[^\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "" nil ("-B") nil cp1255))
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-C") "~list" iso-8859-1)
+    ("hebrew"
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B") nil cp1255))
   "Base value for `ispell-dictionary-alist'.")
 
 (defvar ispell-dictionary-alist nil
@@ -1290,8 +1246,8 @@ ispell-set-spellchecker-params
         (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
                         (list
                          (nth 0 adict)   ; dict name
-                         "[[:alpha:]]"   ; casechars
-                         "[^[:alpha:]]"  ; not-casechars
+                         (nth 1 adict)   ; casechars
+                         (nth 2 adict)   ; not-casechars
                          (nth 3 adict)   ; otherchars
                          (nth 4 adict)   ; many-otherchars-p
                          (nth 5 adict)   ; ispell-args
-- 
2.7.4


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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-19 12:28 bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries Reuben Thomas
@ 2016-12-19 16:23 ` Eli Zaretskii
  2016-12-19 21:17   ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2016-12-19 16:23 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25230

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Mon, 19 Dec 2016 12:28:57 +0000
> 
> In ispell-set-spellchecker-params, there is code that used to be run conditionally on support for POSIX
> character classes, which sets all the CASECHARS and NOT-CASECHARS entries for built-in dictionaries to
> [[:alpha:]] and [^[:alpha:]] respectively.
> 
> There is no point doing this unconditionally, so instead, put these character classes directly into the initial
> values used in ispell-dictionary-base-alist. This change also makes the variable's initialization easier to read.
> 
> The attached patch makes these changes.
> 
> -     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
> +     ;; just use a minimal regexp.
> +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)

You are assuming that [[:alpha:]] and [A-Za-z] are identical.  But
they are far from being identical, not since Emacs 25.1.  I mentioned
this in another thread today.

>      ("brasileiro"			; Brazilian mode
> -     "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
> -     "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
> -     "[']" nil nil nil iso-8859-1)
> +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil iso-8859-1)

Same here: [[:alpha:]] is much broader now than any set of characters
supported by a single language.

In any case, these settings are for Ispell, which only supports
single-byte encodings.  We cannot use arbitrary characters with it.

IOW, I don't think this patch is in the right direction.

Thanks.





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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-19 16:23 ` Eli Zaretskii
@ 2016-12-19 21:17   ` Reuben Thomas
  2016-12-20 15:37     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-19 21:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25230

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

On 19 December 2016 at 16:23, Eli Zaretskii <eliz@gnu.org> wrote:

>
> You are assuming that [[:alpha:]] and [A-Za-z] are identical.


​No, because my patch does not change the current behaviour of the code.
The assumption that [:alpha:] is OK to use here instead of A-Za-z is
already in the code.​

IOW, I don't think this patch is in the right direction.
>

​From the conversation on other bugs, I think that the correct thing to do
here is to remove the first part of my patch (so that the hardwired
dictionaries keep their individual casechars and not-casechars settings),
and keep the second part of the patch (so that
ispell-set-spellchecker-params does not change them all to [:alpha:].

Does that sound plausible? If so, I'll prepare a modified patch for your
consideration.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1704 bytes --]

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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-19 21:17   ` Reuben Thomas
@ 2016-12-20 15:37     ` Eli Zaretskii
  2016-12-20 18:42       ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2016-12-20 15:37 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25230

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Mon, 19 Dec 2016 21:17:17 +0000
> Cc: 25230@debbugs.gnu.org
> 
>     You are assuming that [[:alpha:]] and [A-Za-z] are identical.
> 
> ​No, because my patch does not change the current behaviour of the code. The assumption that [:alpha:] is OK to use here instead of A-Za-z is already in the code.​

Can you point out where in the code you see that assumption?

> ​From the conversation on other bugs, I think that the correct thing to do here is to remove the first part of my patch (so that the hardwired dictionaries keep their individual casechars and not-casechars settings), and keep the second part of the patch (so that ispell-set-spellchecker-params does not change them all to [:alpha:].
> 
> Does that sound plausible?

I think so, but we should make sure the hard-wired values work with
Aspell, before we make that change.  If they don't, we should provide
something that works for Aspell.





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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-20 15:37     ` Eli Zaretskii
@ 2016-12-20 18:42       ` Reuben Thomas
  2016-12-20 19:37         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-20 18:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25230

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

On 20 December 2016 at 15:37, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Mon, 19 Dec 2016 21:17:17 +0000
> > Cc: 25230@debbugs.gnu.org
> >
> >     You are assuming that [[:alpha:]] and [A-Za-z] are identical.
> >
> > ​No, because my patch does not change the current behaviour of the code.
> The assumption that [:alpha:] is OK to use here instead of A-Za-z is
> already in the code.​
>
> Can you point out where in the code you see that assumption?
>

The current code in about line 1300 (ispell-set-spellchecker-params)
unconditionally overrides all the built-in dictionaries' values for
casechars and not-casechars with [:alpha:] in the loop that starts

(dolist (adict ispell-dictionary-alist) …)

At this point, ispell-dictionary-alist already contains
ispell-dictionary-base-alist (see a few lines above). Therefore, the
original values in the intializer are never used. (Hence my original patch.)

​​
> > ​From the conversation on other bugs, I think that the correct thing to
> do here is to remove the first part of my patch (so that the hardwired
> dictionaries keep their individual casechars and not-casechars settings),
> and keep the second part of the patch (so that
> ispell-set-spellchecker-params does not change them all to [:alpha:].
> >
> > Does that sound plausible?
>
> I think so, but we should make sure the hard-wired values work with
> Aspell, before we make that change.  If they don't, we should provide
> something that works for Aspell.
>

​I thought the hard-wired values were only for ispell dictionaries (for
aspell, the dictionaries are searched for on the computer)…

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 2936 bytes --]

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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-20 18:42       ` Reuben Thomas
@ 2016-12-20 19:37         ` Eli Zaretskii
  2016-12-20 21:45           ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2016-12-20 19:37 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25230

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 20 Dec 2016 18:42:05 +0000
> Cc: 25230@debbugs.gnu.org
> 
>  > ​No, because my patch does not change the current behaviour of the code. The assumption that
>  [:alpha:] is OK to use here instead of A-Za-z is already in the code.​
> 
>  Can you point out where in the code you see that assumption?
> 
> The current code in about line 1300 (ispell-set-spellchecker-params) unconditionally overrides all the built-in
> dictionaries' values for casechars and not-casechars with [:alpha:] in the loop that starts
> 
> (dolist (adict ispell-dictionary-alist) …)

That's the place where you suggested to keep the original values.  I
thought there were other places, but it's good to know there are none.

>  I think so, but we should make sure the hard-wired values work with
>  Aspell, before we make that change. If they don't, we should provide
>  something that works for Aspell.
> 
> ​I thought the hard-wired values were only for ispell dictionaries (for aspell, the dictionaries are searched for on
> the computer)…

But if we find that an installed dictionary is one of those in the
data base of the hard-wired values, we use those values, right?
Because AFAIK Aspell provides only one of the 3 character sets we need
in its dictionaries, the other 2 need to be somehow guessed or
provided by the user.





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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-20 19:37         ` Eli Zaretskii
@ 2016-12-20 21:45           ` Reuben Thomas
  2016-12-21  0:20             ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-20 21:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25230

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

On 20 December 2016 at 19:37, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 20 Dec 2016 18:42:05 +0000
> > Cc: 25230@debbugs.gnu.org
> >
> >  > ​No, because my patch does not change the current behaviour of the
> code. The assumption that
> >  [:alpha:] is OK to use here instead of A-Za-z is already in the code.​
> >
> >  Can you point out where in the code you see that assumption?
> >
> > The current code in about line 1300 (ispell-set-spellchecker-params)
> unconditionally overrides all the built-in
> > dictionaries' values for casechars and not-casechars with [:alpha:] in
> the loop that starts
> >
> > (dolist (adict ispell-dictionary-alist) …)
>
> That's the place where you suggested to keep the original values.  I
> thought there were other places, but it's good to know there are none.
>

​I believe not, indeed.​

>  I think so, but we should make sure the hard-wired values work with
> >  Aspell, before we make that change. If they don't, we should provide
> >  something that works for Aspell.
> >
> > ​I thought the hard-wired values were only for ispell dictionaries (for
> aspell, the dictionaries are searched for on
> > the computer)…
>
> But if we find that an installed dictionary is one of those in the
> data base of the hard-wired values, we use those values, right?
>

​No, for aspell, we should only be using aspell dictionaries (found by
ispell-find-aspell-dictionaries).​


> Because AFAIK Aspell provides only one of the 3 character sets we need
> in its dictionaries, the other 2 need to be somehow guessed or
> provided by the user.
>

​They are guessed as [:alpha:], because we don't have better information
(that I know of).

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 2999 bytes --]

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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-20 21:45           ` Reuben Thomas
@ 2016-12-21  0:20             ` Reuben Thomas
  2016-12-21 17:15               ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-21  0:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25230


[-- Attachment #1.1: Type: text/plain, Size: 350 bytes --]

Here's an updated patch, which simply removes the overriding of the
built-in CASECHARS/NOT-CASECHARS settings for ispell dictionaries. It
assumes that all other dictionaries (either configured by the user or found
by the various auto-scanning functions) will have sensible
CASECHARS/NOT-CASECHARS values, which is expected to be the case at present.

[-- Attachment #1.2: Type: text/html, Size: 466 bytes --]

[-- Attachment #2: 0001-Keep-default-CASECHARS-NOT-CASECHARS-for-ispell-buil.patch --]
[-- Type: text/x-patch, Size: 11767 bytes --]

From 00b66a9599cf65e2188dd590d256c301e978c6a2 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Mon, 19 Dec 2016 12:17:44 +0000
Subject: [PATCH 1/6] Keep default CASECHARS/NOT-CASECHARS for ispell built-in
 dictionaries

* lisp/textmodes/ispell.el (ispell-set-spellchecker-params): Do not
override CASECHARS and NOT-CASECHARS.  The ispell dictionaries
retain their hardwired values, and all other dictionaries are given
sensible defaults.
---
 lisp/textmodes/ispell.el | 112 ++++++++++++++---------------------------------
 1 file changed, 34 insertions(+), 78 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 23ee412..82e5c2b 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -436,114 +436,70 @@ ispell-dictionary-base-alist
      ;; The default dictionary.  It may be English.aff, or any other
      ;; dictionary depending on locale and such things.  We should probably
      ;; ask ispell what dictionary it's using, but until we do that, let's
-     ;; just use a minimal regexp. [:alpha:] will later be set if possible.
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     ;; just use a minimal regexp.
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("american"				; Yankee English
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("brasileiro"			; Brazilian mode
-     "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
-     "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
-     "[']" nil nil nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil iso-8859-1)
     ("british"				; British version
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("castellano"			; Spanish mode
-     "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[-]" nil ("-B") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-]" nil ("-B") "~tex" iso-8859-1)
     ("castellano8"			; 8 bit Spanish mode
-     "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
-     "[-]" nil ("-B" "-d" "castellano") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-]" nil ("-B" "-d" "castellano") "~latin1" iso-8859-1)
     ("czech"
-     "[A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]"
-     "[^A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]"
-     "" nil ("-B") nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B") nil iso-8859-2)
     ("dansk"				; Dansk.aff
-     "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
-     "[']" nil ("-C") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-C") nil iso-8859-1)
     ("deutsch"				; Deutsch.aff
-     "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") "~tex" iso-8859-1)
     ("deutsch8"
-     "[a-zA-Z\304\326\334\344\366\337\374]"
-     "[^a-zA-Z\304\326\334\344\366\337\374]"
-     "[']" t ("-C" "-d" "deutsch") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C" "-d" "deutsch") "~latin1" iso-8859-1)
     ("english"				; make English explicitly selectable
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
     ("esperanto"
-     "[A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]"
-     "[^A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]"
-     "[-']" t ("-C") "~latin3" iso-8859-3)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-']" t ("-C") "~latin3" iso-8859-3)
     ("esperanto-tex"
-     "[A-Za-z^\\]" "[^A-Za-z^\\]"
-     "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-3)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-3)
     ("finnish"
-     "[A-Za-z\345\344\366\305\304\326]"
-     "[^A-Za-z\345\344\366\305\304\326]"
-     "[:]" nil ("-C") "~list" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[:]" nil ("-C") "~list" iso-8859-1)
     ("francais7"
-     "[A-Za-z]" "[^A-Za-z]" "[`'^-]" t nil nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[`'^-]" t nil nil iso-8859-1)
     ("francais"				; Francais.aff
-     "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
-     "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
-     "[-'.@]" t nil "~list" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-'.@]" t nil "~list" iso-8859-1)
     ("francais-tex"			; Francais.aff
-     "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
-     "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
-     "[-'^`\".@]" t nil "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-'^`\".@]" t nil "~tex" iso-8859-1)
     ("german"				; german.aff
-     "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") "~tex" iso-8859-1)
     ("german8"				; german.aff
-     "[a-zA-Z\304\326\334\344\366\337\374]"
-     "[^a-zA-Z\304\326\334\344\366\337\374]"
-     "[']" t ("-C" "-d" "german") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C" "-d" "german") "~latin1" iso-8859-1)
     ("italiano"				; Italian.aff
-     "[A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
-     "[^A-Z\300\301\310\311\314\315\322\323\331\332a-z\340\341\350\351\354\355\363\371\372]"
-     "[-.]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[-.]" nil ("-B" "-d" "italian") "~tex" iso-8859-1)
     ("nederlands"			; Nederlands.aff
-     "[A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[^A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[']" t ("-C") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") nil iso-8859-1)
     ("nederlands8"			; Dutch8.aff
-     "[A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[^A-Za-z\300\301\302\303\304\305\307\310\311\312\313\314\315\316\317\322\323\324\325\326\331\332\333\334\340\341\342\343\344\345\347\350\351\352\353\354\355\356\357\361\362\363\364\365\366\371\372\373\374]"
-     "[']" t ("-C") nil iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") nil iso-8859-1)
     ("norsk"				; 8 bit Norwegian mode
-     "[A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
-     "[^A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
-     "[\"]" nil nil "~list" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[\"]" nil nil "~list" iso-8859-1)
     ("norsk7-tex"			; 7 bit Norwegian TeX mode
-     "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"
-     "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
     ("polish"				; Polish mode
-     "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
-     "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
-     "[.]" nil nil nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "[.]" nil nil nil iso-8859-2)
     ("portugues"                        ; Portuguese mode
-     "[a-zA-Z\301\302\307\311\323\340\341\342\351\352\355\363\343\347\372]"
-     "[^a-zA-Z\301\302\307\311\323\340\341\342\351\352\355\363\343\347\372]"
-     "[']" t ("-C") "~latin1" iso-8859-1)
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-C") "~latin1" iso-8859-1)
     ("russian"				; Russian.aff (KOI8-R charset)
-     "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
-     "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
-     "" nil nil nil koi8-r)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil nil nil koi8-r)
     ("russianw"				; russianw.aff (CP1251 charset)
-     "[\300\301\302\303\304\305\250\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\334\333\332\335\336\337\340\341\342\343\344\345\270\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\374\373\372\375\376\377]"
-     "[^\300\301\302\303\304\305\250\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\334\333\332\335\336\337\340\341\342\343\344\345\270\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\374\373\372\375\376\377]"
-     "" nil nil nil windows-1251)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil nil nil windows-1251)
     ("slovak"				; Slovakian
-     "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "" nil ("-B") nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B") nil iso-8859-2)
     ("slovenian"                        ; Slovenian
-     "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
-     "" nil ("-B" "-d" "slovenian") nil iso-8859-2)
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B" "-d" "slovenian") nil iso-8859-2)
     ("svenska"				; Swedish mode
-     "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
-     "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
-     "[']" nil ("-C") "~list" iso-8859-1)
-    ("hebrew" "[\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "[^\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "" nil ("-B") nil cp1255))
+     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-C") "~list" iso-8859-1)
+    ("hebrew"
+     "[[:alpha:]]" "[^[:alpha:]]" "" nil ("-B") nil cp1255))
   "Base value for `ispell-dictionary-alist'.")
 
 (defvar ispell-dictionary-alist nil
-- 
2.7.4


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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-21  0:20             ` Reuben Thomas
@ 2016-12-21 17:15               ` Eli Zaretskii
  2016-12-21 17:31                 ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2016-12-21 17:15 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25230

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Wed, 21 Dec 2016 00:20:27 +0000
> Cc: 25230@debbugs.gnu.org
> 
> Here's an updated patch, which simply removes the overriding of the built-in
> CASECHARS/NOT-CASECHARS settings for ispell dictionaries. It assumes that all other dictionaries (either
> configured by the user or found by the various auto-scanning functions) will have sensible
> CASECHARS/NOT-CASECHARS values, which is expected to be the case at present.

Looks like you sent the wrong patch, as this:

> diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
> index 23ee412..82e5c2b 100644
> --- a/lisp/textmodes/ispell.el
> +++ b/lisp/textmodes/ispell.el
> @@ -436,114 +436,70 @@ ispell-dictionary-base-alist
>       ;; The default dictionary.  It may be English.aff, or any other
>       ;; dictionary depending on locale and such things.  We should probably
>       ;; ask ispell what dictionary it's using, but until we do that, let's
> -     ;; just use a minimal regexp. [:alpha:] will later be set if possible.
> -     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
> +     ;; just use a minimal regexp.
> +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
>      ("american"				; Yankee English
> -     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
> +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
>      ("brasileiro"			; Brazilian mode
> -     "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
> -     "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\334\302\312\324a-z\341\351\355\363\372\340\350\354\362\371\343\365\347\374\342\352\364]"
> -     "[']" nil nil nil iso-8859-1)
> +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil iso-8859-1)

leaves the overriding in place.  Am I missing something?





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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-21 17:15               ` Eli Zaretskii
@ 2016-12-21 17:31                 ` Reuben Thomas
  2016-12-21 18:03                   ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-21 17:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25230


[-- Attachment #1.1: Type: text/plain, Size: 2384 bytes --]

On 21 December 2016 at 17:15, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Wed, 21 Dec 2016 00:20:27 +0000
> > Cc: 25230@debbugs.gnu.org
> >
> > Here's an updated patch, which simply removes the overriding of the
> built-in
> > CASECHARS/NOT-CASECHARS settings for ispell dictionaries. It assumes
> that all other dictionaries (either
> > configured by the user or found by the various auto-scanning functions)
> will have sensible
> > CASECHARS/NOT-CASECHARS values, which is expected to be the case at
> present.
>
> Looks like you sent the wrong patch, as this:
>
> > diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
> > index 23ee412..82e5c2b 100644
> > --- a/lisp/textmodes/ispell.el
> > +++ b/lisp/textmodes/ispell.el
> > @@ -436,114 +436,70 @@ ispell-dictionary-base-alist
> >       ;; The default dictionary.  It may be English.aff, or any other
> >       ;; dictionary depending on locale and such things.  We should
> probably
> >       ;; ask ispell what dictionary it's using, but until we do that,
> let's
> > -     ;; just use a minimal regexp. [:alpha:] will later be set if
> possible.
> > -     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
> > +     ;; just use a minimal regexp.
> > +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
> >      ("american"                              ; Yankee English
> > -     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
> > +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil iso-8859-1)
> >      ("brasileiro"                    ; Brazilian mode
> > -     "[A-Z\301\311\315\323\332\300\310\314\322\331\303\325\307\
> 334\302\312\324a-z\341\351\355\363\372\340\350\354\362\
> 371\343\365\347\374\342\352\364]"
> > -     "[^A-Z\301\311\315\323\332\300\310\314\322\331\303\325\
> 307\334\302\312\324a-z\341\351\355\363\372\340\350\354\
> 362\371\343\365\347\374\342\352\364]"
> > -     "[']" nil nil nil iso-8859-1)
> > +     "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil iso-8859-1)
>
> leaves the overriding in place.  Am I missing something?
>

​I'm baffled, I somehow inverted the sense of what I meant to do,
discarding the correct bit of the patch and keeping the incorrect bit.
Sorry about that. I attach what should now be the correct patch.

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 3631 bytes --]

[-- Attachment #2: 0001-Keep-default-CASECHARS-NOT-CASECHARS-for-ispell-buil.patch --]
[-- Type: text/x-patch, Size: 1332 bytes --]

From bdc58ec43c7ca6fcb232ba00ac936fc62ccff58d Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Wed, 21 Dec 2016 17:30:44 +0000
Subject: [PATCH 1/6] Keep default CASECHARS/NOT-CASECHARS for ispell built-in
 dictionaries

* lisp/textmodes/ispell.el (ispell-set-spellchecker-params): Do not
override CASECHARS and NOT-CASECHARS.  The ispell dictionaries
retain their hardwired values, and all other dictionaries are given
sensible defaults.
---
 lisp/textmodes/ispell.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 23ee412..7551d2f 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1290,8 +1290,8 @@ ispell-set-spellchecker-params
         (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
                         (list
                          (nth 0 adict)   ; dict name
-                         "[[:alpha:]]"   ; casechars
-                         "[^[:alpha:]]"  ; not-casechars
+                         (nth 1 adict)   ; casechars
+                         (nth 2 adict)   ; not-casechars
                          (nth 3 adict)   ; otherchars
                          (nth 4 adict)   ; many-otherchars-p
                          (nth 5 adict)   ; ispell-args
-- 
2.7.4


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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-21 17:31                 ` Reuben Thomas
@ 2016-12-21 18:03                   ` Eli Zaretskii
  2016-12-21 22:33                     ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2016-12-21 18:03 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25230

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Wed, 21 Dec 2016 17:31:46 +0000
> Cc: 25230@debbugs.gnu.org
> 
> ​I'm baffled, I somehow inverted the sense of what I meant to do, discarding the correct bit of the patch and
> keeping the incorrect bit.

Mysteries of Git...

> Sorry about that. I attach what should now be the correct patch.

That looks good, thanks.





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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-21 18:03                   ` Eli Zaretskii
@ 2016-12-21 22:33                     ` Reuben Thomas
  2019-06-24 23:08                       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2016-12-21 22:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25230

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

On 21 December 2016 at 18:03, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Wed, 21 Dec 2016 17:31:46 +0000
> > Cc: 25230@debbugs.gnu.org
> >
> > ​I'm baffled, I somehow inverted the sense of what I meant to do,
> discarding the correct bit of the patch and
> > keeping the incorrect bit.
>
> Mysteries of Git...
>

​Mysteries of magit in this case, which seems appropriate!​


> > Sorry about that. I attach what should now be the correct patch.
>
> That looks good, thanks.
>

​Good, I've installed it. Thanks for the review.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1534 bytes --]

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

* bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries
  2016-12-21 22:33                     ` Reuben Thomas
@ 2019-06-24 23:08                       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-24 23:08 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25230

Reuben Thomas <rrt@sc3d.org> writes:

>  That looks good, thanks.
>
> ​Good, I've installed it. Thanks for the review.

As far as I can tell, the issue in this bug report was resolved, but the
report wasn't closed, so I'm doing that now.  If that's a mistake,
please reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-06-24 23:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-19 12:28 bug#25230: Patch to ispell.el to simplify use of [:alpha:] for CASECHARS in built-in dictionaries Reuben Thomas
2016-12-19 16:23 ` Eli Zaretskii
2016-12-19 21:17   ` Reuben Thomas
2016-12-20 15:37     ` Eli Zaretskii
2016-12-20 18:42       ` Reuben Thomas
2016-12-20 19:37         ` Eli Zaretskii
2016-12-20 21:45           ` Reuben Thomas
2016-12-21  0:20             ` Reuben Thomas
2016-12-21 17:15               ` Eli Zaretskii
2016-12-21 17:31                 ` Reuben Thomas
2016-12-21 18:03                   ` Eli Zaretskii
2016-12-21 22:33                     ` Reuben Thomas
2019-06-24 23:08                       ` Lars Ingebrigtsen

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