UsePackage

There are 2 distinct packages called ‘use-package’.

use-package: a package configuration macro

https://github.com/jwiegley/use-package - A use-package declaration for simplifying your .emacs

This use-package macro provides more concise ways to setup package autoloads, keybindings, and various mode configuration. The focus is on decreasing startup time by autoloading packages instead loading them on startup.

The use-package macro allows you to isolate package configuration in your .emacs file in a way that is both performance-oriented and, well, tidy. I created it because I have over 80 packages that I use in Emacs, and things were getting difficult to manage. Yet with this utility my total load time is around 2 seconds, with no loss of functionality!

use-package: autofetcher + configuration macro

There is another older (last edited 2007) use-package: Lisp:use-package.el. It is a combined installer and configurer, which defines an “autofetch” (like autoload, but downloading from the network – or other media) and also conveniently sets up various things it’s useful to have on eval-after-load forms.

Its entry point is the macro use-package; you might also want to use autofetch in its own right.

This lets you write package descriptions such as:

    (use-package vm
		 nil                        ; download to default directory
		 (nil                       ; use default getter function
		  "http://www.seanet.com/~kylemonger/vm/vm-7.19.tar.gz"
		  ;; after-download form:
		  (shell-command "cd vm-7.19; make"))
		 ;; configuration arg to use-package:
		 ("$COMMON/emacs/email"   ; string means directory for load-path
		  (require 'jcgs-vm-stuff)  ; can add your own aux stuff
		  ([ C-f11 ] . js-vm-get-mail) ; key definitions
		  ([ M-C-f11 ] . vm-continue-composing-message)
		  ;; autoloads/autofetches
		  (vm "vm" "Run the VM mail reader" t)
		  ;; things that look like auto-mode-alist entries are
		  ("~/vm" . vm-mode)
		  ("$COMMON/vm" . vm-mode))
		 ;; remaining args to use-package are eval-after-load forms
		 (setq vm-mutable-frames nil
		       bbdb-completion-type 'primary-or-name
		       read-mail-command 'vm
		       vm-folder-directory (if (file-directory-p
						(expand-file-name "~/vm/"))
					       (expand-file-name "~/vm/")
					     (substitute-in-file-name "$COMMON/vm/"))
		       vm-primary-inbox (expand-file-name "john" vm-folder-directory)))

I find this a handy way for keeping together definitions of how to get a package, with how to configure it; it’s particularly nice when I arrive on an unfamiliar machine, and can load one startup file from the web or my USB key drive, and have it pull the rest across as I use it for the first time on that machine.

The next enhancement will probably be indirect URLs, where it searches the page at the specified URL, for links whose anchor text matches a particular pattern – intended for giving it a downloads page such as on SourceForge, and picking the URL from that. I’ll probably add SHA1/ MD5 verirfication, too.

See also el-get – dim