Emacs init file cannot open load file OS X - emacs

I am trying to add haskell-mode to emacs, but I run into the error: cannot open load file.
This is what I've done...
First I downloaded the tar file for haskell-mode version 2.4 from here : http://projects.haskell.org/haskellmode-emacs/
After doing so, I have a directory full of mode and modules called haskell-mode-2.4 in my /Users/username/Downloads/....
The next step, I added this to my ~/.emacs.d/init.el (Note: I also tried adding it to my ~/.emacs as well) as specified here...http://doc.gnu-darwin.org/haskell-mode/installation-guide.html :
(load "/Users/username/Downloads/haskell-mode-2.4")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
But after doing all this, I get an error: cannot open load file.
Why is this so? Could it be that my emacs version does not support the haskell-mode?

Try the following:
(load "/Users/username/Downloads/haskell-mode-2.8.0/haskell-site-file")
Also, I'd suggest moving from Downloads to a different folder, but that's off topic ;)

Related

Emacs (24.4.1) will not open installed package

I am a newbie Emacs user, and have a problem when trying to install a new Emacs package. The package is https://github.com/tlh/workgroups.el.
I followed the file installation instructions in the accompanying README.md file: I copied the content of the "workgroup.el" into a new textfile with the same name, saved it to the same directory as my init.el file ("Put workgroups.el somewhere on your Emacs load path"), and added (require 'workgroups) to my init.el file ("Add this line to your .emacs file: (require 'workgroups)").
However, when saving and closing Emacs, and then opening my init file I get the
following error message
"File error: Cannot open load file, no such file or directory, workgroups "
Why doesn't Emacs recognize the new package?
Thanks in advance for any help : )
The directory where your init file lives (which is either your home directory or your ~/.emacs.d directory) is not in your Emacs load-path by default, and should not be added to it. (Recent versions of Emacs will complain if you do that.)
Instead place the new elisp library into a sub-directory named something like ~/.emacs.d/lisp, and add that to your load-path, by adding the following to your init file:
(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp"))

Emacs polymode gives error when opening file

I downloaded the polymode zip-file from GitHub, open the zip-file which gives a folder named polymode-master . I renamed the folder to polymode and put it on my .emacs.d folder. Then I inserted the following lines into my .emacs file:
;; Polymode
(setq load-path
(append '("~/.emacs.d/polymode/" "~/.emacs.d/polymode/modes")
load-path))
(require 'poly-R)
(require 'poly-markdown)
When I open a file with emacs it gives me the following error:
Warning (initialization): An error occurred while loading `c:/Users/ab/.emacs':
File error: Cannot open load file, markdown-mode
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
Any idea what I did wrong?
Thanks for help.
PS:
Windows 7
GNU Emacs 24.3.1
ESS
polymode depends on markdown-mode for its Markdown support, and it doesn't look like you have it installed.
Since you're using Emacs 24, which has package.el built-in, I strongly recommend installing it via MELPA stable (also available in regular MELPA and Marmalade), but if you're still installing packages manually you can find it on its website.

Emacs not recognising .emacs.d folder on startup

I'm new to Emacs. I recently got a dot-emacs configuration from GitHub. Cloned the repo in my home directory as .emacs.d
This is for setting up a clojure environment. When i open Emacs and enter
M-x nrepl-jack-in, the minibuf displays 'No Match'
What am I doing incorrectly? Thanks!
It's possible that nREPL isn't being loaded. Add the following to your init.el:
(autoload 'nrepl-jack-in "nrepl" nil t)
You should be able to run it now with M-x nrepl-jack-in.
If the command doesn't work you'll need to do some troubleshooting.
make sure that nREPL is actually installed. You'll need both the Emacs library and the nREPL server.
check for any errors during startup. Launch Emacs from the terminal using the --d flag:
emacs --d
You will get a backtrace if anything goes wrong during the startup.
verify that your init.el is actually being loaded. Add the following code to the end of your init.el and restart Emacs.
(message "---> LOADED")
This will show in your *Messages* buffer if everything is being loaded.
Edit:
Looks like your init.el isn't being loaded. Check your home folder for files called .emacs or .emacs.el, which might be getting loaded instead.
Otherwise it could still be a path issue. Open a terminal and make sure this is the file you expect:
less ~/.emacs.d/init.el

Emacs configuration for dirtree

I'm currently trying to get dirtree for Emacs working. I'm unfamiliar with configuration files and I'm having trouble getting it to work. Currently I have dirtree.el, along with the other required files, inside of my .emacs.d directory, and I've added the following lines to my .emacs file.
(add-to-list 'load-path "~/.emacs.d/")
(autoload 'dirtree "dirtree" "Add directory to tree view")
I don't get any errors when I open Emacs, but when I type M-x dirtree, I get a message saying there is no match. Can anyone see what I'm missing in order to get this to work correctly?
The dirtree that I'm using can be found at: http://www.emacswiki.org/emacs/dirtree.el
The error is in the autoload declaration suggested by the library. It does not include the interactive flag to tell Emacs that it is a command (interactive function), and only commands may be invoked via M-x.
The corrected declaration is:
(autoload 'dirtree "dirtree" "Add directory to tree view" t)
I've tried to load it on my machine. It seems that dirtree requires a second module called tree-mode (which I don't have installed). Did you install that one too? If not, you may have the same error.
By the way, you shouldn't have to add ~/.emacs.d to your load path; I'm reasonably sure it's there by default.

Emacs not recognizing its own scripts in /emacs/lisp/

I'm very new to emacs and I'm using version 23.2 on Windows. I'm trying to get CEDET working, but when I require it in .emacs it fails to find the file:
File error: Cannot open load file
I was able to get cedet working by loading it manually with:
(load "C:/emacs/lisp/cedet/cedet.el")
But I still can't require other files from cedet like semantic-gcc or semantic-ia.
Here's my .emacs file:
(load "C:/emacs/lisp/cedet/cedet.el")
(global-ede-mode t)
(semantic-mode 1)
;(semantic-load-enable-excessive-code-helpers)
(require 'semantic-ia)
(require 'semantic-gcc)
It's like emacs isn't looking for these files in its own path, and I did try
(add-to-list 'load-path "C:/emacs/lisp/cedet")
With a lot of other variations but none worked.
Firstly, you need to find the reason that cedet won't load with a simple (require 'cedet).
Is Emacs installed at c:\emacs? (ie the emacs.exe you are running is c:\emacs\bin\emacs.exe)
Is something setting EMACSLOADPATH externally from Emacs (your environment, or in the registry under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER /Software/GNU/Emacs?
Is there another installation of an older version of CEDET on your load path?
Has c:\emacs\lisp\subdirs.el been edited to remove the cedet subdirectory?
Once you've solved that, note that the paths were changed when CEDET was merged into Emacs to accommodate old systems that have limitations on file name lengths. But at the same time, the autoloads were improved, so you shouldn't need to explicitly require those files any more. If you still do, the following should work:
(require 'semantic/ia)
(require 'semantic/bovine/gcc)