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

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.

Related

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 update-file-autoloads failing

I'm trying to setup emacs to be my GO IDE by following this tutorial with this code . I'm running into problems when I have to have emacs generate a file
From within Emacs, run M-x update-file-autoloads, point it at the go-mode.el file and tell it to generate a go-mode-load.el file.
I get this error when I enter the path of the file (location ~/.emacs.d/go-mode/go-mode.el)
Opening output file: no such file or directory, /build/buildd/emacs23-23.3+1/debian/build-x/lisp/loaddefs.el
I did a locate on this file and see I do have it but not at the path specified path above
$ locate loaddefs.el
/usr/share/emacs/23.3/lisp/loaddefs.el
...
If I had to guess I would say some kind of path problem. Do I have to set a path variable somewhere?
I installed emacs through apt-get install emacs23
I'm on Ubuntu 12.04
Thanks
EDIT
The process I'm doing to get the error.
M-x update-file-autoloads Enter
Update autoloads for file: ~/.emacs.d/go-mode/go-mode.el Enter
Opening output file: no such file or directory, /build/buildd/emacs23-23.3+1/debian/build-x/lisp/loaddefs.el
I had the same problem and finally got it working. Open your scratch buffer (or any other empty file) and type in the following two lines
(setq generated-autoload-file "~/.emacs.d/go-mode/go-mode-load.el")
(update-file-autoloads "~/.emacs.d/go-mode/go-mode.el")
Then evaluate both lines by putting the cursor at then of each line and type in C-x C-e to evaluate the line before the cursor. Do this for both lines. Then make sure to open go-mode-load.el and save the buffer - apparently emacs does not do this by default.
Once you've done this you can continue to follow the instructions at http://www.honnef.co/posts/2013/03/writing_go_in_emacs/
Disclaimer: I am sure there is a better way to do this and lisp experts will shriek at my answer. I have no clue about lisp and how to use lisp in emacs. I just did an informed guess :-)
Just recently hit this while attempting to get go-mode.el set up on my raspberry pi. Luckily, I had already generated a go-mode-load.el file successfully on my Mac and was able to take a look at that.
In there I saw this comment:
;; To update this file, evaluate the following form
;; (let ((generated-autoload-file buffer-file-name)) (update-file-autoloads "go-mode.el"))
So I cd'ed into the directory where I had downloaded go-mode.el, then touched a new file called go-mode-load.el, opened it up in emacs, pasted in that line of code, evaluated it with C-x C-e and it worked like a charm.
EDIT
Wasn't able to get the generated file working until I added these lines to the end. As of writing this I haven't taken the time to figure out why they are needed but adding them fixed the problem:
(provide 'go-mode-load)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; go-mode-load.el ends here
(Not an answer, but needs formatting)
Is there a local definition of `generated-autoload-file' in go-mode.el? If so, it will write there, so you need to remove that line.
;; update-file-autoloads docs
update-file-autoloads is an interactive compiled Lisp function in
`autoload.el'.
(update-file-autoloads FILE &optional SAVE-AFTER OUTFILE)
Update the autoloads for FILE.
If prefix arg SAVE-AFTER is non-nil, save the buffer too.
If FILE binds generated-autoload-file' as a file-local variable,
autoloads are written into that file. Otherwise, the autoloads
file is determined by OUTFILE. If called interactively, prompt
for OUTFILE; if called from Lisp with OUTFILE nil, use the
existing value ofgenerated-autoload-file'.
Return FILE if there was no autoload cookie in it, else nil.
Checkout the actual installation instructions from the go-mode-el GitHub webpage. It looks like there have been some changes which are not reflected in the tutorial.
Just try to either use ELPA or follow the manual instructions:
(add-to-list 'load-path "/place/where/you/put/it/")
(require 'go-mode-autoloads)

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.

Wrong number of arguments: called-interactively-p, 1

~/.emacs
;; http://cx4a.org/software/auto-complete/manual.html
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
(ac-config-default)
when I load emacs, it complains the error as "Wrong number of arguments: called-interactively-p, 1". In other words, emacs finds error until the line (ac-config-default).
when I check the file .emacs.d/auto-complete.elc, I found the string "called-interactively-p".
Question> I have used the same setting for ubuntu without problems. Now I am switching centos 6.2. Is there a way that I fix this problem?
emacs --debug-init shows the following errors:
͂
It is worth mentioning that this error may arise if you move your emacs.d directory from one machine to another.
If this is the case, removing the compiled *.elc files should do the trick.
In recent Emacsen, called-interactively-p requires an argument.
Do C-h f ac-quick-help RET, then replace (called-interactively-p) by (called-interactively-p 'any) and recompile/reload. Or send this bug to the package's author.
[ As I mentioned recently in some other stackoverflow question, it is strongly recommended to not put "~/.emacs.d" in your load-path since the ~/.emacs.d directory can/will hold configuration files whose name clashes with real emacs packages. I.e. put the auto-complete files in a *sub*directory of ~/.emacs.d. ]
Your error looks very strange: while called-interactively-p is declared in Emacs-23 as taking exactly 1 argument, it actually accepts 0 arguments as well (to ease up the pain for external packages that want to support both Emacs-22 and Emacs-23).
So seems to be something else in your config which somehow redefines called-interactively-p.

Emacs Rinari won't load at startup

Hey, I wanted to try out some rails. And since I don't want to use any fancy IDE. I thought I could try rails out using emacs with Rinari. Anyway I got some problem which I couldn't find any solution on google for it.
Basically I have a clean .emacs and I added the necessary lines for it
;; Interactively Do Things (highly recommended, but not strictly required)
(require 'ido)
(ido-mode t)
;; Rinari
(add-to-list 'load-path "~/home/stardust/rinari")
(require 'rinari)
The only thing that's change is the location for where I extracted Rinari. When I try to open emacs with these changes I get this error. Anyone who might know what the problem is?
Warning (initialization): An error occurred while loading `/home/stardust/.emacs':
File error: Cannot open load file, rinari
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.
I suspect the ~ in front of the path to Rinari is superfluous and should be removed.