unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* 24.2.1: ispell: use of local ispell-personal-dictionary
@ 2012-11-22 16:34 Akim Demaille
  0 siblings, 0 replies; 5+ messages in thread
From: Akim Demaille @ 2012-11-22 16:34 UTC (permalink / raw)
  To: GNU Emacs Help

Hi!

I have recently upgraded my Emacs; I was using an old version (22 or maybe 21, I don't remember).  I am now running 24.2.1, and there is a feature I seem to have lost: I could use ispell-personal-dictionary to specify a per-document *local* dictionary.

Consider the following use case: several documents (LaTeX for that matter), with many uncommon words in common.  Instead of having a bazillion of (duplicated) "LocalWords:" in all my documents, I have:

%%% Local Variables:
%%% mode: latex
%%% coding: utf-8
%%% ispell-dictionary: "american"
%%% ispell-personal-dictionary: "../en.dict"
%%% TeX-master: t
%%% fill-column: 76
%%% End:

in each file.

This used to work well, i.e., aspell was given the right path to en.dict.  With the current version of Emacs, "../en.dict" seems to be resolved relatively to the directory from which Emacs was run, instead of relatively to the document.

I do not want to force a full path to the dictionary, because the documents are under VCS, and the dictionary is shared between the authors.

What's my best option?

Thanks in advance.

	Akim

PS/ Please, keep me in cc.




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

* Re: 24.2.1: ispell: use of local ispell-personal-dictionary
       [not found] <mailman.13567.1353604167.855.help-gnu-emacs@gnu.org>
@ 2012-11-24  2:57 ` Michael Heerdegen
  2012-11-27 14:59   ` Akim Demaille
       [not found]   ` <mailman.13923.1354028403.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Heerdegen @ 2012-11-24  2:57 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Akim Demaille

Hi Akim,

your file local variable `ispell-personal-dictionary' is bound to the
string "../en.dict" when you open your file.  Note that no expansion of
the ".." takes place.  Whether this string later is interpreted as
intended or not is just luck...

It is better to bind the variable to an expanded filename.  This can be
done using `eval':

%%% eval: (set (make-local-variable 'ispell-personal-dictionary) (expand-file-name "../en.dict"))


BTW, also consider using a directory local variable for this.


Regards,

Michael.



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

* Re: 24.2.1: ispell: use of local ispell-personal-dictionary
  2012-11-24  2:57 ` 24.2.1: ispell: use of local ispell-personal-dictionary Michael Heerdegen
@ 2012-11-27 14:59   ` Akim Demaille
       [not found]   ` <mailman.13923.1354028403.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Akim Demaille @ 2012-11-27 14:59 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs


Le 24 nov. 2012 à 03:57, Michael Heerdegen <michael_heerdegen@web.de> a écrit :

> Hi Akim,

Hi Michael, thanks for the answer!

> your file local variable `ispell-personal-dictionary' is bound to the
> string "../en.dict" when you open your file.  Note that no expansion of
> the ".." takes place.  Whether this string later is interpreted as
> intended or not is just luck…

But it used to work.  This looks very much like a regression to me.

I have run the following experiment, on a file with these local variables:

%%% Local Variables:
%%% mode: latex
%%% coding: utf-8
%%% ispell-dictionary: "american"
%%% ispell-personal-dictionary: "en.dict"
%%% TeX-master: t
%%% fill-column: 76
%%% End:

Of course, what is expected is that en.dict is a local file, "in ./"
relatively to the file with these local variables.

With Emacs 22, I have the expected behavior:

$ /usr/bin/emacs --version
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

$ /usr/bin/emacs f.tex
              -- (here, I "M-x ispell", and "C-z" Emacs)

zsh: suspended  /usr/bin/emacs f.tex
$ ps aux | grep aspell
[…] /opt/local/bin/aspell -a -m -d en_US --encoding=utf-8 -p /Users/akimd/src/lrde/cours-mob/mob1/src/lecture_2/en.dict

As you can see, the location of the en.dict is correct (well, you
cannot see because I have not shown where f.tex was, and it is
there, /Users/akimd/src/lrde/cours-mob/mob1/src/lecture_2).

Now with Emacs 24:

$ emacs --version
GNU Emacs 24.2.1
Copyright (C) 2012 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

$ emacs mob1/src/lecture_2/f.tex

zsh: suspended  emacs mob1/src/lecture_2/f.tex
$ ps aux | grep aspell
[…] /opt/local/bin/aspell -a -m -d en_US -p /Users/akimd/en.dict --encoding=utf-8

this time its completely wrong.


The previous behavior was much more useless, as it made it possible
for a repository of documents to share a dictionary, something much
more useful than Local Words.

Yes, there is the "eval" option, but that's working around a bug imho,
with the nasty effect that each time the document is opened, you have
to validate the action.

If "personal" was really meant to be the user's personal data, then
it was easy to use "~/" to make it clear.  Today, the way the dictionary
name is turned absolutely forbids the previous useful approach.

Or have I missed something?

Thanks!




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

* Re: 24.2.1: ispell: use of local ispell-personal-dictionary
       [not found]   ` <mailman.13923.1354028403.855.help-gnu-emacs@gnu.org>
@ 2012-11-28  6:02     ` Michael Heerdegen
  2012-11-28  8:47       ` Akim Demaille
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2012-11-28  6:02 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Akim Demaille

Akim Demaille <akim.demaille@gmail.com> writes:

> > your file local variable `ispell-personal-dictionary' is bound to the
> > string "../en.dict" when you open your file.  Note that no expansion of
> > the ".." takes place.  Whether this string later is interpreted as
> > intended or not is just luck…
>
> But it used to work.  This looks very much like a regression to me.

I didn't mean that the behavior was not useful.  But it was never
documented, so it was just luck that it worked.  Note that something
like "../en.dict" is not a filename.  It can be expanded to a filename.
For many other variables Emacs assumes that they are bound to (expanded)
filenames, and relative names are not allowed.

Why don't you file a feature request (M-x report-emacs-bug)?  Just
explain what you wrote here.


Regards,

Michael.



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

* Re: 24.2.1: ispell: use of local ispell-personal-dictionary
  2012-11-28  6:02     ` Michael Heerdegen
@ 2012-11-28  8:47       ` Akim Demaille
  0 siblings, 0 replies; 5+ messages in thread
From: Akim Demaille @ 2012-11-28  8:47 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs


Le 28 nov. 2012 à 07:02, Michael Heerdegen <michael_heerdegen@web.de> a écrit :

> Akim Demaille <akim.demaille@gmail.com> writes:
> 
>>> your file local variable `ispell-personal-dictionary' is bound to the
>>> string "../en.dict" when you open your file.  Note that no expansion of
>>> the ".." takes place.  Whether this string later is interpreted as
>>> intended or not is just luck…
>> 
>> But it used to work.  This looks very much like a regression to me.
> 
> I didn't mean that the behavior was not useful.  But it was never
> documented, so it was just luck that it worked.  Note that something
> like "../en.dict" is not a filename.

I simplified my example, but relative file names were fine before.

> Why don't you file a feature request (M-x report-emacs-bug)?  Just
> explain what you wrote here.

Will do, thanks!
\x04


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

end of thread, other threads:[~2012-11-28  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.13567.1353604167.855.help-gnu-emacs@gnu.org>
2012-11-24  2:57 ` 24.2.1: ispell: use of local ispell-personal-dictionary Michael Heerdegen
2012-11-27 14:59   ` Akim Demaille
     [not found]   ` <mailman.13923.1354028403.855.help-gnu-emacs@gnu.org>
2012-11-28  6:02     ` Michael Heerdegen
2012-11-28  8:47       ` Akim Demaille
2012-11-22 16:34 Akim Demaille

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