2

Very Similar Question

And I am currently trying to install rust-mode for emacs 24.5.1 following the instructions at https://github.com/rust-lang/rust-mode. Firstly I installed manually, it worked fun. But when I wanted to install it by MELPA, I got a problem. I'v added

(when (>= emacs-major-version 24)
  (require 'package)
  (package-initialize)
  (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
  )

(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)

to my ~.emacs.d/init.el. However, when I restart and do M-x package install [RETURN]rust-mode[RETURN], it returns [No Match] and I can't find it when I list the packages. However, I can find it at http://melpa.org/packages/rust-mode-20160106.642.el.


I changed my configuration to prelude's, then the problem is solved, so there must be something wrong with my old configuration, I'll try to find why.


I'm not a good English speaker, sorry for my poor English. Any help is much appreciated; Thank you!

Community
  • 1
  • 1
zhumengzhu
  • 698
  • 5
  • 22
  • The complete config I'm using is this: https://github.com/redguardtoo/emacs.d. – zhumengzhu Jan 07 '16 at 12:37
  • 1
    I just installed from melpa, no problem. I don't see anything wrong with your config. Try `M-x list-packages` and see if it shows up there. Also try `package-refresh-contents`, which `list-packages` does automatically. – jpkotta Jan 07 '16 at 16:32
  • I have tried it many times and it doesn't work. I try `M-: package-archives`, and I got these: `("melpa" . "http://melpa.org/packages/") ("melpa-stable" . "https://stable.melpa.org/packages/")`. There is no rust-mode in the stable site; and the race version there is 1.0.1, which is the exactly where my emacs shows. But I didn't add `("melpa-stable" . "https://stable.melpa.org/packages/")` in my `init.el` file. – zhumengzhu Jan 08 '16 at 03:07

2 Answers2

0

This is my stupid mistake.

The author of the configuration which I use says in Checklist:

It’s my intentional design that you can NOT install packages from melpa-unstable by default. Experienced users can modify variable melpa-include-packages in “~/.emacs.d/lisp/init-elpa.el” to install packages from melpa-unstable.

I add rust-mode to “~/.emacs.d/lisp/init-elpa.el” and the problem sovled.

@jpkotta Thanks for your help, sorry for wasting your time.

zhumengzhu
  • 698
  • 5
  • 22
0

I just had this same experience. M-x package-install, type 'rust-mode' and emacs announces 'No match'. M-x package-list-packages does show rust-mode. Using the package list UI, C-s 'rust-mode', press 'i' (install) => a capital 'I' appears in the first column. 'x' terminates the package list mode, and downloads and installs rust-mode. Now, M-x package-list-packages shows rust-mode installed. I do not know why the one path works when the other "normal" path failed.

Jim Reesman
  • 224
  • 2
  • 6