summaryrefslogtreecommitdiff
path: root/lisp/use-package
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Cosmetic changes to use-package-ensure-elpaJonas Bernoulli2017-10-131-8/+9
| | |
* | | Don't use with-demoted-errors in use-package-ensure-elpaJonas Bernoulli2017-10-131-9/+12
| | | | | | | | | | | | | | | It expects a literal string as argument at macro-expansion time, but we need to construct the message.
* | | Merge pull request from raxod502/feat/fix-install-deferredJohn Wiegley2017-08-121-5/+6
|\ \ \ | |_|/ |/| | | | | Fix bug in use-package-install-deferred-package GitHub-reference: https://github.com/jwiegley/use-package/issues/479
| * | Fix bug in use-package-install-deferred-packageRadon Rosborough2017-06-301-5/+6
| | | | | | | | | | | | | | | | | | Previously, deferred installation didn't work because I didn't convert the result of a `completing-read' back from a string to a symbol, which meant the hash-table lookup failed.
* | | Document :delight in the doc string and READMEJoe Wreschnig2017-07-101-0/+1
| |/ |/|
* | Allow :major as the third argument in :delight callsJoe Wreschnig2017-07-021-5/+10
| |
* | Allow multiple :delight arguments, or omitting the mode. ()Joe Wreschnig2017-07-021-13/+38
|/ | | | | | | | | | | | | This allows using forms such as (use-package foo :delight) ;; => (delight 'foo-mode) (use-package foo :delight " f") ;; => (delight 'foo-mode " f") (use-package foo :delight (a-mode) (b-mode " b") ;; => (delight 'a-mode) (delight 'b-mode " b") This brings support for `:delight` in line with `:diminish`. GitHub-reference: https://github.com/jwiegley/use-package/issues/477
* Add `:magic` and `:magic-fallback` keywords (issue)Joe Wreschnig2017-06-151-61/+81
| | | | | | | | These keywords work equivalently to `:mode` or `:interpreter`, but for `magic-mode-alist` and `magic-fallback-mode-alist`. The handler function implementation is now passed a list to add to, and shared by all four of them. GitHub-reference: https://github.com/jwiegley/use-package/issues/469
* Protect against errors during package installDavid Leatherman2017-05-221-1/+1
| | | | | | | | | If the network is missing and there is a new use-package with :ensure, startup would fail part of the way through due package.el being unable to reach the package repo. This will catch that error and report it while allowing startup to continue. Copyright-paperwork-exempt: yes
* Fix quoting error in failed autoload messageRadon Rosborough2017-05-071-1/+1
|
* Make use-package-normalize-value handle nil betterRadon Rosborough2017-04-041-1/+2
| | | | | | | | | | | | The previous version of `use-package-normalize-value', when passed nil, would return the list (symbol-value (quote nil)). This meant that keywords which used `use-package-normalize-value' or the higher-level normalizer `use-package-normalize-test' would get a non-nil argument (i.e. the above list) even when the user specified nil to the package. This had the concrete impact of making it so that :defer-install nil was treated as :defer-install t.
* Add comment explaining keyword-argument patchRadon Rosborough2017-04-031-0/+19
|
* Don't mutilate keyword arguments in :bindRadon Rosborough2017-04-021-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parsing logic in `use-package-normalize-pairs' is not designed to deal with keyword arguments. However, `use-package-normalize-pairs' is used to process the arguments to :bind, which can include keyword arguments. These keyword arguments are supposed to be passed untouched to the underlying `bind-keys' function, but there is a clause in `use-package-normalize-pairs' that replaces lists with their first element. Thus an invocation like: (use-package company :bind (:map company-active-map :filter (company-explicit-action-p) ("RET" . company-complete-selection))) Generates code like this: (bind-keys :map company-active-map :filter company-explicit-action-p ("RET" . company-complete-selection)) Which generates an error since `company-explicit-action-p' is now being referenced as a variable rather than a function. The proper solution is to refactor the logic that goes into parsing uses of :bind, but this commit adds a temporary patch to eliminate the above problem, while trying to be as reverse-compatible as possible. In particular it just inhibits the list-to-first-element transformation when the previous element processed was a keyword.
* Merge pull request from raxod502/fix-afterJohn Wiegley2017-03-271-1/+1
|\ | | | | | | Fix :after keyword GitHub-reference: https://github.com/jwiegley/use-package/issues/439
| * Fix :after keywordRadon Rosborough2017-03-191-1/+1
| | | | | | | | | | | | | | | | Commit [1] broke the functionality of :after (see [2]) due to an extraneous quote being added. [1]: bd2afa53c7580d23ed8008267b80e1834b6e6600 [2]: https://github.com/jwiegley/use-package/pull/433#issuecomment-287606553
* | Add use-package-always-defer-installRadon Rosborough2017-03-261-1/+9
|/ | | | See https://github.com/jwiegley/use-package/pull/433#issuecomment-289317875
* Merge remote-tracking branch 'origin/master' into defer-installRadon Rosborough2017-03-181-44/+105
|\ | | | | | | Resolve merge conflicts.
| * Revert "Return `t' after calling `eval-after-load'"John Wiegley2017-02-181-4/+2
| | | | | | | | This reverts commit 87a8ff6d693f3cc79ea423ca8c8e0a60b0bc596c.
| * Support multiple symbols passed to :afterJohn Wiegley2017-02-161-10/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following expressions are now permitted: foo ; load after foo is loaded foo bar ; load after both foo and bar are loaded :all foo bar ; same as previous :any foo bar ; load after either foo or bar is loaded :any (:all foo bar) baz ; more complex combinations... :any (:all foo bar) (:all baz wow) :all (:any foo bar) (:any baz wow) Fixes https://github.com/jwiegley/use-package/issues/283
| * :mode and :interpreter can now accept (rx ...) formsJohn Wiegley2017-02-161-1/+28
| | | | | | | | Fixes https://github.com/jwiegley/use-package/issues/204
| * Return `t' after calling `eval-after-load'John Wiegley2017-02-161-2/+4
| | | | | | | | Fixes https://github.com/jwiegley/use-package/issues/174
| * Add autoload cookie for use-package-autoload-keymapJohn Wiegley2017-02-161-0/+1
| | | | | | | | Fixes https://github.com/jwiegley/use-package/issues/337
| * Merge remote-tracking branch 'origin/pr/349'John Wiegley2017-02-161-25/+24
| |\
| | * Don't allow implicit package name arg for bindersNoam Postavsky2016-10-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's unlikely that (use-package foopkg :bind "<some-key>") intendes to bind <some-key> to 'foopkg command.
| | * Don't allow nil as a mode functionNoam Postavsky2016-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | This means (use-package foopkg :mode (".foo")) will add (".foo" . foopkg) into auto-mode-alist instead of the broken (".foo" . nil), this is more consistent with the behaviour of (use-package foopkg :mode (".foo" ".bar")).
| | * Refactor pair normalizers; add tests for themNoam Postavsky2016-10-311-25/+20
| | | | | | | | | | | | | | | | | | This is not a pure refactoring, it also fixes a bug where :bind ([keysym] . "string") would actually bind keysym to nil (i.e., unbind it). It now binds to "string" as expected.
* | | Update docstring, installation prompt messageRadon Rosborough2017-03-181-11/+11
| | |
* | | Various improvements for deferred installationRadon Rosborough2017-03-181-53/+110
| | |
* | | Get :defer-install completely working, in theoryRadon Rosborough2017-03-081-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A quoting error has been fixed in `use-package-handler/:defer'. * `use-package-install-deferred-package' has been updated to return t if the package was actually installed, and nil otherwise. * The fake autoloads generated during deferred installation are doctored so Emacs does not think they were defined in the user's init-file. * The docstrings of the fake autoloads have been improved. * Arguments and interactivity are now correctly passed to the autoloaded function. * The autoload now skips requiring the feature and calling the original function if the user declines to install the package. This prevents unprofessional errors.
* | | Improve deferred installation mechanismRadon Rosborough2017-03-081-32/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This time around, I've gotten rid of the advice on `require' (that was never going to work) and instead made `use-package' try to handle loading the package at the appropriate time. In particular, when deferred installation is active, all the autoloads generated by `use-package' are not regular autoloads, but regular functions that will install the relevant package, require the relevant feature, and only then call the newly defined (autoloaded) function. Some smarter logic has been added to make sure things like `:demand' play nicely with the autoloading system; see the extensive comment in `use-package-handler/:defer-install' for more information on how that works. There was a section in `use-package-install-deferred-package' which referred to a nonexistent variable `use-package--deferred-features'; that has been removed. There is now, in addition to `use-package-ensure-function', a new variable called `use-package-pre-ensure-function'. This is intended for use by package managers which, unlike package.el, activate autoloads package-by-package instead of all at once. Even if a package is marked for deferred installation, the user would likely want its autoloads activated immediately *if* it was already installed. The logic for doing that can now be put in `use-package-pre-ensure-function'.
* | | Merge branch 'generalized-ensure' into defer-installRadon Rosborough2017-03-081-2/+6
|\ \ \
| * | | Update docstring for use-package-ensure-functionRadon Rosborough2017-03-081-2/+6
| | | | | | | | | | | | | | | | Now it properly reflects the API changes recently made.
* | | | First cut at :defer-install keywordRadon Rosborough2017-03-081-4/+81
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new keyword, if provided along with a non-nil value, causes the action of :ensure to be deferred until "necessary". Package installation can be triggered by the user calling the new interactive function `use-package-install-deferred-package', or by the feature declared by the `use-package' form being required. This latter behavior seems to be the simplest way to make sure that package installation actually takes place when it needs to, but it requires that an advice be added to `require', which may be considered overly intrusive. (Also, it's generally considered bad practice for functions in Emacs to put advice on other functions in Emacs.) Thus it may make sense to add an option or function to explicitly enable this behavior, if there does not turn out to be a better way to accomplish deferred installation. Documentation has not been updated to reflect :defer-install yet.
* / / Extend capabilities of use-package-ensure-functionRadon Rosborough2017-03-081-15/+17
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify the expected API of `use-package-ensure-function' so that it is passed three arguments: the name of the package declared in the `use-package' form; the argument passed to `:ensure'; and the current `state' plist created by previous handlers. (Previously, it was only given a single argument, which was the argument passed to `:ensure', or the name of the package declared in the `use-package' form, if the former was `t'. This allows for more flexibility in the capabilities of the `use-package-ensure-function' implementation. For example, its behavior can change depending on the values of other keywords, if those keywords modify the `state' plist appropriately.
* | Merge pull request from justbur/find-formJohn Wiegley2017-02-131-0/+41
|\ \ | | | | | | | | | Add function use-package-jump-to-package-form GitHub-reference: https://github.com/jwiegley/use-package/issues/359
| * | Add function use-package-jump-to-package-formJustin Burkett2016-06-221-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt at resolving https://github.com/jwiegley/use-package/issues/329. The new interactive function use-package-jump-to-package-form will prompt with a completing read of all known packages. After selecting a package, use-package-find-require searches load-history to see where the package was required and then I attempt to find the correct use-package form using use-package-form-regexp. It will fail if the use-package form you are looking for did not actually load the package. For example it could be something that is a dependency of a library that was already loaded. In some sense this is a feature because it is helpful to know that the library was already loaded when your use-package form was encountered. It will also fail if your use-package declaration doesn't match the regexp used, but this is easily adjusted.
* | | Merge pull request from justbur/imenu3John Wiegley2017-02-131-13/+11
|\ \ \ | | | | | | | | | | | | Improve imenu support GitHub-reference: https://github.com/jwiegley/use-package/issues/356
| * | | Improve imenu supportJustin Burkett2016-06-151-13/+11
| |/ / | | | | | | | | | | | | | | | Instead of using defvar for lisp-mode-symbol-regexp, wait until lisp-mode is loaded and check for its existence to avoid making use-package the place where this variable is declared.
* | | Fix use-package-defaultsRadon Rosborough2017-02-131-9/+5
| | | | | | | | | | | | | | | | | | | | | This patch should address issues https://github.com/jwiegley/use-package/issues/428 and https://github.com/jwiegley/use-package/issues/429. See https://github.com/jwiegley/use-package/issues/426 for discussion. In brief, the issue was that use-package-sort-keywords was not applied when the predicates in use-package-defaults did not return true, when it should have been applied unconditionally.
* | | Unrevert "Add use-package-defaults"Radon Rosborough2017-02-131-20/+32
| | | | | | | | | | | | This reverts commit 013425edeb1829f5d21514f77d41763347538b14.
* | | Revert "Add use-package-defaults"John Wiegley2017-02-131-32/+20
| | | | | | | | | | | | This reverts commit 3dec23c0860ad297436b9b71b221491ae3790cce.
* | | Add use-package-defaultsRadon Rosborough2017-01-161-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the :config, :ensure, and :pin keywords had default values (dependent on the values of the use-package-always-ensure and use-package-always-pin). This change allows the user to customize the default values used for those keywords, and add default values for their own keywords in a non-hacky way. This functionality would be useful for (as an example) the quelpa-use-package package, which needs to use an advice to override the functionality of :ensure. The same problem prevents adding a use-package-always-quelpa variable in any reasonable way, without a way to customize the default values of keywords.
* | | Add use-package-ensure-functionRadon Rosborough2017-01-151-3/+13
| | | | | | | | | | | | | | | This allows the user to customize the :ensure keyword by using a different package manager than package.el.
* | | Add new customization option `use-package-always-demand`John Wiegley2016-12-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | This is equivalent to adding `:demand t` to all `use-package` declarations, and has the same semantics as doing so (meaning it can be overridden locally using `:defer t` in a declaration). Fixes https://github.com/jwiegley/use-package/issues/423
* | | Merge pull request from basil-conto/prefaceJohn Wiegley2016-12-181-1/+1
|\ \ \ | | | | | | | | | | | | Increase :preface priority GitHub-reference: https://github.com/jwiegley/use-package/issues/418
| * | | Increase :preface priorityBasil L. Contovounesios2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Reconcile order of `use-package-keywords' with the README description of `:preface' as occurring before everything but `:disabled'.
* | | | Merge pull request from tarsius/outlineJohn Wiegley2016-12-182-25/+30
|\ \ \ \ | | | | | | | | | | | | | | | Support outline-minor-mode GitHub-reference: https://github.com/jwiegley/use-package/issues/420
| * | | | Support outline-minor-modeJonas Bernoulli2016-12-172-25/+30
| |/ / / | | | | | | | | | | | | | | | | | | | | In "use-package.el" prefix headings with ";;;" instead of just ";;". In "bind-key.el" add the missing ";;; Code:" heading. In both libraries set `outline-regexp' to an appropriate value.
* / / / Delay decision whether to use eval-after-load until run-timeJonas Bernoulli2016-12-181-3/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just because a keymap variable is bound at macro-expansion-time doesn't mean that it must be bound at run-time too. Change `bind-keys-form', which is used by `bind-keys' and other macros, to return a form which delays the decision on whether to wrap the binding forms with `eval-after-load' until run-time. Fixes https://github.com/jwiegley/use-package/issues/378.
* | / Declare package-read-all-archive-contentsPhilipp Stephani2016-10-311-0/+1
| |/ |/| | | | | Fixes https://github.com/jwiegley/use-package/issues/398