Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Conversation

@npostavs
Copy link
Contributor

Following up on the idea raised in #50, I have implemented implicit quasiquoting for all non-sexp use-package arguments.

@dudebout's example then becomes

(setq my-bind-for-magit '("C-c i" . magit-status))
(use-package magit
  :bind ,my-bind-for-magit)

and also allows for @DarwinAwardWinner's:

(use-package magit
  :bind ,(get-bindlist-for-package 'magit))

and even fancier things which can be seen in the commit message.

Comments welcome.

Note that I didn't keep compatibility with @dudebout's auto eval of symbols, since it doesn't require a huge config change, and that code hasn't been out long enough to have really gotten entrenched. Although compatibility could be added easily.

This allows use of variables or even arbitrary expressions to construct
use-package arguments:

(use-package some-package
  :mode ,mode-spec
  :bind (,binding
         ,@more-bindings
         ,@(cl-loop for i from ?a to ?z
                    collect `(,(string i) . nifty-function))))
@dudebout
Copy link
Contributor

I like the idea of a more uniform evaluation policy. I would have to check if I can still achieve my goal but I think this is doable.

(I am working on a wrapper macro for use-package called auto-use-package that automatically fills the :bind, :config etc sections by looking at available functions with the correct name)

@npostavs
Copy link
Contributor Author

(I am working on a wrapper macro for use-package called auto-use-package that automatically fills the :bind, :config etc sections by looking at available functions with the correct name)

In that case, couldn't you eval variables from within auto-use-package and not require any changes to use-package?

@dudebout
Copy link
Contributor

Good point.

@dudebout
Copy link
Contributor

That would be cleaner to have no evaluation whatsoever by default.

jwiegley added a commit that referenced this pull request Sep 27, 2013
@jwiegley jwiegley merged commit 7cb133c into jwiegley:master Sep 27, 2013
@npostavs npostavs deleted the quasiquote branch December 31, 2013 22:54
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this pull request Nov 24, 2022
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this pull request Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants