jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.42k stars 260 forks source link

Allow defining a key sequence using a cons with `:bind` #1029

Closed joelpet closed 1 year ago

joelpet commented 1 year ago

As pointed out in #967, :bind does currently not allow defining a key sequence using a cons – (STRING . DEFN) – as definition. Consequently, it is not possible to provide a custom description of the command, which e.g. the which-key package uses in its hints. This changeset is intended to enable such definitions.

I am new to both Emacs Lisp and the use-package code, so the current changes are probably best considered a proof of concept; I expect several changes need be made before merging. I would be grateful for suggestions on how to improve the implementation to the point where it can be merged.

TODO

skangas commented 1 year ago

This looks like a useful contribution, thanks.

This contribution is large enough to require a copyright assignment before we can consider it for inclusion. Would you like to start that process now? If yes, please follow the instructions below.

Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
GNU Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]

Once that is done, we can proceed with reviewing your changes. Thanks in advance.

PS. Squashing your commits sounds like a good idea, and would make your changes easier to review. The documentation to update is use-package.texi on the emacs-29 branch in emacs.git, but that has not yet been merged into this repository. If you prefer, you could move your work to emacs.git and send your changes as a patch to the bug-gnu-emacs mailing list, and we can continue working from there.

joelpet commented 1 year ago

Thank you for your reply.

PS. Squashing your commits sounds like a good idea, and would make your changes easier to review. The documentation to update is use-package.texi on the emacs-29 branch in emacs.git, but that has not yet been merged into this repository. If you prefer, you could move your work to emacs.git and send your changes as a patch to the bug-gnu-emacs mailing list, and we can continue working from there.

I have now:

The patch is available for browsing at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60749.

Please let me know how you would like me to proceed with this PR.

jwiegley commented 1 year ago

@joelpet Hi Joel, has the FSF received your copyright assignment papers yet?

joelpet commented 1 year ago

@jwiegley Yes, I received the following message from copyright-clerk[at]fsf.org on 2023-01-10:

Your assignment/disclaimer process with the FSF is currently complete

jwiegley commented 1 year ago

@joelpet Great, are you ready to move this PR out of draft status?

joelpet commented 1 year ago

@jwiegley Sure! I just rebased this PR branch on master and updated the new use-package.texi file with the same changes as I included in the patch for emacs.git. I now consider it ready for review, and I appreciate any feedback you may have. Thanks!