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.
Related
I am new to coding started just a month ago. I am preparing ahead for my bootcamp with EMACS. I followed a tutorial and was told to initialize package. The code I used was:
(package-initialize)
(require 'package)
(add-to-list 'package-archives ' ("melpa" . "http://melpa.org/packages/"))
(package-initialize)
I keep getting warning (package): Unnecessary call to ‘package-initialize’ in init file and I don't know what to do next or how to solve it.
According to the emacs changelog 1, you can get rid of the call to package-initialize if you use emacs >= 27:
Installed packages are now activated before loading the init file.
As a result of this change, it is no longer necessary to call
'package-initialize' in your init file.
Also,
if you want to ensure that your init file is still compatible with earlier versions of Emacs, change it to:
(when (< emacs-major-version 27)
(package-initialize))
Today I tried to configure python development in emacs.
I installed pymacs, pycomplete+ , python-mode, python-pep8 with el-get.
When i tried to install rope I got this error
el-get-executable-find: The command named 'hg' can not be found with `executable-find'
then,when I delete the config about "el-get"
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)`
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
(el-get 'sync)
the error disappear.
Anyone could help me to fix it?
As already commented, the mercurial dvc command,"hg", was not found in path.
Once noticed Emacs didn't load all executables in emacs variable "exec-path" as in $PATH. This happened when started from a windows-system button. Maybe when started from console it's gone.
Check exec-path, if it includes the directory displayed by "type hg".
Adding it to exec-path via init-file might be an option in this case.
~/.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.
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.
I'm trying to use slime from CVS (2009-01-05) but keep getting this error:
LOAD: A file with name
/usr/share/common-lisp/source/slime/swank-loader.lisp does not exist
I've stripped my .emacs down to just:
(setq inferior-lisp-program "/usr/bin/clisp")
(add-to-list 'load-path "/home/ssm/lisp/slime/")
(require 'slime)
(slime-setup)
I've deleted my ~/.slime directory, started with 'emacs -q' and eval'd the above code but I keep getting the LOAD error when I run slime (via M-x slime). Any ideas on how to fix this error?
FWIW, I've tried to install slime via apt-get but I keep getting errors there too about cl-swank being broken. That's a whole different story.
Have you purged the slime pkg you installed via apt-get? It looks like emacs is still reading the old site-specific configuration setup by apt-get. Try starting emacs with the -Q option, which prevents loading of site-specific (as well as user specific) customization, and see if the problem still occur.
I agree with huaiyuan that older files may be being picked up.
Try (load-file "/path/to/slime.el") instead of require. (You did remove the .elc files from your old versions, right? emacs will load from .elc files in preference to .el files, even when the .el is newer.)
The next thing to try is M-x customize-variable slime-backend and setting that to the absolute path of swank-loader.lisp. I think that will fix it for sure, but I am not sure why it doesn't work to begin with.
Thanks guys, ~/.emacs:
(setq inferior-lisp-program "<path-to-lisp-compiler>/bin/lisp")
(setq slime-backend "<path-to-slime>/swank-loader.lisp")
(add-to-list 'load-path "<path-to-slime>/")
;;(require 'slime)
(load-file "<path-to-slime>/slime.el")
;;(slime-setup)
(slime-setup '(slime-fancy))
works :)