Emacs Rinari won't load at startup - emacs

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.

Related

How to debug connections to melpa with emacs

I'm trying to add packages via melpa in my init file. It was working, but today it stopped. To debug, I started with "emacs -q" and typed the following into my scratch buffer:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
The first two lines seem to work. The third line gives me an error and stack trace:
(wrong-type-argument arrayp nil)
package--add-to-archive-contents(nil "melpa")
package-read-archive-contents()
Is the error with my setup? Do I have the wrong url for melpa? I'm using GNU Emacs 24.5.1.
Although I'm not very familiar with it, I took a quick look at the package.el code.
My guess is that your ~/.emacs.d/elpa/archives/melpa/archive-contents file is "corrupted". As a result, package--add-to-archive-contents is not finding an array for an element it would expect to get from that file.
I believe the archive-contents file is only a local cache. If you delete it, it will get rebuilt, and you should be all set.

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 24.3 dired+ won't load

I installed dired+ through list-packages (the folder was put in the elpa folder), and put '(add-to-list 'load-path "~/.emacs.d/elpa/")' in my init file (which I created myself), and '(require 'dired+) under. When I open emacs, I get an error telling me there's an error in my init file. If I remove the '(require 'dired+) line, the error stops, but again dired+ doesn't work when I call dired mode. The actual folder that was downloaded when I installed it is 'dired+-20130206.1702'. So I tried '(require dired+-20130206.1702), which again gave me an error on startup.
I'm at my wits end. I've tried everything I can think of, gone through the GNU emacs docs, googled the problem, looked at the answers here at Stack, and no luck. Does anyone have any suggestions? I'm using Windows XP.
It's impossible to say for certain without seeing all the code, but you appear to be quoting your forms for no reason.
i.e., these:
'(add-to-list 'load-path "~/.emacs.d/elpa/")
'(require 'dired+)
should be:
(add-to-list 'load-path "~/.emacs.d/elpa/")
(require 'dired+)
However that should just make them ineffectual, rather than causing errors directly.
Show us the code and the error message.
Edit:
Adding the /dired+/ to the end seemed to fix it ... Although I have no idea why. Any thoughts?
load-path holds a list of directories in which Emacs will look for libraries. It does not automatically descend into sub-directories, so you need to specify all relevant directories for your libraries. Your dired+ library is clearly in the ~/.emacs.d/elpa/dired+/ directory.
For menubarplus, you will similarly need to check to see which directory the library is in.
To be honest, I had thought that the package management in Emacs 24 would take care of this automatically; but as I've not been using it, I'm not certain.
Edit 2:
Yes, I suspect you have some other problem here. I just experimented with installing a library via the package manager (albeit from the default package repository, which doesn't include a dired+ package), and after restarting Emacs load-path contained the path for the new library without any intervention on my part.
I think Phils answered your question wrt loading Dired+ (specify the right directory, the one where you put dired+.el).
Wrt Menu-bar+, the feature name is menu-bar+, not menubarplus and not menu-barplus. So change your (require 'menubarplus) to (require 'menu-bar+).

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.

Running my own code when during Emacs startup

Let's say I have my own elisp code in ~/bin/hello.el.
The ~/.emacs file has the following code to run hello.el at startup.
(add-to-list 'load-path "~/bin/elisp")
(require 'hello)
But, I get the following error message.
Warning (initialization): An error occurred while loading `/Users/smcho/.emacs':
error: Required feature `hello' was not provided
What's wrong with this?
Does hello.el provide hello? It should start with (provide 'hello). See the elisp manual. Does (load "hello.el") work?
You have to put something like that in your LISP code:
(provide 'hello)
If you added ~/bin/elisp to your load-path, then Emacs won't find a file in ~/bin. In this case, Emacs would try to load ~/bin/elisp/hello.el, and if it can't find that, then it will look for a file named hello.elc or hello.el (in that order) in the other parts of your load-path.
Also, as others have mentioned, hello.el needs to have a (provide 'hello) in it (typically at the end).