Move paradox to spacemacs layer

This commit is contained in:
syl20bnr 2014-12-02 23:41:06 -05:00
parent 21a4812b06
commit 81d0694497
5 changed files with 93 additions and 96 deletions

View File

@ -32,6 +32,8 @@
- [Excluding packages](#excluding-packages)
- [Hooks](#hooks)
- [Custom variables](#custom-variables)
- [Using the package list buffer](#using-the-package-list-buffer)
- [Update all the packages](#update-all-the-packages)
- [Main principles](#main-principles)
- [Evil](#evil)
- [States](#states)
@ -431,6 +433,54 @@ Custom variables configuration from `M-x customize-group` which are
automatically saved by Emacs are stored at the end of your `~/.spacemacs`
file.
# Using the package list buffer
The package list buffer is where you can selectively update one or all
packages installed in your configuration as well as browse for all
available packages in the different Elpa repositories.
`Spacemacs` replaces the default package list buffer with [Paradox][].
Paradox enhances the package list buffer with better feedbacks, new
filters and Github information like the number of stars. Optionally you
can also star packages directly in the buffer.
**Important Note** Don't install new packages from the package list
buffer. If those packages are not referenced in a configuration layer
then `Spacemacs` will treat them as orphans during the next start of
Emacs and they will be deleted.
Key Binding | Description
---------------------|------------------------------------------------------------
<kbd>/</kbd> | evil-search
<kbd>f k</kbd> | filter by keywords
<kbd>f r</kbd> | filter by regexp
<kbd>f u</kbd> | display only installed package with updates available
<kbd>h</kbd> | go left
<kbd>H</kbd> | show help (not accurate)
<kbd>j</kbd> | go down
<kbd>k</kbd> | go up
<kbd>l</kbd> | go right
<kbd>L</kbd> | show last commits
<kbd>n</kbd> | next search occurrence
<kbd>N</kbd> | previous search occurrence
<kbd>o</kbd> | open package homepage
<kbd>r</kbd> | refresh
<kbd>S P</kbd> | sort by package name
<kbd>S S</kbd> | sort by status (installed, available, etc...)
<kbd>S *</kbd> | sort by Github stars
<kbd>v</kbd> | `visual state`
<kbd>V</kbd> | `visual-line state`
<kbd>x</kbd> | execute (action flags)
## Update all the packages
To update all the buffers:
- open paradox: <kbd>SPC : a P</kbd>
- filter packages (optional): <kbd>f u</kbd>
- update all: <kbd>U x y</kbd>
When asked for old packages deletion hit `y`.
# Main principles
## Evil

View File

@ -100,10 +100,11 @@ For now the update of `Spacemacs` is manual.
1) It is important to _first_ update the Emacs packages. In Emacs:
```
<SPC> : package-list-packages RET U x RET
<SPC> a P <wait> U x y <wait> y
```
When asked for old packages deletion enter `y`.
For more information about the package list buffer refer to
[Using the package list buffer][using_package_buf] of the documentation.
2) Close Emacs and update the git repository:
@ -211,6 +212,7 @@ the quick start guide [here](https://github.com/syl20bnr/spacemacs#configuration
[config]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#configuration-layers
[dotfile]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#dotfile-configuration
[manage_config]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#managing-private-configuration-layers
[using_package_buf]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#using-the-package-list-buffer
[achievements]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#achievements
[troubleshoot]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#troubleshoot
[contrib layers]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#using-configuration-layers

View File

@ -1,43 +0,0 @@
# Paradox
This contrib layer switches the old list-packages for the more feature
rich Paradox package. you can find more info
[here](https://github.com/Bruce-Connor/paradox). Important this will
override your old `list-packages`.
## Usage
You can do `SPC a P` to open paradox-list-packages. Sad part is that
for now you can only swap to evil-emacs-state `C-z` and navigate with
n and p, other helpful tips show when you press `h`. Refer to the
github page of the package for more info.
## Repo stars
To be able to star packages you have to create a github
[token](https://github.com/settings/tokens/new) and only add Read
permissions to your public repos then you set it in your
configuration files like this:
```elisp
(setq paradox-github-token "<replace your token here>")
```
### OR
If you are feeling like so, create a .authinfo.gpg file in your home
directory. (With Emacs, obviously... `C-x C-f ~/.authinfo.gpg RET`).
The contents of this file follow
[netrc guidelines](http://www.gnu.org/software/emacs/manual/html_node/auth/Help-for-users.html).
You should have a file like this:
```
machine github.com user paradox password <here goes your token without quotes> port paradox
```
And then proceed to save that buffer. Just going for `OK` in the pop up
menu is OK. Enter your super secure password and now you have your
GitHub token being accesed securely ( even though you only gave
permissions to read your public repos, I'm sure I'll find another use
for this code later)

View File

@ -1,51 +0,0 @@
(defvar paradox-packages
'(
paradox
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defvar paradox-excluded-packages '()
"List of packages to exclude.")
;; For each package, define a function paradox/init-<package-paradox>
;;
(defun paradox/init-paradox ()
(use-package paradox
:defer t
:init
(progn
(defun spacemacs/paradox-list-packages ()
"Load depdendencies for auth and open the package list."
(interactive)
(require 'epa-file)
(require 'auth-source)
(when (and (not (boundp 'paradox-github-token))
(file-exists-p "~/.authinfo.gpg"))
(let ((authinfo-result (car (auth-source-search
:max 1
:host "github.com"
:port "paradox"
:user "paradox"
:require '(:secret)))))
(let ((paradox-token (plist-get authinfo-result :secret)))
(setq paradox-github-token (if (functionp paradox-token)
(funcall paradox-token)
paradox-token)))))
(paradox-list-packages nil))
(add-to-list 'evil-emacs-state-modes 'paradox-menu-mode)
(spacemacs|evilify paradox-menu-mode-map
"H" 'paradox-menu-quick-help
"J" 'paradox-next-describe
"K" 'paradox-previous-describe
"L" 'paradox-menu-view-commit-list
"o" 'paradox-menu-visit-homepage)
(evil-leader/set-key
"aP" 'spacemacs/paradox-list-packages))
:config
(spacemacs/activate-evil-leader-for-map 'paradox-menu-mode-map)
))

View File

@ -88,6 +88,7 @@
;; org-trello
p4
page-break-lines
paradox
popup
popwin
powerline
@ -1517,6 +1518,44 @@ determine the state to enable when escaping from the insert state.")
(global-page-break-lines-mode t)
(spacemacs//hide-lighter page-break-lines-mode)))
(defun spacemacs/init-paradox ()
(use-package paradox
:defer t
:init
(progn
(defun spacemacs/paradox-list-packages ()
"Load depdendencies for auth and open the package list."
(interactive)
(require 'epa-file)
(require 'auth-source)
(when (and (not (boundp 'paradox-github-token))
(file-exists-p "~/.authinfo.gpg"))
(let ((authinfo-result (car (auth-source-search
:max 1
:host "github.com"
:port "paradox"
:user "paradox"
:require '(:secret)))))
(let ((paradox-token (plist-get authinfo-result :secret)))
(setq paradox-github-token (if (functionp paradox-token)
(funcall paradox-token)
paradox-token)))))
(paradox-list-packages nil))
(add-to-list 'evil-emacs-state-modes 'paradox-menu-mode)
(spacemacs|evilify paradox-menu-mode-map
"H" 'paradox-menu-quick-help
"J" 'paradox-next-describe
"K" 'paradox-previous-describe
"L" 'paradox-menu-view-commit-list
"o" 'paradox-menu-visit-homepage)
(evil-leader/set-key
"aP" 'spacemacs/paradox-list-packages))
:config
(spacemacs/activate-evil-leader-for-map 'paradox-menu-mode-map)
))
(defun spacemacs/init-popup ()
(use-package popup
:defer t))