GNU bug report logs - #24439
ispell.el; cutom setting `ispell-library-directory'; patch

Previous Next

Package: emacs;

Reported by: Laimonas Vėbra <laimonas.vebra <at> yahoo.com>

Date: Wed, 14 Sep 2016 20:04:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Laimonas Vėbra <laimonas.vebra <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24439 <at> debbugs.gnu.org
Subject: bug#24439: ispell.el; cutom setting `ispell-library-directory'; patch
Date: Sat, 24 Sep 2016 20:47:15 +0300
[Message part 1 (text/plain, inline)]
Eli Zaretskii wrote:

>> Sorry, that is not true (mistakenly thought, that fopen won't work with
>> windows paths). Then i should really rebuild ispell with LIBDIR set to
>> native path and it will work with Emacs.
>
> I think you don't even need that.  You need to set ISPELL_DICTDIR in
> the environment to point to that directory.
>
> (The reason I didn't suggest this earlier is that I didn't know Cygwin
> can fopen Windows-style absolute file names.)

Actually that won't work with current ispell.el, because LIBRARYVAR is 
completely ignored and dictionaries searched only in LIBDIR (though it 
can be overridden by LIBRARYVAR).

Fixed this and other (-d with an absolute path) issues in attached patch.

Below is a explanatory test:

(require 'ispell)
ispell

;; cygwin ispell reports its LIBDIR as
(ispell-check-version)
"/usr/local/lib"

;; and it's not a correct/existing windows path
(file-exists-p "/usr/local/lib")
nil

(shell-command-to-string "cygpath -w /usr/local/lib")
"C:\\cygwin64\\usr\\local\\lib
"

;; so ispell.el still can not see valid/installed dictionaries
(shell-command-to-string "ls -l /usr/local/lib")
"total 1126
lrwxrwxrwx 1 Admin None      16 Jul 29 01:38 american.hash -> 
americanmed.hash
-rw-r--r-- 1 Admin None 1125408 Jul 29 01:38 americanmed.hash
-rw-r--r-- 1 Admin None   24095 Jul 29 01:38 english.aff
lrwxrwxrwx 1 Admin None      16 Jul 29 01:38 english.hash -> 
americanmed.hash
"
(ispell-valid-dictionary-list)
("default")


;; Though now we can add dictionaries explicitly (-d with an absolute path)
ispell-local-dictionary-alist
nil

(add-to-list 'ispell-local-dictionary-alist
	     '("american" "[A-Za-z]" "[^A-Za-z]" "[']" nil
	       ("-d" "c:/cygwin64/usr/local/lib/american.hash") nil iso-8859-1))
(("american" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-d" 
"c:/cygwin64/usr/local/lib/american.hash") nil iso-8859-1))


(add-to-list 'ispell-local-dictionary-alist
	     '("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil
	       ("-d" "c:/cygwin64/usr/local/lib/english.hash") nil iso-8859-1))
(("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-d" 
"c:/cygwin64/usr/local/lib/english.hash") nil iso-8859-1) ("american" 
"[A-Za-z]" "[^A-Za-z]" "[']" nil ("-d" 
"c:/cygwin64/usr/local/lib/american.hash") nil iso-8859-1))

(ispell-valid-dictionary-list)
("american" "english" "default")

;; or we can set ispell LIBRARYVAR (default: ISPELL_DICTDIR) environment 
variable
(setq ispell-local-dictionary-alist nil)
nil
(ispell-valid-dictionary-list)
("default")

(setenv "ISPELL_DICTDIR" "c:/cygwin64/usr/local/lib")
"c:/cygwin64/usr/local/lib"

(setq ispell-library-directory (ispell-check-version))
"c:/cygwin64/usr/local/lib"

(ispell-valid-dictionary-list)
("english" "american" "default")

[ispell.patch (text/plain, attachment)]

This bug report was last modified 8 years and 228 days ago.

Previous Next


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