2012-01-21 03:05:56 +00:00
%% MELPA
2012-01-25 17:33:47 +00:00
[ [Packages](#current-list-of-packages) ]
[ [Installing](#installing) ]
[ [Known Issues](#known-issues) ]
[ [Updating Packages](#updating-packages) ]
[ [Development](#development) ]
2012-01-21 03:05:56 +00:00
*MELPA* or *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp Package Repository* if you're not into the whole brevity thing.
> a repository for development versions of Emacs packages (hot from the repo).
2012-01-22 19:57:48 +00:00
**Last Update:** *<%= Time.now.strftime("%Y.%m.%d %H:%M") %>*
2012-01-21 03:05:56 +00:00
2012-01-25 17:33:47 +00:00
## Current List of Packages
2012-01-21 03:05:56 +00:00
2012-01-22 19:57:48 +00:00
<%
def parse str
# credit to: http://stackoverflow.com/q/3128406/154508
2012-01-22 21:31:28 +00:00
tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\-\_\+]+/)
2012-01-21 22:11:17 +00:00
2012-01-22 19:57:48 +00:00
stack = [[]]
2012-01-21 22:11:17 +00:00
2012-01-22 19:57:48 +00:00
tokens.each do |tok|
case tok
2012-01-21 22:11:17 +00:00
when "("
2012-01-22 19:57:48 +00:00
stack << []
2012-01-21 22:11:17 +00:00
when ")"
2012-01-22 19:57:48 +00:00
stack[-2] << stack.pop
2012-01-21 22:11:17 +00:00
else
2012-01-22 19:57:48 +00:00
stack[-1] << tok
end
2012-01-21 22:11:17 +00:00
end
2012-01-22 19:57:48 +00:00
return stack[-1][-1]
2012-01-21 22:11:17 +00:00
end
2012-01-22 19:57:48 +00:00
headers = ["Package", "Version", "Description"]
data = parse(File.open("../packages/archive-contents").read)[1..-1]
data.map! do |row|
[row[0], row[1][0], row[3..-2].join(" ")]
2012-01-22 20:28:13 +00:00
end
data.sort!
2012-01-22 19:57:48 +00:00
colwidth = [0,0,0]
data.map do |row|
row.to_enum(:each_with_index).map do |e,i|
colwidth[i] = [colwidth[i], e.length].max
end
end
%>
<%=
headers.to_enum(:each_with_index).map{
|h,i| h + " "*(colwidth[i]-h.length) }.join(" ")
2012-01-21 22:11:17 +00:00
%>
2012-01-22 19:57:48 +00:00
<%= colwidth.map{ |w| "-"*w }.join(" ") %>
<%=
data.map{ |row|
row.to_enum(:each_with_index).map{ |c,i|
c + " "*(colwidth[i]-c.length)
}.join(" ")
}.join("\n")
%>
2012-01-21 03:05:56 +00:00
## Installing
To add the repository put this before the call to `package-initialize`
in your `init.el` file.
2012-01-25 23:21:24 +00:00
<!-- <script src="https://gist.github.com/1679158.js"> </script> -->
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
2012-01-21 03:05:56 +00:00
Please read about [known issues](#known-issues) below before
attempting to install multiple packages at once.
2012-01-28 04:04:33 +00:00
### Customizations
There is currently no way in `package.el` to exclude or include versions. So to remedy this I ahve created a package that will allow you to enable only certain packages or exclude certain packages. You can install the package by pasting this into yoru `*scratch*` buffer and evaluating it.
(progn
(switch-to-buffer
(url-retrieve-synchronously
"https://raw.github.com/milkypostman/melpa/master/melpa.el"))
(package-install-from-buffer (package-buffer-info) 'single))
You can then customize two variables:
`melpa-package-enable`
: List of MELPA packages to enable. Empty list enables all packages.
`melpa-package-exclude`
: List of MELPA package to exclude. This list trumps those specified in `melpa-package-enable`.
2012-01-21 03:05:56 +00:00
## Known Issues
Due to the way the HTTP routing works on my provider, the HTTP/1.1
connection will time out for long package installs -- where the
package is large and takes a while to compile -- like *magit* or *evil*.
2012-01-25 23:21:24 +00:00
<!-- <script src="https://gist.github.com/1679208.js"> </script> -->
(setq url-http-attempt-keepalives nil)
2012-01-21 03:05:56 +00:00
This makes things a tad more slow but means that the install completes
correctly. Otherwise the connection times out and the install goes haywire.
2012-01-25 22:42:59 +00:00
### Fixes for `package.el`
2012-01-28 04:04:33 +00:00
**Note:** *These fixes are included in the `melpa.el` package.*
2012-01-25 22:42:59 +00:00
There are a number of small bugs in Emacs24's `package.el`. First,
when installing dependencies, the packages were not getting
initialized. Second, the order for dependencies was coming out
backwards for what I needed. Both problems are
easily patched by some *advice*.
2012-01-25 23:21:24 +00:00
<!-- <script src="https://gist.github.com/1679232.js"> </script> -->
(defadvice package-compute-transaction
(before
package-compute-transaction-reverse (package-list requirements)
activate compile)
"reverse the requirements"
(setq requirements (reverse requirements))
(print requirements))
(defadvice package-download-tar
(after package-download-tar-initialize activate compile)
"initialize the package after compilation"
(package-initialize))
(defadvice package-download-single
(after package-download-single-initialize activate compile)
"initialize the package after compilation"
(package-initialize))
2012-01-25 22:42:59 +00:00
2012-01-21 03:05:56 +00:00
## Updating Packages
`package.el` now includes a mechanism to upgrade packages. After running `package-list-pacages`, type *u* (mark Upgradable packages) and then *x* (eXecute the installs and deletions). When it's done installing all the packages it will ask if you want to delete the obsolete packages and so you can hit *y* (Yes).
If you run into a problem installing or upgrading, you may need to go into your `~/.emacs.d/elpa/` directory and delete packages that are installed multiple times. This can happen when the install times out (see [Known Issues](#known-issues)).
## Development
[https://github.com/milkypostman/melpa](https://github.com/milkypostman/melpa)
Contributions are welcome. Currently, the builder only supports
packages using git, subversion, mercurial, and darcs. This covers
most of the packages that I am interested in.