Commit graph

21 commits

Author SHA1 Message Date
Hugo Heagren
c4bd2aa3b8 bind-key-form: allow :continue keyword inside repeat map
Purely syntactic sugar, using :continue is the same as not using any
keyword inside :repeat-map at all.

Amend end of function to pass repeat-map value onto next invocation in
recursive uses. This allows for the same repeat map to be used for
:exit and :continue.
2022-01-28 22:37:37 +00:00
Hugo Heagren
5ef327ce9f bind-key-form: allow :exit keyword inside repeat map
Keys bound inside the scope of :exit are bound inside the repeat map,
but do not have their repeat-map property set (so they run a function,
but 'exit' the map).
2022-01-28 22:37:37 +00:00
Hugo Heagren
2203246454 bind-keys-form: new keyword :repeat-map, for defining repeat maps
use-package-normalize/:bind: allow keyword :repeat-map.

bind-keys-form: Add keyword :repeat-map. Specifying a symbol as the
repeat-map defines a keymap with that name (and with the docstring
`repeat-doc', if specified). Symbols for functions bound to keys under
the scope of :repeat-map have their 'repeat-map property set to this
map. Update docstring (and that of `bind-keys') to reflect changes.

Rename `doc' to `prefix-doc' for clarity and consistency with
'repeat-doc'.
2022-01-28 22:37:06 +00:00
John Wiegley
4a34b41f96 Merge pull request from justbur/autoload-keymap
Correct prefix keys after use-package-autoload-keymap
GitHub-reference: https://github.com/jwiegley/use-package/issues/686
2018-07-15 11:01:24 -07:00
Alex Branham
e2e6f9a44b Enable lexical binding
This supersedes https://github.com/jwiegley/use-package/issues/617 and closes https://github.com/jwiegley/use-package/issues/648
2018-06-13 20:24:09 -05:00
Justin Burkett
c980371f6f Correct prefix keys after use-package-autoload-keymap
By adding events of the form (cons t event) to unread-command-events, Emacs
correctly updates this-command-keys for the subsequent use of the prefix.

Before this change, packages like my which-key were not getting the correct
prefix after use-package-autoload-keymap loaded the relevant package.

See https://github.com/justbur/emacs-which-key/issues/192
2018-06-03 21:38:20 -04:00
Matthew Justin Bauer
2250f89ac0 Support ":package" in use-package
bind-key supports the keyword ":package" but use-package does not know that. Adding this should be helpful. In the future, maybe we could automatically fill in with the use-package package, but that could be a breaking change.
2018-02-25 15:03:43 -06:00
John Wiegley
ab918196fa Revert "Merge pull request from jabranham/lexical-bindings"
This reverts commit d21787f1d6, reversing
changes made to fd8a3510fd.
GitHub-reference: https://github.com/jwiegley/use-package/issues/617
2018-01-27 14:13:48 -08:00
John Wiegley
566a2ea3a1 Revert "Move variable bindings to the bottom of each file"
This reverts commit c29193bf07.
2018-01-27 14:09:10 -08:00
John Wiegley
c29193bf07 Move variable bindings to the bottom of each file 2018-01-27 14:07:11 -08:00
Alex Branham
4c3abcf4eb Fix byte compiler warnings 2018-01-27 10:19:42 -06:00
Alex Branham
88bcb8b96d Use lexical bindings and remove cl package 2018-01-27 10:01:10 -06:00
John Wiegley
ec84ed0dfb Fix a scoping issues with multiple occurrences of :bind
Fixes https://github.com/jwiegley/use-package/issues/585
2017-12-09 16:29:11 -08:00
John Wiegley
0068501aa0 Remove several unnecessary calls to `ignore' 2017-12-07 22:40:48 -08:00
John Wiegley
8fefa49d39 Changes to the way auto-deferral is indicated
This change adds a new extension hook `use-package-autoloads/<KEYWORD>` for
specifying exactly which autoloads a keyword should imply. This is the proper
way to indicate autoloads, rather than adding to the `:commands` entry as was
done before.

Further, autoloading now must occur in order to cause implied deferred
loading; if :bind is used with only lambda forms, for example, this will not
cause deferred loading without `:defer t`.
2017-12-07 13:14:32 -08:00
John Wiegley
b001edf162 Add missing autoload cookie, and make lack of a normalizer an error
Fixes https://github.com/jwiegley/use-package/issues/566
2017-12-06 10:20:51 -08:00
John Wiegley
65caa3b423 Rewrite normalization of :bind and :bind*
Fixes https://github.com/jwiegley/use-package/issues/550
2017-12-05 13:11:30 -08:00
John Wiegley
0a628a2767 Avoid using pcase and many other macros in macro-expanded forms
This is related to https://github.com/jwiegley/use-package/issues/550
2017-12-05 11:10:16 -08:00
John Wiegley
10fd4577d0 Add missing autoload cookies
Fixes https://github.com/jwiegley/use-package/issues/555
2017-12-05 10:29:51 -08:00
John Wiegley
e34fdb580a Add several missing comments 2017-12-04 15:24:31 -08:00
John Wiegley
4b83f9525c Rename up-* files to use-package-* for consistency 2017-12-04 21:21:54 +00:00
Renamed from up-bind-key.el (Browse further)