Emacs polymode gives error when opening file - emacs

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.

Related

emacs cannot load file highlight-current-line file-error

Emacs version : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
of 2013-03-18 on MARVIN
Copied the code for highlight-current-line from here. Created a text-file in .emacs.d, pasted the entire text on page in the text-file and saved it as highlight-current-line.el in the same folder.
Added the following lines to .emacs :
(add-to-list 'load-path "~/.emacs.d/")
(require 'highlight-current-line)
(global-hl-line-mode t)
(set-face-background 'hl-line "white")
(setq highlight-current-line-globally t)
Restarted emacs and got this message :
Warning (initialization): An error occurred while loading
`c:/Users/Owner/AppData/Roaming/.emacs':
File error: Cannot open load file, highlight-current-line
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.
Started emacs in debug mode and got this error in backtrace:
Debugger entered--Lisp error: (file-error "Cannot open load file"
"highlight-current-line") require(highlight-current-line)
eval-buffer(# nil
"c:/Users/Owner/AppData/Roaming/.emacs" nil t) ; Reading at buffer
position 1209
load-with-code-conversion("c:/Users/Owner/AppData/Roaming/.emacs"
"c:/Users/Owner/AppData/Roaming/.emacs" t t) load("~/.emacs" t t)
My system : Windows 7 32bit
Once upon a time it made sense to copy snippets from EmacsWiki into your configuration, but between new high-quality built-in features and third-party package repositories like MELPA that is rarely the case anymore.
Your version of Emacs should be new enough to include hl-line.el, which contains a some useful functions:
To make the cursor even more visible, you can use HL Line mode, a minor mode that highlights the line containing point. Use M-x hl-line-mode to enable or disable it in the current buffer. M-x global-hl-line-mode enables or disables the same mode globally.
To enable highlighting of the current line globally, simply add
(global-hl-line-mode)
to your init file.
Edit: Upon re-reading your question, I see that you are already using hl-line.el, though this is interspersed with things relating to highlight-current-line.el. I recommend removing the following lines from your configuration:
(add-to-list 'load-path "~/.emacs.d/") ;; Unless you need it for another reason
(require 'highlight-current-line)
(setq highlight-current-line-globally t)
You can additionally remove the t from you call to (global-hl-line-mode), since this function turns the feature on when called from lisp.
Turns out copying text into notepad, saving it with .el in the file name and All files in the file type simply saves the file as highlight-current-line.el.txt .
I used the Save link as option in the dropdown menu on the download link instead, which worked perfectly.

Emacs init file cannot open load file OS X

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

cannot open load dired-details

I just installed the emacs package dired-details from inside emacs via
M-x package-list-packages
clicked on the package name and then install in the newly opened buffer.
Then I put those lines into my .emacs:
(require 'dired-details)
(setq-default dired-details-hidden-string ">---< ")
(dired-details-install)
When I restart emacs, I get the following error:
File error: Cannot open load file, dired-details
The interesting thing is, that when I mark the code region above and apply
M-x eval-region
everything works as expected.
emacs --version
>> GNU Emacs 24.3.1
package version:
dired-details-20130328.1119
Packages you installed with package.el need to be initialized if you want to access them during emacs initialization.
Add the line
(package-initialize)
to the very beginning of your .emacs .
Also follow phil's recommendation and see the variable
package-enable-at-startup

Emacs lua-mode (File mode specification error)

I get the following error
File mode specification error: (error "Unknown rx form `group-n'")
when I try to edit a .lua file in emacs. I use GNU Emacs 23.3.1, and I have the following in my .emacs file:
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
I installed lua-mode from http://immerrr.github.com/lua-mode/.
I have tried to run emacs with the --debug-init option, but it did not enter the debugger, instead the .lua file opens in text-mode and not lua-mode..
(See also Emacs lua-mode issue: (void-function interactively-called-p))
Your Emacs is complaining because it knows nothing about group-n symbol used in rx macro in one of the recent commits, and that is probably because that symbol was only introduced in Emacs 24.2 and your one is a bit older.
I must admit, when coding that I thought that rx package was much more mature and didn't even bother looking up its changes in Emacs news. So, there are two options here:
either you update your Emacs to 24.2
or you could downgrade to older revision and wait while I have the chance to rewrite that piece of code.
UPD: the issue is fixed in upstream, the code is compatible with Emacs23 again.

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)