emacs el-get only runs one time, afterwards cannot be found - emacs

I install el-get by typing this into my buffer, highlighting, and hitting C-j:
(url-retrieve
"https://raw.github.com/dimitri/el-get/master/el-get-install.el"
(lambda (s)
(goto-char (point-max))
(eval-print-last-sexp)))
...according to the installation documentation.
I can then install things using M-x el-get commands. Great so far.
However, when I close emacs and restart, M-x el-get cannot be found, nor can any of the packages I installed with it. When I try to reinstall el-get in the method above, installation says the git package already exists:
fatal: destination path 'el-get' already exists and is not an empty directory.
I can delete the el-get directory in my emacs.d/ folder and get back to the beginning, but can't seem to get el-get to stay installed beyond the first time. What am I missing or misunderstanding?
Also---I'm only using el-get in the first place to be able to install auto-complete for using emacs for python development. If you have an easier or better easy-installation recipe for that, I'd appreciate that suggestion, too.

(Never used el-get myself, but...)
a) You should add the code from one of the examples in the Basic Setup section. It includes forms like (add-to-list 'load-path ...) and (require 'el-get ...), which are more or less essential for loading Emacs packages.
b) You can just as well install auto-complete from Marmalade or Melpa. I think this is the recommended option if you're using Emacs 24. Add at least one of the repositories to package-archives, press M-x list-packages RET, look for auto-complete, press i, then x.

Related

Cannot install MELPA package in Emacs

I'm new to emacs and trying to install the smartparens package from MELPA.
I have the package installed (I'm pretty sure)
The next step in the docs is to run (require 'smartparens-config). I put this in my ~/.emacs, but it doesn't seem to work. I also tried M-x require 'smartparens-config, but it says there is [No match] for require.
Not sure how to proceed here
You should include (package-initialize) in your init file, before you're calling (require 'smartparens-config)

Problem with installment of Common Lisp requirements

I am trying to learn common lisp and following the installation process from https://lisp-lang.org/learn/getting-started/
The website says to add something to my ~/.emacs file, but I do not find it. Does someone now where I can find that?
enter image description here
Seems like you want to install a custom slime to use Common Lisp on Linux. Maybe one should install it from a given distribution, it would be easier.
I would suggest the following steps:
1. Setup Emacs to use MELPA repository:
M-x customize-variable
Customize Variable: package-archives
Then, simply add melpa with the URL https://melpa.org/packages
Then press the button Apply and Save.
2. Install slime from the package manager
M-x list-packages
Search for slime, press i for install and then press x to proceed. You should have a proper version of slime installed.
3. Happily hack Common Lisp!
EDIT:
I missed this installation method that you probably followed. In this case, I believe that the init directory has a typo and is missing a dot (.)
(load (expand-file-name "~/.quicklisp/slime-helper.el"))
^
\---- HERE
(setq inferior-lisp-program "sbcl")

Common Lisp auto completion in emacs

Update
Apparently, the auto-complete package is not the culprit.
Emacs fails to download melpa archive.
A quick google search indicates that this is a reappearing problem both on windows and unix machines.
As there are already threads concerning failed to download 'melpa' archive (none of which helped unfortunately) this thread may or may not be closed.
Inital Question
I'm trying to set up emacs for Common Lisp.
I installed sbcl and the slime package.
Some time ago I used to have auto completion for Common Lisp keywords in emacs such that - while typing - it suggested a word via a greyed out completion (TAB for acceptance) or via drop down or both. (I can't remember exactly.)
I'm struggling to get this working again.
At https://github.com/purcell/ac-slime it is suggested to first install auto-complete but when I type package-list-packages there is no such package. (But there are plenty named auto-complete-*).
(I set up Melpa with:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/")))
The provided link http://cx4a.org/software/auto-complete/ is dead as well.M-x install-package [RET] auto-complete [RET] also fails. Emacs says: [No match]
So my question is:
If there is no auto-complete package anymore, what is a good way to set up Common Lisp auto completion in emacs in the way mentioned above (greyed out word or dropdown)?
The current home-page for auto-complete is https://github.com/auto-complete/auto-complete
Installing it should be enough to allow you to use ac-slime (there is also a completion version using company).
Here is how I got it to work.
Download the .ZIP archive with repository here.
Unzip
Run M-x package-install-file
On the prompt, specify the path to the downloaded repository and the file named auto-complete.el.
Make sure that installation returns something along the lines of "Successful"
Add this line to your Emacs initialization file (.emacs):
(ac-config-default)
To auto-complete in SLIME, follow similar step to install ac-slime (requires SLIME and Auto-complete)
P.S. There is another package called company (stands for Complete Anything), which is quite good as an alternative. I am trying it out now. Getting it to work was very simple.

I can't load an .el package on emacs

So I downloaded an .el file, I put it on the ~/.emacs.d/elpa/ folder, but it won't appear on the M-x list-packages. How do I make it appear there or how can I install this file/package?
There are two ways of installing an Emacs package: either type M-x list-packages and install it from the list, letting Emacs download it for you, or download the package yourself and install it with M-x package-install-file.
Installing from a package archive
In the first case, note that there are several different package archives. The default value for the variable package-archives only contains GNU ELPA, but most people want to add MELPA to that list since it has more packages. To do that, you need to add the following to your .emacs file (copied from the MELPA web page):
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(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) ;; You might already have this line
After that, typing M-x list-packages should list more packages than you'll ever need :)
Installing from a downloaded file
There are two types of packages: single-file packages and multi-file packages. The former can be downloaded as a single .el file, while the latter are distributed as tarballs (.tar). Both types can be installed with M-x package-install-file.
Note that not every .el file can be installed as a package. The comments at the beginning of the file need to follow a certain convention, documented in the Simple packages node of the Emacs Lisp reference manual.
That leaves the possibility that the .el file you've downloaded is not installable as a package. In that case, you should put it in some other directory (~/.emacs.d/elpa is meant for installed packages only), add that directory to the load-path variable, and require the package. If you have foo.el and put it in ~/path/to/foo, it would look something like this:
(add-to-list 'load-path "~/path/to/foo")
(require 'foo)
An .el file is not a package. Installing it via ELPA is probably vastly preferrable to manually downloading a static .el file; perhaps the maintainer has a home page with ELPA (or Marmalade, etc) instructions.
In particular, a package will receive updates as they are made available, so you will not be forever stuck on an increasingly obsolete, unmanaged version (though quiet, fully automatic updates are not yet available or feasible, AFAICT).
But if you have to get by with just the file you already downloaded, you can put it pretty much anywhere you like, as long as that directory is included in the load-path. Manually mucking with the elpa directory is a bad idea, though; put it somewhere else.
Look for comments near the top of the file for any additional instructions; any autoloads, for example, will probably have to be configured separately, and usually completely manually.
This used to be how you always did things in older versions of Emacs, so you should find that the Internet is still practically bulging with guides and tutorials which explain the finer details of this mechanism, if this answer alone isn't sufficient.

SLIME not loading from Emacs

I've recently updated SLIME from package-list-packages in Emacs. However, when I try to run it using M-x slime, I get this:
(progn (load "/home/koz/.emacs.d/elpa/slime-20140913.730/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.3081"))
*
; loading #P"/home/koz/.emacs.d/elpa/slime-20140913.730/swank-loader.lisp"
;;
;; Error while compiling /home/koz/.emacs.d/elpa/slime-20140913.730/swank/backend.lisp:
;; Failed to find the TRUENAME of /home/koz/.emacs.d/elpa/slime-20140913.730/swank/backend.lisp:
;; No such file or directory
;; Aborting.
;; *
I still have a REPL afterwards, but I think this is very strange, and I'd like to know what's going on and why.
On Freenode's #lisp channel, I talked to one person who agreed that the current version of SLIME in MELPA (20140913.730) is broken. On my system, the whole $HOME/.emacs.d/elpa/slime-20140913.730/swank/ directory is missing, which presumably is why it can't compile Lisp files found therein.
Other members of the channel suggested installing SLIME from Quicklisp; I did that and it worked, although the SLIME version there is slightly older (dated 2014-08-01). Here is what I did (I didn't already have Quicklisp installed); adjust to match your system and preferences:
Uninstall SLIME from Emacs's package list (do M-x list-packages, go to the line for SLIME, press d, then press x).
Visit http://www.quicklisp.org/beta/ and download the file in the green box (in my case, it went in ~/Downloads).
Upgrade SBCL to 1.2.2 or later. This is probably overkill.
Launch sbcl.
Evaluate (load "~/Downloads/quicklisp.lisp").
Evaluate (quicklisp-quickstart:install); optionally, if you don't want it to go in ~/quicklisp, add :path "~/.quicklisp/" (substituting whatever directory you actually do want it installed in).
Install SLIME and SWANK by evaluating (ql:quickload "swank").
Optional: evaluate (ql:add-to-init-file) to patch your .sbclrc to always load Quicklisp in SBCL.
Exit SBCL with Ctrl+D.
Adjust your Emacs config file as shown in SLIME's readme. For the path entry, use "~/quicklisp/dists/quicklisp/software/slime-2.9" (adjusted for whatever path you installed Quicklisp in).
Restart Emacs and M-x slime should work.
This is caused by losing the swank sub-directory in your slime folder. To fix it, you can simple download slime from github and copy the folder swank to your slime installed path, for your situation is /home/koz/.emacs.d/elpa/slime-20140913.730/ then restart your slime. it will be load correctly.