Open Hugo-Heagren opened 2 years ago
One thing the :bind
form does is generate autoloads for the functions bound to, in your case my/citar-open-in-ebib-wrapper
. This is probably why use-package
attempts to understand the form instead of simply passing it to bind-keys
without interpreting it. So, that probably explains why it apparently recognizes only a subset of valid bind-key
forms. Issue #971 is somewhat related to this.
@Hugo-Heagren You might want to try with the latest version of master
now that 77945e002f11440eae72d8730d3de218163d551e has been merged. It should take care of properly passing on the cons forms you use in :bind
to the bind-keys
macro.
I wanted to add a key to my citar config for opening a citation in ebib. This requires binding keys to conses of a description string and a function. This succeeds (no errors, and the binding shows up as desired):
This fails though:
The error message says that
use-package: citar wants arguments acceptable to the 'bind-keys' macro or a list of such values
, but clearly these arguments are acceptable tobind-keys
!I don't mind awfully that
:bind
doesn't accept this very unusual form of binding, but I think the error message is confusing. Ideally though, since:bind
does in fact usebind-keys
, it would be good if it would accept anythingbind-keys
accepts (which would make the error message consistent).The problem is the check at line 81 in use-package-bind-key.el:
https://github.com/jwiegley/use-package/blob/a7422fb8ab1baee19adb2717b5b47b9c3812a84c/use-package-bind-key.el#L81
Removing this check solves the problem, but I imagine it was in there for a reason to begin with. I can't parse the code in
bind-key.el
very well, but perhaps implementing exactly the same checks (whatever they are) it uses would be better.