This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/restructuredtext/packages.el
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00

67 lines
2.1 KiB
EmacsLisp

;;; packages.el --- rest layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: <wwguo@hiGDP>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst restructuredtext-packages
'(
auto-complete
(auto-complete-rst :requires auto-complete)
linum
(rst :location built-in)
(rst-directives :location local)
(rst-lists :location local)
flyspell
smartparens
yasnippet
))
(defun restructuredtext/post-init-auto-complete ()
(add-hook 'rst-mode-hook 'auto-complete-mode))
(defun restructuredtext/init-auto-complete-rst ()
(use-package auto-complete-rst
:commands (auto-complete-rst-add-sources
auto-complete-rst-init)
:init (spacemacs/add-to-hook 'rst-mode-hook '(auto-complete-rst-init
auto-complete-rst-add-sources))))
(defun restructuredtext/init-post-linum ()
;; important auto-complete work-around to be applied to make both linum
;; and auto-complete to work together
(when (configuration-layer/package-used-p 'auto-complete)
(add-hook 'rst-mode-hook 'ac-linum-workaround t)))
(defun restructuredtext/init-rst-directives ()
(use-package rst-directives))
(defun restructuredtext/init-rst-lists ()
(use-package rst-lists))
(defun restructuredtext/init-rst-sphinx ()
(use-package rst-sphinx))
(defun restructuredtext/init-rst ()
(use-package rst
:defer t
:config (add-hook 'rst-adjust-hook 'rst-toc-update)))
(defun restructuredtext/post-init-flyspell ()
(spell-checking/add-flyspell-hook 'rst-mode-hook)
;; important auto-complete work-around to be applied to make both flyspell
;; and auto-complete to work together
(when (configuration-layer/package-used-p 'auto-complete)
(add-hook 'rst-mode-hook 'ac-flyspell-workaround t)))
(defun restructuredtext/post-init-yasnippet ()
(add-hook 'rst-mode-hook 'spacemacs/load-yasnippet))
(defun restructuredtext/post-init-smartparens ()
(add-hook 'rst-mode-hook 'smartparens-mode))