unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Laimonas Vėbra" <laimonas.vebra@yahoo.com>,
	"Agustin Martin" <agustin6martin@gmail.com>
Cc: 24439@debbugs.gnu.org
Subject: bug#24439: ispell.el; cutom setting `ispell-library-directory'; patch
Date: Fri, 07 Oct 2016 11:58:00 +0300	[thread overview]
Message-ID: <83wphkilif.fsf@gnu.org> (raw)
In-Reply-To: <57F62864.4010609@yahoo.com> (message from Laimonas Vėbra on Thu, 6 Oct 2016 13:33:08 +0300)

Agustin, could you please take a look at the proposed patch?  TIA.

> From: Laimonas Vėbra <laimonas.vebra@yahoo.com>
> Cc: 24439@debbugs.gnu.org
> Date: Thu, 6 Oct 2016 13:33:08 +0300
> 
> 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")





  reply	other threads:[~2016-10-07  8:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 20:02 bug#24439: ispell.el; cutom setting `ispell-library-directory'; patch Laimonas Vėbra
2016-09-15 15:07 ` Eli Zaretskii
2016-09-15 15:56   ` Laimonas Vėbra
2016-09-15 16:34     ` Eli Zaretskii
2016-09-15 16:51       ` Laimonas Vėbra
2016-09-15 17:20         ` Eli Zaretskii
2016-09-15 17:53           ` Laimonas Vėbra
2016-09-15 18:48             ` Eli Zaretskii
2016-09-15 20:10               ` Laimonas Vėbra
2016-09-15 20:57                 ` Ken Brown
2016-09-15 21:20                   ` Laimonas Vėbra
2016-09-15 22:17                     ` Ken Brown
2016-09-15 23:00                       ` Laimonas Vėbra
2016-09-16  6:46                       ` Eli Zaretskii
2016-09-16  6:25                 ` Eli Zaretskii
2016-09-16  1:35 ` Laimonas Vėbra
2016-09-16  6:44   ` Eli Zaretskii
2016-09-24 17:47     ` Laimonas Vėbra
2016-10-06 10:33     ` Laimonas Vėbra
2016-10-07  8:58       ` Eli Zaretskii [this message]
2016-10-08 11:30         ` Agustin Martin
2016-10-08 12:18           ` Eli Zaretskii

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=83wphkilif.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24439@debbugs.gnu.org \
    --cc=agustin6martin@gmail.com \
    --cc=laimonas.vebra@yahoo.com \
    /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).