Commit 190ab3cd authored by steckerhalter's avatar steckerhalter

init

parents
sudo: required
language: emacs-lisp
script:
./ci/run.sh
notifications:
email:
- quelpa@postmomentum.ch
- v.schneidermann@gmail.com
This diff is collapsed.
# quelpa-use-package.el
If you are using [use-package](https://github.com/jwiegley/use-package) (which can help to simplify your .emacs) you can use the `quelpa` handler provided by `quelpa-use-package.el`.
Assuming you have bootstrapped `quelpa` and installed `use-package` probably like this:
```cl
(quelpa '(use-package :fetcher github :repo "jwiegley/use-package" :files ("use-package.el")))
```
To use the `:quelpa` keyword with `use-package`, require the library:
```cl
(require 'quelpa-use-package)
```
then it's possible to call `use-package` with all kinds of arguments:
```cl
(use-package abc-mode :quelpa) ;installs abc-mode with quelpa
(use-package abc-mode :quelpa t) ;does the same
(use-package abc-mode :quelpa abc-mode) ;again... (if the package would have another name)
(use-package abc-mode :quelpa (:upgrade t)) ;passes upgrade parameter to quelpa
(use-package abc-mode :quelpa (abc-mode :fetcher github :repo "mkjunker/abc-mode")) ;uses recipe
(use-package abc-mode :quelpa ((abc-mode :fetcher github :repo "mkjunker/abc-mode") :upgrade t)) ;recipe with plist arguments
```
;; bootstrap quelpa
(package-initialize)
(unless (require 'quelpa nil t)
(with-temp-buffer
(url-insert-file-contents "https://raw.github.com/quelpa/quelpa/master/bootstrap.el")
(eval-buffer)))
;; install use-package
(quelpa '(use-package :fetcher github :repo "jwiegley/use-package" :files ("use-package.el")))
;; require the library
(add-to-list 'load-path travis-ci-dir)
(require 'quelpa-use-package)
;; test some installs
(use-package grandshell-theme :quelpa)
(use-package ipretty :quelpa t)
(use-package flx-ido :quelpa (:stable t))
(use-package flx-ido :quelpa ((flx-ido) :upgrade t))
(use-package git-modes :quelpa (git-modes :fetcher github :repo "magit/git-modes"))
(use-package git-timemachine :quelpa ((git-timemachine :fetcher github :repo "pidu/git-timemachine") :stable t))
(use-package git-timemachine :quelpa ((git-timemachine :fetcher github :repo "pidu/git-timemachine") :upgrade t))
#!/bin/bash -e
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
trap "rm -rf ~/.emacs.d/" EXIT
if [ "$USER" == "vagrant" ]; then
dir=/vagrant
else
dir="$PWD"
fi
if ! dpkg -l | grep python-software-properties; then
sudo apt-get update
sudo apt-get install -qq python-software-properties
fi
if ! grep cassou /etc/apt/sources.list.d/*; then
sudo add-apt-repository -y ppa:cassou/emacs
sudo apt-get update
fi
if ! dpkg -l | grep emacs24; then
sudo apt-get install -qq git mercurial subversion bzr cvs emacs24 emacs24-el emacs24-common-non-dfsg emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot
fi
emacs24 --batch --eval "(setq travis-ci-dir \"$dir\")" --load $dir/ci/.emacs
rm -rf ~/.emacs.d/
emacs-snapshot --batch --eval "(setq travis-ci-dir \"$dir\")" --load $dir/ci/.emacs
rm -rf ~/.emacs.d/
;;; quelpa-use-package.el --- quelpa handler for use-package
;; Copyright 2015, Steckerhalter
;; Author: steckerhalter
;; URL: https://github.com/quelpa/quelpa-use-package
;; Version: 0.0.1
;; Package-Requires: ((quelpa "0") (use-package "2"))
;; Keywords: package management elpa use-package
;; This file is not part of GNU Emacs.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; quelpa handler for `use-package'
;; See the the repo website for more info:
;; https://github.com/quelpa/quelpa-use-package
;;; Requirements:
;; `quelpa' and `use-package'
;;; Code:
(require 'cl-lib)
(require 'quelpa)
(require 'use-package)
(defvar quelpa-use-package-keyword :quelpa)
;; insert `:quelpa' keyword after `:disabled'
(defun quelpa-use-package-set-keyword ()
(unless (member quelpa-use-package-keyword use-package-keywords)
(setq use-package-keywords
(let* ((pos (cl-position :disabled use-package-keywords))
(head (cl-subseq use-package-keywords 0 (+ 1 pos)))
(tail (nthcdr (+ 1 pos) use-package-keywords)))
(append head (list quelpa-use-package-keyword) tail)))))
(defun use-package-normalize/:quelpa (name-symbol keyword args)
(let ((arg (car args)))
(pcase arg
((or `nil `t) (list name-symbol))
((pred symbolp) args)
((pred listp) (cond
((listp (car arg)) arg)
((string-match "^:" (symbol-name (car arg))) (cons name-symbol arg))
((symbolp (car arg)) arg)
((t nil))))
(_ nil))))
(defun use-package-handler/:quelpa (name-symbol keyword args rest state)
(let ((body (use-package-process-keywords name-symbol rest state)))
;; This happens at macro expansion time, not when the expanded code is
;; compiled or evaluated.
(when args
(quelpa-use-package-set-keyword)
(apply 'quelpa args))
body))
;; register keyword on require
(quelpa-use-package-set-keyword)
(provide 'quelpa-use-package)
;;; quelpa-use-package.el ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment