Do you have ispell.exe or aspell.exe installed? If not, install them
first.
If you already have them installed and they work from outside Emacs,
then set the variables debug-on-error and debug-on-signal to t and try
again. You should get a backtrace with more details about where the
error happened. If you cannot figure that out, post the backtrace
here.
No. aspell comes with a shell script called `ispell' to emulate Ispell.
> I already installed aspell and the trace I am getting is:
>
> Debugger entered--Lisp error: (file-error "Searching for program" "no such
> file or directory" "ispell")
> call-process("ispell" nil t nil "-vv")
Maybe the shell script is not compatible with Windows. Do you have an
ispell.bat or ispell.cmd batch file as well? If not, perhaps create a
batch file that does what the `ispell' shell script does, and you
should be set.
(I don't use aspell, so I cannot help you if the above doesn't resolve
the problem.)
I didnt see the whole thread, but does he have:
(setq-default ispell-program-name "aspell")
`
> Date: Sat, 1 Aug 2009 10:06:33 +1000
> From: sam jesse <rev...@gmail.com>
>
> when I try to enable it, I get
> Enabling Flyspell mode gave an error
>
> GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on SOFT-MJASON under
> Windows XP.
>
> how do I go about fixing this?
make sure ispell is in your windows path.
e.g. here's what i have in my init file:
(when (string-equal system-type "windows-nt")
(progn
(setenv "PATH" "/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/
cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/
System32/Wbem")
(setq exec-path
'(
"C:/Program Files (x86)/Emacs/emacs/bin/"
"C:/Windows/system32/"
"C:/Windows/"
"C:/Windows/System32/Wbem/"
"C:/Windows/system32/WindowsPowerShell/v1.0/"
"C:/cygwin/bin/"
)
)
)
)
Xah
∑ http://xahlee.org/
☄
type Win+r, then launch cmd.exe.
cd to your aspell dir, then type aspell. It should run like that.
> it
> does not seam to provide a short cut for running the application.
> I seam to missing the bigger picture; why the error trace says ispell when I
> have aspell installed, I have ispell.el and ispell.elc in
> C:\Documents and Settings\emp1\My Documents\emacs-22.3\lisp\textmodes
you need to tell emacs that your spelling program is aspell not
ispell.
Richard Riley gave you this:
> I didnt see the whole thread, but does he have:
> (setq-default ispell-program-name "aspell")
however, i cant' find the var ispell-program-name in my emacs. Don't
want to spend time on this but there a var somewhere you need to set
about that. Best to read the emacs's doc on the spelling section for
good detail ... you know how to use emacs's info doc?
seems to me you are new to emacs?
if so, i'd suggest you download emacsW32 to begin with because that
distribution made things much easier for window users.
Xah
∑ http://xahlee.org/
☄
> On Aug 2, 12:10 am, sam jesse <rev...@gmail.com> wrote:
>> I installed Aspell and not Ispell.
>> I now have Start > Programs > Aspell ...
>> can I start this application on its own to see if it is working fine?
>
> type Win+r, then launch cmd.exe.
> cd to your aspell dir, then type aspell. It should run like that.
>
>> it
>> does not seam to provide a short cut for running the application.
>> I seam to missing the bigger picture; why the error trace says ispell when I
>> have aspell installed, I have ispell.el and ispell.elc in
>> C:\Documents and Settings\emp1\My Documents\emacs-22.3\lisp\textmodes
>
> you need to tell emacs that your spelling program is aspell not
> ispell.
>
> Richard Riley gave you this:
>
>> I didnt see the whole thread, but does he have:
>> (setq-default ispell-program-name "aspell")
>
> however, i cant' find the var ispell-program-name in my emacs. Don't
I'm not sure what you mean by "can't find".
http://www.emacswiki.org/emacs/InteractiveSpell
http://www.emacswiki.org/emacs/InteractiveSpell#toc5
,----
| You might be interested in using a different spell checker. In
| particular, Aspell is a fairly new replacement for much of Ispell’s
| functionality. Fortunately, using Aspell with Emacs is very easy:
|
| (setq ispell-program-name "aspell")
|
| (Aspell has an Ispell-emulation mode, so it behaves like ispell.el
| expects.)
|
| For lots more information on Aspell, see the Aspell website:
|
| * http://aspell.net/
|
| Compared with Ispell, Aspell is much better at coming up with suggested
| spellings, and at putting them in likely order. This is particularly
| useful when used with flyspell-auto-correct-previous-word, where you can
| iterate through suggested spellings – it’s much more useful when the
| correct spelling is near the head of the list.
|
| The problem with using aspell with flyspell is that in its default mode,
| it it a lot slower than ispell. Fortunately, you can tell it to speed
| up, though this reduces somewhat the quality of its suggestions. So try
| this:
|
| (setq ispell-program-name "aspell") (setq ispell-extra-args
| '("--sug-mode=ultra"))
|
| According to the aspell documentation, “ultra” is the fastest mode,
| which is still twice as slow as ispell; but I don’t notice the
| difference from ispell on my machine. If your machine is fast enough, a
| better option might be to try “fast” mode, which is twice as slow as
| “ultra”, but more accurate. The “normal” mode, which is the aspell
| default, is even more accurate, but is reportedly 10 times slower than
| “fast” mode, and on my machine it makes editing and motion around the
| buffer noticeably sluggish when in flyspell-mode. YMMV, depending on how
| fast your machine is, and how big your word-lists are.
`----
It is in ispell.el, if you do (require 'ispell) first you can see it.
Perhaps it should be autoloaded.
for me, i use speck.el, which i find better than ispell based flyspell-
* etc.
Xah
> | *http://aspell.net/
I'd very much interested in that... i did some 1 hour research on
wikipedia about this in the past month... hunspell seems to be the
best one and used in opera, firefox etc.
anyone has tried to make it work with emacs?
Xah
∑ http://xahlee.org/
☄
I am still trying to fix my spelling feature in emacs running on my windows XP.
when I hit M-$ I get
Starting new Ispell process [default] ...
apply: Searching for program: no such file or directory, aspell
in the trace.
I can run aspell from
C:\Program Files\Aspell\bin>
I have
"C:/Program Files/Aspell" "C:/Program Files/Aspell/bin"
in my load-path
and also I have aspell as the value of the variable ispell-program-name
what am I missing?
Sam,load-path is not relevant. The relevant vars discussed is exec-path and the PATH env var.exec-path in emacs is the var that tells emacs which paths to search to locate external programs.The PATH env var serves similar function in the OS's shell. It must be set correctly.But also, emacs also needs to use the OS's PATH env var, and must inherited it correctly, as emacs does not always inherit it correctly due to various complications such as where or how you launched emacs, OS differences, etc.Emacs's load-path is a set of paths for emacs to locate elisp files. It is irrevalent here.i gave code in previous message on how you set exec-path and PATH.
you gotta pay attention to details here if you want to use emacs.PS but note to emacs developers, it'd be really good to god damn include the essential unix utils as used by emacs. Their executable are tiny by today's standards, and saves huge amount of headache. In particular, spell checking is essential to emacs. On linuxes, all's peach n cream. But unfortunately, linux is used by minority however you count it. On OS X, it's also a pain with spell checking, as there are lots questions about getting it to work or how to use OS X's bundled spell checker that's far superior, yet nigh impossible to get emacs to use. On Windows, getting spell checking to work is a pain in the ass. Not possible unless you have fair degree of sys admin expertise and some emacs know how about all the path vars and mechanisms, AND, have the time to tech geek for fucking hours to get it to work (installing cygwin, dig into cygwin's interactions with OS, sundries minor compatibility issues, researching MinWGW and alternative unix binaries for Windows, dig into online forums ... ). Spell checking works out of the box on any commercial editor today.Xah☄
On Mon, Aug 3, 2009 at 1:51 PM, sam jesse <rev...@gmail.com> wrote:
I am still trying to fix my spelling feature in emacs running on my windows XP.
when I hit M-$ I get
Starting new Ispell process [default] ...
apply: Searching for program: no such file or directory, aspell
in the trace.
I can run aspell from
C:\Program Files\Aspell\bin>
I have
"C:/Program Files/Aspell" "C:/Program Files/Aspell/bin"
in my load-path
and also I have aspell as the value of the variable ispell-program-name
what am I missing?
I am still trying to fix my spelling feature in emacs running on my windows XP.
when I hit M-$ I get
Starting new Ispell process [default] ...
apply: Searching for program: no such file or directory, aspell
in the trace.
I can run aspell from
C:\Program Files\Aspell\bin>
I have
"C:/Program Files/Aspell" "C:/Program Files/Aspell/bin"
in my load-path
and also I have aspell as the value of the variable ispell-program-name
what am I missing?
some tips here
• Using PowerShell to Manage Environment Variables
http://xahlee.org/powershell/environment_variables.html
then, restart your cmd.exe (by just closing it).
After restart, type
echo %PATH%
e.g. on my machine shows:
C:\Users\xah>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\hp\bin
\Python;c:\Prog
ram Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files
(x86)\Quic
kTime\QTSystem\;C:\Windows\system32\WindowsPowerShell\v1.0\
Once you got this, then type aspell from any dir and see it works.
You need to get this step fixed.
Once good, launch emacs, then in emacs, type Alt+x shell or Alt+x cmd-
shell (the latter is in emacsW32, not sure if it is in other emacs on
Windows)
then type
echo %PATH%
the output should match the same as in your cmd.exe. If not, try the
set paths elisp code:
(when (string-equal system-type "windows-nt")
(progn
(setenv "PATH" "/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/
cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/
System32/Wbem")
(setq exec-path
'(
"C:/Program Files (x86)/Emacs/emacs/bin/"
"C:/Windows/system32/"
"C:/Windows/"
"C:/Windows/System32/Wbem/"
"C:/Windows/system32/WindowsPowerShell/v1.0/"
"C:/cygwin/bin/"
)
)
)
)
mod the path for your machine and put it in your emacs init file.
Select the code, then type Alt+x eval-region.
Now, close your shell buffer. Start it again. Try
echo %PATH%
again.
If good, type aspell while in emacs's cmd shell. It should run. If so,
hten you should be have spell checking in emacs now.
--------
on my machine, i have the above in my init file, but often the env var
PATH shown in emacs is still different from OS's PATH value. This
causes running SOME of the unix commands to fail. I haven't
investigated why yet, but i workaround by eval that code again in
emacs whenever that happens ....
nor do i know what exactly is the diff between exec-path and setenv
with PATH...
... spent way too much time writing this. Good luck.
Xah
∑ http://xahlee.org/
☄
I am an emacs newbie, so take everything I write with a grain of salt.
The path value quoted above looks valid for a *nix system not XP.
> should I copy the output from the cmd and put it in the code inside my
> .emacs?
>
Since you are on XP that would be a reasonable thing to try.
--
Suvayu
Open source is the future. It sets us free.
Huh? why do you set PATH to a Unixy value when you are on a Windows
machine?
You should instead set PATH to the same value you set exec-path (only
not as a Lisp list):
> (setq exec-path
> '(
> "C:/Windows/system32/"
> "C:/Windows/"
> "C:/Windows/System32/Wbem/"
> "C:/Windows/system32/WindowsPowerShell/v1.0/"
> "C:/Program Files/Aspell/bin/"
> emacs shell echo %PATH% puts out
>
> /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/
Of course! because that's what you set it to, above.
Thanks for catching that.
i set my PATH in my Windows emacs to unix paths because i'm mostly
using cygwin shell inside emacs...
i still need to do some study on the various paths to have a some sort
of more universal setup, so that i should be able to invoke cygwin or
Windows commands in all of emacs interactive shells: shell, cmd-shell,
powershell... as of now, am not sure that's even desirable... i guess
i needs to understand more about how these shells relates to each
other technically outside of emacs first... the path separator issue
of / vs \ and their automatic conversion in different shells has also
been a pain... in all shells (cygwin bash, cmd.exe, PowerShell) they
all have automatic conversion as you use the shell, but when you write
scripts or set paths, you can't arbitrarily use / or \ (even if
properly quoted in string), the rule for the omission of drive letter
is also a complex issue, and cygwin has some rather esoteric
mechanisms to map drives (e.g. in cygwin bash, “/cygdrive/c” maps to
“C:\”) ...
Xah
my bad... am using cygwin.
> You should instead set PATH to the same value you set exec-path (only
> not as a Lisp list):
so the setenv PATH is equivalent to just setq exec-path? this is great
to know.
Xah
Their docs are here:
• System Environment - GNU Emacs Lisp Reference Manual
http://xahlee.org/elisp/System-Environment.html
(info "(elisp) System Environment")
• Subprocess Creation - GNU Emacs Lisp Reference Manual
http://xahlee.org/elisp/Subprocess-Creation.html
(info "(elisp) Subprocess Creation")
in summary:
“setenv” is for setting OS env vars within emacs. Unixes and Windows
both have env vars. Env vars are global info available to processes
(apps). A process is free to use the info in env var. Some env var are
important as they contain system info such as Windows WINDIR that
contains OS path, and PATH in both Windows and unixes that specify
program paths. Many are config items such as HOME dir in unix and
Windows, and “locale” in unixes. When a process launchs, it inherits
(have access) to all the env vars where the process is launched.
emacs uses the system's env var just like other apps, but more
importantly, emacs shells are interfaces to OS's shells, so as a sys
admin or programer who uses emacs, you want to be able to config
system's env vars as seen in shell within emacs when emacs startup a
shell. (this is done with emacs commands “setenv” and “getenv”, which
are wrappers that manipulate emacs's process-environment var.)
Emacs's “exec-path” var is actually the var emacs uses to locate
external programs. Here's a quote: «Emacs initializes exec-path when
it starts up, based on the value of the environment variable PATH.»
So, the system's PATH env var and emacs exec-path needs not to be the
same, and ideally their values probably shouldn't be identical if one
is a control freak, since they serve different purposes.
The value for exec-path is important to emacs in locating programs,
while the PATH system env var is more important in using emacs as a
shell.
so, judging from all i know, getting aspell to work in emacs means
exec-path should contain the path to aspell. Since emacs set exec-path
to system's PATH env var when it starts, thus setting aspell path in
OS's PATH env var should work too.
Ok. Great to have studied this at least a bit now.
btw, on Windows emacsW23, it has cmd-shell. Is this particular to
emacsW23 or is it in GNU Emacs's Windows branch?
Xah
∑ http://xahlee.org/
☄
> btw, on Windows emacsW23, it has cmd-shell. Is this particular to
> emacsW23 or is it in GNU Emacs's Windows branch?
w32shell.el (where cmd-shell lives) contains wrappers for the "shell"
function that comes with Emacs itself.
The purpose of it is to make it more easy to switch between uing cmd,
Cygwin, MSYS etc as the shell program in command shell. (The name is a
bit unfortunate. I did not know it was so hard to get additions like
this into Emacs so I choose something that could fit Emacs.)
I wrote a summary of my findings. Please see here:
• Difference between Emacs's “(setenv PATH ...)” and “(setq exec-
path ...)”
http://xahlee.org/emacs/emacs_env_var_paths.html
most your q are answered there.
here's your other ones:
> do I need to replace \ with /?
> do I need to replace ; with :?
> and if so, what about the : after the C?
Since my shell in emacs invokes the unix shell by cygwin bash, thus i
need to use unix conventions. In your case, stick with the Windows
convention.
> this setenv, does it modify the PATH in my OS?
No. It only effect how emacs sees the system's env var within emacs's
shells.
> why setenv PATH when there is setq exec-path?
see the link above. I gave a fair bit of explanation on why there are
two.
Oh, you need to escape the back quote in your string, because
backslash in emacs is a escaping mechanism in string. So, do like
this:
(setenv "PATH"
"C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem"
)
Xah
∑ http://xahlee.org/
☄
I don't have that much windows experience, but I'll do my best. 8-)
> I tried to put
> (when (string-equal system-type "windows-nt")
> (progn
> (setenv "PATH" C:\WINDOWS\system32;C:\
> WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\
> QuickTime\QTSystem\;C:\WINDOWS\system32\
> WindowsPowerShell\v1.0;c:\Program Files\Microsoft
> SQL Server\100\Tools\Binn\;c:\Program Files\
> Microsoft SQL Server\100\DTS\Binn\;c:\Program Files
> \Microsoft SQL Server\100\Tools\Binn\VSShell\
> Common7\IDE\;C:\Program Files\Aspell\bin\
> .
> .
> .
>
> do I need to replace \ with /?
Yes, either with / or you need to double the backslash like this: \\,
because the Backslash is the quoting character in emacs lisp strings.
> do I need to replace ; with :? and if so, what
> about the : after the C?
No, I think that would be wrong.
> this setenv, does it modify the PATH in my OS? if
> so, do I need to be logged in with admin account?
> and if I do modify it, does it effect my other
> programs in my windows XP?
You don't need admin rights to change environment variables. It only
has an effect on programs you start from within emacs.
> I read the setenv and getenv but could not figure
> out the above.
> why setenv PATH when there is setq exec-path?
`setenv' sets the environment variable. Whenever emacs uses the OS'
shell to start a program, the shell will see the value of PATH you set
in Emacs. However, Emacs can also start a program without using the
shell, and to this end it has exec-path.
`exec-path' gets set to the list of paths in your PATH environment
variable when emacs starts. Setting PATH in your .emacs is too late,
unfortunately. So to have everything in one place, I'd rather not
touch PATH or exec-path in .emacs, but rather set the system's PATH
correctly in the first place. This fixes the issue not only for Emacs
but for all other programs as well. You shouldn't need admin rights to
do this as this doesn't affect other users.
HTH,
Anselm
--
Anselm Helbig
mailto:anselm.helb...@googlemail.com
thanks for the w32shell.el tip.
we chatted this before... but i'll have to spend some time down the
road to study this.
it'd be nice to integrate PowerShell into it too. Hopefully i can look
at it soon and maybe send you a patch.
On Aug 4, 10:52 pm, Lennart Borgman <lennart.borg...@gmail.com> wrote:
> On Wed, Aug 5, 2009 at 12:06 AM,XahLee<xah...@gmail.com> wrote:
> > btw, on Windows emacsW23, it has cmd-shell. Is this particular to
> > emacsW23 or is it in GNU Emacs's Windows branch?
>
> w32shell.el (where cmd-shell lives) contains wrappers for the "shell"
> function that comes with Emacs itself.
i believe you are saying that w32shell.el is NOT in GNU Emacs code
base right?
so, when people compile emacs 23 on Windows, they don't have cmd-
shell, but just shell, which invokes Windows's cmd.exe right?
what are the reasons not to have w32shell.el in GNU emacs? It seems to
me that it is good to have separate shells. Cause for me, i use all
cmd.exe, cygwin bash, and PowerShell on my Windows machine, and i'd
prefer to be able to run them indivdually while in emacs, instead of
one shell that has all these shell's paths togeter... at least the
unix cygwin bash shell wouldn't mesh well with Windows's.
> The purpose of it is to make it more easy to switch between uing cmd,
> Cygwin, MSYS etc as the shell program in command shell. (The name is a
> bit unfortunate. I did not know it was so hard to get additions like
> this into Emacs so I choose something that could fit Emacs.)
Thanks for the info.
Today i just compiled emacs 23 on my old PPC Mac, and it went very
smooth! I was fantastically happy. Especially so because my mac is a
late 2005 machine running OSX 10.4, and all the other Mac ports of
emacs all have abandoned it for about a year now. I haven't compiled a
program for years... last time i did compile emacs is sometimes in
2002, lol. This week or so i'll install cygwin gcc or whatever
Microsoft's compiler offerings (if free) and try to compile it on
Windows.
Xah
∑ http://xahlee.org/
☄
Actually, my advice is to have them both identical (well, actually,
equivalent, not identical, because one is a list while the other is a
string). That's because exec-path is used when Emacs invokes programs
directly (e.g., via `call-process') while PATH is used indirectly when
Emacs invokes programs via the shell, like in "M-x compile" or "M-x grep".
In the latter case, the shell will look for programs along PATH.
If your values are not equivalent, some Emacs commands that invoke
subsidiary programs will mysteriously fail, and unless you know very
well which Emacs command uses the shell and which does not, you will
have hard time figuring out how to set them correctly.
Of course, if PATH is modified before Emacs is started, then exec-path
will be automatically equivalent to PATH, because it's computed from
PATH's value.
It might be good to add that advice to the Emacs manual. The last sentence,
about the default value of `exec-path', is there (in nodes `Single Shell' and
`Interactive Shell'), but not the rest.
There is also env var EMACSPATH, which is used to initialize `exec-path' (see
node `General Variables'). Note that the same thing is said, in the same node,
about env var `PATH'. Nothing is said about which of them takes precedence, if
both env vars are defined. And while PATH is mentioned in nodes `Single Shell'
and `Interactive Shell' as the start-time source of `exec-path', EMACSPATH is
not mentioned beyond the one-liner in node `General Variables'.