[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: req-package
From: |
Alexander Shukaev |
Subject: |
Re: req-package |
Date: |
Thu, 13 Aug 2015 15:44:44 +0200 |
> Yes, sure. Sorry for late answer. Here is example. I configure clojure
> development environment with req-package(use-package)
>
> (req-package eldoc
> ;; this form call will download eldoc package from elpa or el-get as
> needed
>
> :commands eldoc
>
>
> -mode
> ;; this parameter delays loading of eldoc until eldo-mode function is
> called
>
> :init (prog
>
> n (add-h
>
> ook 'emacs-lisp-mode-hook (lambda () (eldoc-mode 1)))
> ;; add eldoc to emacs lisp mode
>
>
> (add-hook 'lisp-interaction-mode-hook (lambda () (eldoc-mode 1)))))
>
> ;; add eldoc to
> lisp based interaction modes
> modes
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> (req-package clojure-mode
>
> ;; this form call will download
> clojure-mode
> package from elpa or el-get as needed
> :mode (("clj\\'" . clojure-mo
>
> de)
> ;; this parameter delays loading of clojure-mode until
>
>
> ("cljs\\'" . clojure-mode)))
> ;; file with any of these extensions is loaded
>
>
> (req-package cider
>
> ;; this form call will download
> cider
> package from elpa or el-get as needed
> :require (clojure-m
>
> ode eldoc)
> ;; this parameters makes sure that this req-package form is evaluated
> after all of these packages are loaded
>
> :commands cider-mode
> ;; delay loading until cider-mode function is called
>
> :init (progn (add-hook 'clojure-mode-h
>
> ook #'cider-mode)
> ;; start cider in clojure mode
>
>
>
> (add-hook 'cider-mode-hook #'eldoc-mode)
> ;; start eldoc after cider setups some of its internal things and calls
> its hook
>
>
>
> (setq nrepl-log-messages t)))
> ;; some logging stuff
>
>
> (req-package-finish) ;; start loading
>
>
> This
> example may bit a bit hard to understand in concrete, but you may get an
> idea.
Hello Edward,
so, basically all that dance is to simply avoid writing
(with-eval-after-load 'closure-mode
(add-hook 'clojure-mode-hook #'cider-mode))
(with-eval-after-load 'eldoc
(add-hook 'cider-mode-hook #'eldoc-mode))
(while still using `use-package')? Besides, if I understand it
correctly, if `closure-mode', for example, would not be there (and not
downloaded from archives), then the whole configuration will fail?
- req-package, Edward Knyshov, 2015/08/11
- Re: req-package, Stefan Monnier, 2015/08/11
- Re: req-package, Edward Knyshov, 2015/08/13
- Re: req-package,
Alexander Shukaev <=
- Re: req-package, Edward Knyshov, 2015/08/13
- Re: req-package, Alexander Shukaev, 2015/08/13
- Re: req-package, Edward Knyshov, 2015/08/13
- Message not available
- Re: req-package, Stefan Monnier, 2015/08/13
- Re: req-package, Edward Knyshov, 2015/08/14
- Re: req-package, Edward Knyshov, 2015/08/14
- Message not available
- Re: req-package, Stefan Monnier, 2015/08/14
- Re: req-package, Alexander Shukaev, 2015/08/14
- Re: req-package, Edward Knyshov, 2015/08/14
- Re: req-package, Alexander Shukaev, 2015/08/14