GNU bug report logs - #31341
26.1; setting ispell-base-dicts-override-alist no longer working

Previous Next

Package: emacs;

Reported by: Anders Johansson <mejlaandersj <at> gmail.com>

Date: Wed, 2 May 2018 15:06:02 UTC

Severity: normal

Found in version 26.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31341 in the body.
You can then email your comments to 31341 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31341; Package emacs. (Wed, 02 May 2018 15:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Anders Johansson <mejlaandersj <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 May 2018 15:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Anders Johansson <mejlaandersj <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; setting ispell-base-dicts-override-alist no longer working
Date: Wed, 02 May 2018 17:05:10 +0200
After updating to the 26.1 release candidate the custom 
dictionaries I have added via ispell-base-dicts-override-alist are 
no longer added.


I believe that this bug is due to ispell.el being compiled with 
lexical-binding since 26.1, which means that the value of 
ispell-base-dicts-override-alist set via 
ispell-initialize-spellchecker-hook will no longer be in scope in 
the body of ispell-set-spellchecker-params.
(This is the recommended usage in the docstring of 
ispell-initialize-spellchecker-hook).

I guess some other mechanism would have to be devised when using 
lexical-binding.



In GNU Emacs 26.1 (build 3, x86_64-pc-linux-gnu, GTK+ Version 
3.22.30)
of 2018-04-29 built on ajjb
Windowing system distributor 'The X.Org Foundation', version 
11.0.11906000
Recent messages:

Configured using:
'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib 
--localstatedir=/var --with-x-toolkit=gtk3 --with-xft 
--with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe 
-fstack-protector-strong -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS 
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB 
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS LIBSYSTEMD LCMS2
Important settings:
 value of $LC_MONETARY: sv_SE.UTF-8
 value of $LC_NUMERIC: sv_SE.UTF-8
 value of $LC_TIME: sv_SE.UTF-8
 value of $LANG: sv_SE.UTF-8
 value of $XMODIFIERS: @im=ibus
 locale-coding-system: utf-8-unix





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31341; Package emacs. (Wed, 02 May 2018 15:26:01 GMT) Full text and rfc822 format available.

Message #8 received at 31341 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Anders Johansson <mejlaandersj <at> gmail.com>
Cc: 31341 <at> debbugs.gnu.org
Subject: Re: bug#31341: 26.1;
 setting ispell-base-dicts-override-alist no longer working
Date: Wed, 02 May 2018 18:25:23 +0300
> From: Anders Johansson <mejlaandersj <at> gmail.com>
> Date: Wed, 02 May 2018 17:05:10 +0200
> 
> After updating to the 26.1 release candidate the custom 
> dictionaries I have added via ispell-base-dicts-override-alist are 
> no longer added.
> 
> 
> I believe that this bug is due to ispell.el being compiled with 
> lexical-binding since 26.1, which means that the value of 
> ispell-base-dicts-override-alist set via 
> ispell-initialize-spellchecker-hook will no longer be in scope in 
> the body of ispell-set-spellchecker-params.
> (This is the recommended usage in the docstring of 
> ispell-initialize-spellchecker-hook).
> 
> I guess some other mechanism would have to be devised when using 
> lexical-binding.

Does recompiling ispell.el without lexical-binding solve this problem?

Also, can you please prepare a short recipe that can be used to
reproduce the problem with ispell.elc as provided in the tarball?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31341; Package emacs. (Wed, 02 May 2018 16:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 31341 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31341 <at> debbugs.gnu.org, Anders Johansson <mejlaandersj <at> gmail.com>
Subject: Re: bug#31341: 26.1;
 setting ispell-base-dicts-override-alist no longer working
Date: Wed, 02 May 2018 12:39:17 -0400
Eli Zaretskii wrote:

> Does recompiling ispell.el without lexical-binding solve this problem?

I think using

(defvar ispell-base-dicts-override-alist nil)

(to mark the var as dynamic) would be better.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31341; Package emacs. (Wed, 02 May 2018 16:48:01 GMT) Full text and rfc822 format available.

Message #14 received at 31341 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31341 <at> debbugs.gnu.org, Anders Johansson <mejlaandersj <at> gmail.com>
Subject: Re: bug#31341: 26.1;
 setting ispell-base-dicts-override-alist no longer working
Date: Wed, 02 May 2018 12:46:58 -0400
Glenn Morris wrote:

> Eli Zaretskii wrote:
>
>> Does recompiling ispell.el without lexical-binding solve this problem?
>
> I think using
>
> (defvar ispell-base-dicts-override-alist nil)
>
> (to mark the var as dynamic) would be better.

Or rather just

(defvar ispell-base-dicts-override-alist)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31341; Package emacs. (Wed, 02 May 2018 17:20:02 GMT) Full text and rfc822 format available.

Message #17 received at 31341 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 31341 <at> debbugs.gnu.org, mejlaandersj <at> gmail.com
Subject: Re: bug#31341: 26.1;
 setting ispell-base-dicts-override-alist no longer working
Date: Wed, 02 May 2018 20:19:01 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Anders Johansson <mejlaandersj <at> gmail.com>,  31341 <at> debbugs.gnu.org
> Date: Wed, 02 May 2018 12:39:17 -0400
> 
> Eli Zaretskii wrote:
> 
> > Does recompiling ispell.el without lexical-binding solve this problem?
> 
> I think using
> 
> (defvar ispell-base-dicts-override-alist nil)
> 
> (to mark the var as dynamic) would be better.

Sure, provided that lexical-binding is indeed the problem.  I just
wanted to be sure that's the only issue.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31341; Package emacs. (Wed, 02 May 2018 19:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 31341 <at> debbugs.gnu.org (full text, mbox):

From: Anders Johansson <mejlaandersj <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 31341 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#31341: 26.1;
 setting ispell-base-dicts-override-alist no longer working
Date: Wed, 02 May 2018 21:20:02 +0200
A recipe for testing. Putting the following code in a file 
ispell-test.el and running ‘emacs -Q l ispell-test.el‘ gives a 
positive result for ispell.el byte-compiled without 
lexical-binding and negative result with lexical binding.
It also works to just add (defvar 
ispell-base-dicts-override-alist) in ispell.el.

--------------------
(load-library "ispell")

(add-hook 'ispell-initialize-spellchecker-hook 
#'ispell-extra-dicts-test)

(defun ispell-extra-dicts-test ()
 (setq ispell-base-dicts-override-alist
       '(("en_GB,sv_SE"
          "[[:alpha:]]" "[^[:alpha:]]"
          "[’'´.0-b:-]" t ("-d" "en_GB,sv_SE")
          nil utf-8))))

(ispell-set-spellchecker-params)

(if (assoc "en_GB,sv_SE" ispell-dictionary-alist)
   (message "It worked!")
 (message "it didn’t work"))

--------------------


On Wednesday  2 May 2018 at 18:46, Glenn Morris <rgm <at> gnu.org> 
wrote:

> Glenn Morris wrote:
>
>> Eli Zaretskii wrote:
>>
>>> Does recompiling ispell.el without lexical-binding solve this 
>>> problem?
>>
>> I think using
>>
>> (defvar ispell-base-dicts-override-alist nil)
>>
>> (to mark the var as dynamic) would be better.
>
> Or rather just
>
> (defvar ispell-base-dicts-override-alist)


-- 
Anders Johansson




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 04 May 2018 14:28:02 GMT) Full text and rfc822 format available.

Notification sent to Anders Johansson <mejlaandersj <at> gmail.com>:
bug acknowledged by developer. (Fri, 04 May 2018 14:28:02 GMT) Full text and rfc822 format available.

Message #25 received at 31341-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Anders Johansson <mejlaandersj <at> gmail.com>
Cc: rgm <at> gnu.org, 31341-done <at> debbugs.gnu.org
Subject: Re: bug#31341: 26.1;
 setting ispell-base-dicts-override-alist no longer working
Date: Fri, 04 May 2018 17:27:19 +0300
> From: Anders Johansson <mejlaandersj <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 31341 <at> debbugs.gnu.org
> Date: Wed, 02 May 2018 21:20:02 +0200
> 
> 
> A recipe for testing. Putting the following code in a file 
> ispell-test.el and running ‘emacs -Q l ispell-test.el‘ gives a 
> positive result for ispell.el byte-compiled without 
> lexical-binding and negative result with lexical binding.
> It also works to just add (defvar 
> ispell-base-dicts-override-alist) in ispell.el.

Thanks, I installed a fix in the emacs-26 branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Jun 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 16 days ago.

Previous Next


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