Serious bug with Aquamacs' spellchecking interface in Sierra

71 views
Skip to first unread message

Konrad Podczeck

unread,
Sep 24, 2016, 7:52:08 AM9/24/16
to aquamac...@googlegroups.com, Reitter David
CocoAspell is not compatible with Sierra. So I trashed it, reorganised the aspell dictionaries, and adjusted aspell.conf accordingly. If, in Terminal.app, I issue aspell dump dicts, I get:

de
de_AT
de_CH
de_DE
en
en
en-variant_0
en-variant_1
en-variant_2
en-w_accents
en-wo_accents
en_CA
en_CA-variant_0
en_CA-variant_1
en_CA-w_accents
en_CA-wo_accents
en_GB
en_GB-ise
en_GB-ise-w_accents
en_GB-ise-wo_accents
en_GB-ize
en_GB-ize-w_accents
en_GB-ize-wo_accents
en_GB-variant_0
en_GB-variant_1
en_GB-w_accents
en_GB-wo_accents
en_US
en_US-variant_0
en_US-variant_1
en_US-w_accents
en_US-wo_accents

and, in fact, in Terminal-app aspell works fine and I can choose any one of the above listed dictionaries. In the ispell-customization group of Aquamacs, I have set ispell-program-name to "/usr/local/bin/aspell," and ispell-use-cocoaspell to "generic install.“ Spell checking with the english dictionaries works fine, but when I do ispell-change-dictionary, I get the following list:

Possible completions are:
american british
default en
en-variant_0 en-variant_1
en-variant_2 en-w_accents
en-wo_accents en_CA
en_CA-variant_0 en_CA-variant_1
en_CA-w_accents en_CA-wo_accents
en_GB en_GB-ise
en_GB-ise-w_accents en_GB-ise-wo_accents
en_GB-ize en_GB-ize-w_accents
en_GB-ize-wo_accents en_GB-variant_0
en_GB-variant_1 en_GB-w_accents
en_GB-wo_accents en_US
en_US-variant_0 en_US-variant_1
en_US-w_accents en_US-wo_accents
english

So all the de-dictionaries are missing, and when I type de_DE, I get the message "no match.“ That is, I cannot do german spell checking.


David Reitter

unread,
Sep 24, 2016, 8:16:04 AM9/24/16
to Konrad Podczeck, aquamac...@googlegroups.com
Konrad,
I’m unfamiliar with the CocoAspell support we have. There is generally a lot of code for aspell, and ispell-language-abbrev-alist may be relevant.

In any case, Aquamacs supports spelling with the system spell checker out of the box, which works well for me in various languages. CocoAspell should facilitate this again when it is fixed for macOS Sierra.


--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and support the Aquamacs Project!

Konrad Podczeck

unread,
Sep 24, 2016, 2:43:12 PM9/24/16
to aquamac...@googlegroups.com, Reitter David

> Am 24.09.2016 um 14:16 schrieb David Reitter <david....@gmail.com>:
>
> Konrad,
> I’m unfamiliar with the CocoAspell support we have. There is generally a lot of code for aspell, and ispell-language-abbrev-alist may be relevant.
>
> In any case, Aquamacs supports spelling with the system spell checker out of the box, which works well for me in various languages.


Sure, I know. However, for Aquamacs as LaTeX-editor, cocoaspell worked much better concerning skipping latex-code. Apparently, without cocoaspell, NS-spellchecking just deal with latex-code according to ispell.el’s code:

(defvar ispell-skip-region-alist
`((ispell-words-keyword forward-line)
(ispell-dictionary-keyword forward-line)
(ispell-pdict-keyword forward-line)
(ispell-parsing-keyword forward-line)
(,(purecopy "^---*BEGIN PGP [A-Z ]*--*")
. ,(purecopy "^---*END PGP [A-Z ]*--*"))
;; assume multiline uuencoded file? "\nM.*$"?
(,(purecopy "^begin [0-9][0-9][0-9] [^ \t]+$") . ,(purecopy "\nend\n"))
(,(purecopy "^%!PS-Adobe-[123].0") . ,(purecopy "\n%%EOF\n"))
(,(purecopy "^---* \\(Start of \\)?[Ff]orwarded [Mm]essage")
. ,(purecopy "^---* End of [Ff]orwarded [Mm]essage"))
;; Matches e-mail addresses, file names, http addresses, etc. The
;; `-+' `_+' patterns are necessary for performance reasons when
;; `-' or `_' part of word syntax.
; (,(purecopy "\\(--+\\|_+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)"))
;; above checks /.\w sequences
;;("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
;; This is a pretty complex regexp. It can be simplified to the following:
;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
;; but some valid text will be skipped, e.g. "his/her". This could be
;; fixed up (at the expense of a moderately more complex regexp)
;; by not allowing "/" to be the character which triggers the
;; identification of the computer name, e.g.:
;; "\\(\\w\\|[-_]\\)+[.:@]\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
)
"Alist expressing beginning and end of regions not to spell check.
The alist key must be a regular expression.
Valid forms include:
(KEY) - just skip the key.
(KEY . REGEXP) - skip to the end of REGEXP. REGEXP may be string or symbol.
(KEY REGEXP) - skip to end of REGEXP. REGEXP must be a string.
(KEY FUNCTION ARGS) - FUNCTION called with ARGS returns end of region.")
(put 'ispell-skip-region-alist 'risky-local-variable t)


and

(defvar ispell-tex-skip-alists
(purecopy
'((;;("%\\[" . "%\\]") ; AMStex block comment...
;; All the standard LaTeX keywords from L. Lamport's guide:
;; \cite, \hspace, \hspace*, \hyphenation, \include, \includeonly, \input,
;; \label, \nocite, \rule (in ispell - rest included here)
("\\\\addcontentsline" ispell-tex-arg-end 2)
("\\\\add\\(tocontents\\|vspace\\)" ispell-tex-arg-end)
("\\\\\\([aA]lph\\|arabic\\)" ispell-tex-arg-end)
;;("\\\\author" ispell-tex-arg-end)
("\\\\bibliographystyle" ispell-tex-arg-end)
("\\\\makebox" ispell-tex-arg-end 0)
("\\\\e?psfig" ispell-tex-arg-end)
("\\\\document\\(class\\|style\\)" .
"\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}"))
(;; delimited with \begin. In ispell: displaymath, eqnarray, eqnarray*,
;; equation, minipage, picture, tabular, tabular* (ispell)
("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0)
("list" ispell-tex-arg-end 2)
("program" . "\\\\end[ \t\n]*{[ \t\n]*program[ \t\n]*}")
("verbatim\\*?" . "\\\\end[ \t\n]*{[ \t\n]*verbatim\\*?[ \t\n]*}"))))
"Lists of regions to be skipped in TeX mode.
First list is used raw.
Second list has key placed inside \\begin{}.

Delete or add any regions you want to be automatically selected
for skipping in latex mode.")
(put 'ispell-tex-skip-alist 'risky-local-variable t)

while with aspell on can use in addition via aspell-conf, e.g.,

mode tex
add-f-tex-command citet Op
add-f-tex-command possessivecite Op
add-f-tex-command citep OOp
add-f-tex-command citealp Oop
add-f-tex-command citeauthor p
add-f-tex-command citeyear p
add-f-tex-command eqref p
add-f-tex-command DeclareMathOperator pp
add-f-tex-command bibliographystyle p
add-f-tex-command @ifundefined pp
add-f-tex-command addtocounter pp
add-f-tex-command addtolength pp
add-f-tex-command alpha p
add-f-tex-command arabic p
add-f-tex-command fnsymbol p
add-f-tex-command roman p
add-f-tex-command stepcounter p
add-f-tex-command setcounter pp
add-f-tex-command usecounter p
add-f-tex-command value p
add-f-tex-command newcounter po
add-f-tex-command refstepcounter p
add-f-tex-command label p
add-f-tex-command pageref p
add-f-tex-command ref p
add-f-tex-command newcommand ppop
add-f-tex-command renewcommand ppop
add-f-tex-command newenvironment poopp
add-f-tex-command renewenvironment poOPP
add-f-tex-command newtheorem popo
add-f-tex-command newfont pp
add-f-tex-command documentclass op
add-f-tex-command usepackage op
add-f-tex-command begin po
add-f-tex-command end p
add-f-tex-command setlength pp
add-f-tex-command settowidth pp
add-f-tex-command settodepth pp
add-f-tex-command settoheight pp
add-f-tex-command enlargethispage p
add-f-tex-command hyphenation p
add-f-tex-command pagenumbering p
add-f-tex-command pagestyle p
add-f-tex-command addvspace p
add-f-tex-command framebox ooP
add-f-tex-command hspace p
add-f-tex-command vspace p
add-f-tex-command makebox ooP
add-f-tex-command parbox ooopP
add-f-tex-command raisebox pooP
add-f-tex-command rule opp
add-f-tex-command sbox pO
add-f-tex-command savebox pooP
add-f-tex-command usebox p
add-f-tex-command include p
add-f-tex-command includeonly p
add-f-tex-command input p
add-f-tex-command addcontentsline ppP
add-f-tex-command addtocontents pP
add-f-tex-command fontencoding p
add-f-tex-command fontfamily p
add-f-tex-command fontseries p
add-f-tex-command fontshape p
add-f-tex-command fontsize pp
add-f-tex-command usefont pppp
add-f-tex-command documentstyle op
add-f-tex-command cite p
add-f-tex-command nocite p
add-f-tex-command psfig p
add-f-tex-command selectlanguage p
add-f-tex-command includegraphics op
add-f-tex-command bibitem op
add-f-tex-command geometry p
add-f-tex-command @ifundefined pp
add-f-tex-command unknown o

which gives much better skipping of latex-code, and is easy to implement for a user.

Konrad
> --
> You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to aquamacs-deve...@googlegroups.com.

David Reitter

unread,
Sep 24, 2016, 2:47:19 PM9/24/16
to Konrad Podczeck, aquamac...@googlegroups.com
I see. Well, I understand CocoAspell is broken on 10.12, so we’ll have to see if and when it is getting fixed.
If it turns out to be due to Aquamacs, then we can see how to fix that.
- David

Konrad Podczeck

unread,
Sep 24, 2016, 2:59:59 PM9/24/16
to Reitter David, aquamac...@googlegroups.com
It is not due to Aquamacs, and cannot just be called „broken“; it seems  not to be up to date for Sierra anymore. Just trash the cocoaspell prefpane, and the go to ~/Library/Services and look. I guess, it has to do with what is written in that link:

Konrad Podczeck

unread,
Sep 24, 2016, 6:29:26 PM9/24/16
to aquamac...@googlegroups.com, Reitter David
There must be a mistake in the code of Aquamac’s version of ispell.el: 

Apparently, it is the value of ispell-dictionary-alist which determines the menu of choice of ispell-change-dictionary. With ispell-program-name=aspell (and Ispell Use Cocoaspell=generic install) this value should be the same as with GNUEmacs 25.1, and maybe with ispell-program-name=NSSpellchecker there could be a difference. However, it is the other way round, and this makes no sense. With ispell-program-name=aspell, one just gets for this value:

((nil "[[:alpha:]]" "[^[:alpha:]]" "'" t
      ("-d" "en")
      nil utf-8)
 ("en" "[[:alpha:]]" "[^[:alpha:]]" "'" t
  ("-d" "en")
  nil utf-8))

whereas with ispell-program-name=NSSpellchecker, one gets exactly the same value as in GNUEmacs 25.1:

Value: ((nil "[[:alpha:]]" "[^[:alpha:]]" "[']" nil
      ("-B")
      nil utf-8)
 ("en" "[[:alpha:]]" "[^[:alpha:]]" "'" t
  ("-d" "en")
  nil utf-8)
 ("american" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil
  ("-B")
  nil utf-8)
 ("brasileiro" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)
 ("british" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil
  ("-B")
  nil utf-8)
 ("castellano" "[[:alpha:]]" "[^[:alpha:]]" "[-]" nil
  ("-B")
  "~tex" utf-8)
 ("castellano8" "[[:alpha:]]" "[^[:alpha:]]" "[-]" nil
  ("-B" "-d" "castellano")
  "~latin1" utf-8)
 ("czech" "[[:alpha:]]" "[^[:alpha:]]" "" nil
  ("-B")
  nil utf-8)
 ("dansk" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil
  ("-C")
  nil utf-8)
 ("deutsch" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C")
  "~tex" utf-8)
 ("deutsch8" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C" "-d" "deutsch")
  "~latin1" utf-8)
 ("english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil
  ("-B")
  nil utf-8)
 ("esperanto" "[[:alpha:]]" "[^[:alpha:]]" "[-']" t
  ("-C")
  "~latin3" utf-8)
 ("esperanto-tex" "[[:alpha:]]" "[^[:alpha:]]" "[-'`\"]" t
  ("-C" "-d" "esperanto")
  "~tex" utf-8)
 ("finnish" "[[:alpha:]]" "[^[:alpha:]]" "[:]" nil
  ("-C")
  "~list" utf-8)
 ("francais7" "[[:alpha:]]" "[^[:alpha:]]" "[`'^-]" t nil nil utf-8)
 ("francais" "[[:alpha:]]" "[^[:alpha:]]" "[-'.@]" t nil "~list" utf-8)
 ("francais-tex" "[[:alpha:]]" "[^[:alpha:]]" "[-'^`\".@]" t nil "~tex" utf-8)
 ("german" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C")
  "~tex" utf-8)
 ("german8" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C" "-d" "german")
  "~latin1" utf-8)
 ("italiano" "[[:alpha:]]" "[^[:alpha:]]" "[-.]" nil
  ("-B" "-d" "italian")
  "~tex" utf-8)
 ("nederlands" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C")
  nil utf-8)
 ("nederlands8" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C")
  nil utf-8)
 ("norsk" "[[:alpha:]]" "[^[:alpha:]]" "[\"]" nil nil "~list" utf-8)
 ("norsk7-tex" "[[:alpha:]]" "[^[:alpha:]]" "[\"]" nil
  ("-d" "norsk")
  "~plaintex" utf-8)
 ("polish" "[[:alpha:]]" "[^[:alpha:]]" "[.]" nil nil nil utf-8)
 ("portugues" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
  ("-C")
  "~latin1" utf-8)
 ("russian" "[[:alpha:]]" "[^[:alpha:]]" "" nil nil nil utf-8)
 ("russianw" "[[:alpha:]]" "[^[:alpha:]]" "" nil nil nil utf-8)
 ("slovak" "[[:alpha:]]" "[^[:alpha:]]" "" nil
  ("-B")
  nil utf-8)
 ("slovenian" "[[:alpha:]]" "[^[:alpha:]]" "" nil
  ("-B" "-d" "slovenian")
  nil utf-8)
 ("svenska" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil
  ("-C")
  "~list" utf-8)
 ("hebrew" "[[:alpha:]]" "[^[:alpha:]]" "" nil
  ("-B")
  nil utf-8))
 
What is the sense? 

Konrad Podczeck

unread,
Sep 24, 2016, 7:12:34 PM9/24/16
to aquamac...@googlegroups.com, Reitter David
Yes, my guess that there is a mistake in Aquamacs’s version of ispell.el is correct: Having given in my preferences.el:

(require 'ispell)

(setq ispell-dictionary-alist ‚X)  (Mail does not let me an apostrophe before the X, so it appears as comma here)

where X stands for the value of ispell-dictionary-alist in GNUEmacs 25.1=value of ispell-dictionary-alist in Aquamacs for ispell-program-name=NSSpellchecker, I can now change dictionary (and spellcheck) in Aquamacs with ispell-program-name=aspell.
Reply all
Reply to author
Forward
0 new messages