Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add extend the functionality #63

Closed
vsr625 opened this issue May 17, 2017 · 4 comments
Closed

How to add extend the functionality #63

vsr625 opened this issue May 17, 2017 · 4 comments

Comments

@vsr625
Copy link
Contributor

vsr625 commented May 17, 2017

I know it's a bit silly to post the question here, but I would like to know how to extend the feature of the existing modules, I understood the use of map! macro, it saves a lot of headaches, its brilliant.
And also the package! is also useful for installing any packages and keeping everything neat.

But I've not been able to figure out how to load the package using (def-package!) macro. I know it's essentially an alias to the use-package, but then too using similar example to what is shown in the use-package repo. I can't get it to work.

I've been trying to add ace-jump-mode to the evil feature module, I've added package! ace-jump-mode in the packages.el of evil, and in the config.el I've added (def-package! ace-jump-mode), then too ace-jump package isn't getting loaded. Is there anything else that I should be doing here? I didn't map any keybindings for this as of now, just trying to figure of using M-x, but can't find ace-jump-mode command itself. Your map! macro rocks. Thanks

@gilbertw1
Copy link
Contributor

You probably want to autoload the functions your planning on invoking using the :commands key. Something like this:

(def-package! ace-jump-mode
  :commands (ace-jump-mode))

In the above block, the function ace-jump-mode will be autoloaded and will be available. Since the package is lazy loaded it won't be loaded until a command listed in the :commands list is invoked.

Normally, you'll want to include any commands you'd like to call in this :commands list, so they'll be autoloaded and available. Your other option is to use :demand t, which will force the package to be loaded automatically at startup, however this will slow your startup time down a bit.

Hope that helps!

@gilbertw1
Copy link
Contributor

I'll also throw out there, that avy (which is very similar) is already included in this emacs config. You may want to try it out:

https://github.com/abo-abo/avy

@vsr625
Copy link
Contributor Author

vsr625 commented May 17, 2017

Thanks for replying, both :command and :demand t worked fine and solved my issue, I sure will do look into avy as well.
One last question though, in org mode, is there any way to change the checklist status to partially completed using a keybinding?

@hlissner
Copy link
Member

hlissner commented May 17, 2017

One last question though, in org mode, is there any way to change the checklist status to partially completed using a keybinding?

@vsr625 I just pushed one I've kept to myself for a while (I have a lot of org-mode changes in the pipeline).

+org/dwim-at-point (currently bound to RET in normal mode) now cycles between the three states ([ ] => [-] => [X]).

Also, to expand on what gilbertw1 was saying: use-package-always-defer is set to t in my config (the default is nil in use-package), so packages won't be automatically loaded (without :demand t or being autoloaded, as mentioned above).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants