Cannot install MELPA package in Emacs - 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)

Related

I can't install org-checklist

I'm trying to install org-checklist for spacemacs but I'm having some difficulties. On the project documentation (https://orgmode.org/worg/org-contrib/org-checklist.html) it says enable the org contrib directory but when I run M-x find-library RET org-contribdir it says the contrib directory is deprecated. When I try installing org-plus-contrib with package-list-packages, nothing happens.
How to untick checkboxes in org-mode for the next cyclic/repetitive task - This stack overflow question says I should download the org-checklist.el file but I can't find it anywhere. If anyone knows how to set up org-checklist or a viable alternative, I'd be really grateful
org-checklist.el is part of org-plus-contrib. You should be able to install it with package-manager: it is available from orgmode.org, so you have to add (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) to your list of archives.
Starting from emacs -q I was able to install it after evaluating these lines:
(require 'package)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
in the *scratch* buffer. Invoking package-list-packages showed org-plus-conrib as an available package and ix installed it (after I confirmed that I wanted to install it).
I was then able to load org-checklist with M-x load-library RET org-checklist RET.
Alternatively, you can just download the file from here and save it in some place that is found in your emacs's load-path, then say (require 'org-checklist).
Hope this helps.

cannot open load dired-details

I just installed the emacs package dired-details from inside emacs via
M-x package-list-packages
clicked on the package name and then install in the newly opened buffer.
Then I put those lines into my .emacs:
(require 'dired-details)
(setq-default dired-details-hidden-string ">---< ")
(dired-details-install)
When I restart emacs, I get the following error:
File error: Cannot open load file, dired-details
The interesting thing is, that when I mark the code region above and apply
M-x eval-region
everything works as expected.
emacs --version
>> GNU Emacs 24.3.1
package version:
dired-details-20130328.1119
Packages you installed with package.el need to be initialized if you want to access them during emacs initialization.
Add the line
(package-initialize)
to the very beginning of your .emacs .
Also follow phil's recommendation and see the variable
package-enable-at-startup

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

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.

Unable to compile Emacs auto-complete. Dependency on popup

I just git cloned auto-complete from GitHub. When I typed
make
I got:
emacs -Q -L . -batch -f batch-byte-compile auto-complete.el auto-complete-config.el
In toplevel form:
auto-complete.el:49:1:Error: Cannot open load file: popup
In toplevel form:
auto-complete-config.el:31:1:Error: Cannot open load file: popup
make: *** [byte-compile] Error 1
I didn't see anything in the auto-complete documentation that says that I have to install popup. I don't remember running into this problem before. Is this a new dependency? Is popup a package that is required by auto-complete?
If you use Emacs 24 (which you probably should by now) you can use the command M-x package-install and install auto-complete through there. This will install it correctly and is the best method of installing packages.
popup.el should have been included with your copy of auto-complete though, if not check here https://github.com/auto-complete/popup-el to get the appropriate copy.
To enable packages you can add something like this to your .emacs:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(setq url-http-attempt-keepalives nil)
The last line is simply to keep the downloads of large packages from timing out sometimes.
Had the same problem than you did, find you post struglgle a little before to find why it wasn't working: I had forgot to initate the submodules... reason why Make wasn't finding popup and crashing
so to solve it, go in your autocomplete repo and run
git submodule update --init
this will build the three lib you need to compile autocomplete

Emacs (Cocoa Emacs) vs Aquamacs for running Clojure on Mac OS X

I used Aquamacs so far, and I need to install and run Clojure using SLIME. I googled to get some way to use Clojure on SLIME of Aquamacs, but without success.
Questions
Is it possible to install Clojure on Aquamacs? Or, can you guess why Clojure on Aquamacs doesn't work?
Is it normal that Emacs and Aquamacs can't share the same ELPA?
Is it possible to use ELPA to install Conjure on Emacs/Aquamacs?
I was told that one can use 'lein swank' to run as a server, do you know how to do that?
Sequences that I tried (and half succeeded)
I tried with Mac OS X Emacs, and by following the steps I could make it work. I mean, I could run Clojure with SLIME.
Emacs for Mac OS X
Step 1) Install ESK.
Git clone and copy all the files into the .emacs.d directory
Add the following code to .emacs and relaunch
(when
(load
(expand-file-name "~/.emacs.d/package.el"))
(package-initialize))
Step2) Install using ELPA
M-x package-list-packages to select packages
Install
clojure-mode, clojure-test-mode
slime, slime-repl
swank-clojure
M-x slime to install the clojure
Add the following code to .emacs and relaunch
;; clojure mode
(add-to-list 'load-path "/Users/smcho/.emacs.d/elpa/clojure-mode-1.7.1")
(require 'clojure-mode-autoloads)
(add-to-list 'load-path "/Users/smcho/.emacs.d/elpa/clojure-test-mode-1.4")
(require 'clojure-test-mode-autoloads)
;; slime
;(setq inferior-lisp-program "/Users/smcho/bin/clojure")
(add-to-list 'load-path "/Users/smcho/.emacs.d/elpa/slime-20100404")
(require 'slime-autoloads)
(add-to-list 'load-path "/Users/smcho/.emacs.d/elpa/slime-repl-20100404")
(require 'slime-repl-autoloads)
;; swank-clojure
(add-to-list 'load-path "/Users/smcho/.emacs.d/elpa/swank-clojure-1.1.0")
(require 'slime-repl-autoloads)
Aquamacs
Now I could use Clojure on Emacs, I tried the same(or very similar) method to run Clojure on Aquamacs once more.
Step 1) Install ESK for Aquamacs
Copy the files to ~/Library/Preference/Aquamacs Emacs
Modify "~/Library/Preferences/Aquamacs Emacs/Preferences.el" to add the following
(setq kitfiles-dir (concat (file-name-directory
(or (buffer-file-name) load-file-name)) "/aquamacs-emacs-starter-kit"))
; set up our various directories to load
(add-to-list 'load-path kitfiles-dir)
(require 'init)
Step2)
* Follow the same step as before to install all the (same) packages, but "M-x slime" gives me the following error message. "Symbol's function definition is void: define-slime-contrib"
ELPA
I tried to combine the packages from Emacs and Aquamacs, but they don't combine. I thought I could use the ELPA itself, not from the ESK to make it shared.
The result was not good, as ELPA couldn't download the swank-conjure package.
Success - Running Aquamacs/Clojure with 'lein swank'.
Please refer to this.
Aquamacs most definitely works with Clojure, since the author of Clojure uses it. However, I use Emacs, and after you perform the steps above in the Emacs section, I recommend checking out labrepl,
http://github.com/relevance/labrepl
If you don't have leiningen, the link to get and install it is in the instructions of the labrepl readme file. I found it extremely helpful when first learning how to set up an environment for Clojure programming. You can take apart the project.clj file in labrepl and piece together how it works pretty easily. Not to mention the lessons and training in the built in web application that comes with labrepl.
If you want to use lein swank instead:
Make sure you have leiningen installed. In your project.clj dev dependencies you want to have an entry like this:
[leiningen/lein-swank "1.1.0"]
http://clojars.org/leiningen/lein-swank
Then after you've done lein deps you should be able to run lein swank and then from within Emacs run M-x slime-connect and just press enter through the defaults.
If you're going to go this route, here is the link directly to leiningen so you can skip the labrepl repository: http://github.com/technomancy/leiningen
I found this the easiest setup for the latest version of everything. Here's a quick summary where I"m assuming you have leiningen installed.
Install the swank-clojure plugin
$ lein plugin install swank-clojure 1.3.2
Create your clojure project
$ lein new test-project
$ cd test-project
$ lein deps
Then open one of the clojure files from your project in emacs and run clojure-jack-in
M-x clojure-jack-in
You are now in a slime buffer with clojure and the dependencies for your project loaded.
Paul Barry gives an lecture how to use Aquamacs and Clojure.
It's simple as you can add this code to the .emacs file,
(add-to-list 'load-path "~/clojure/clojure-mode")
(setq inferior-lisp-program "/Users/smcho/bin/clj")
(require 'clojure-mode)
(setq auto-mode-alist
(cons '("\\.clj\\'" . clojure-mode)
auto-mode-alist))
(add-hook 'clojure-mode-hook
(lambda ()
(define-key clojure-mode-map "\C-c\C-e" 'lisp-eval-last-sexp)))
I could run 'M-x clojure-mode', and C-c C-z for REPL.
And as is asked and answered in Running Clojure and other Lisp at the same time on Emacs, I could use both Clojure/Lisp on Aquamacs.