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

Still need (require 'torus) if using use-package #1

Closed
WorldsEndless opened this issue Mar 6, 2019 · 3 comments
Closed

Still need (require 'torus) if using use-package #1

WorldsEndless opened this issue Mar 6, 2019 · 3 comments

Comments

@WorldsEndless
Copy link

I have the following in my emacs.el:

(use-package torus
  :ensure t
  :bind (:map torus-map
	 ("M-p" . torus-previous-location)
	 ("M-n" . torus-next-location))
  :config
  (setq torus-prefix-key "s-,")
  ;; Range 0 -> 3
  (setq torus-optional-bindings 3)
  ;; Created if non existent
  (setq torus-dirname "~/emacs/.emacs.d/torus/")
  (setq torus-load-on-startup t)
  (setq torus-save-on-exit t)
  (setq torus-autoread-file "~/emacs/.emacs.d/torus/last.el")
  (setq torus-autowrite-file torus-autoread-file)
  (setq torus-history-maximum-elements 30)
  (setq torus-maximum-horizontal-split 3)
  (setq torus-maximum-vertical-split 3)
  (torus-init)
  (torus-install-default-bindings))

Torus is installed on the system; however, upon restart I still need to either (find-library torus) and eval-buffer or I need a (require `torus) preceding my use-package line. For every other library in my file (~100 of them) use-package does the trick on its own. Why do I still need require to get torus loaded?

@chimay
Copy link
Owner

chimay commented Mar 6, 2019

Strange, for what I know of use-package, it calls the require line. I shall investigate; thanks for reporting !

@chimay
Copy link
Owner

chimay commented Mar 6, 2019

All right, it seems to happen because use-package tend to autoload functions
For the time being, add :demand to your declaration and it should be fine.

Here is my declaration:

(use-package torus
  :demand
  :bind-keymap ("s-t" . torus-map)
  :bind
  (("<S-s-insert>" . torus-add-circle)
   ("<s-insert>" . torus-add-location)
   ("<s-delete>" . torus-delete-location)
   ("<S-s-delete>" . torus-delete-circle)
   ("<C-prior>" . torus-previous-location)
   ("<C-next>" . torus-next-location)
   ("<C-home>" . torus-previous-circle)
   ("<C-end>" . torus-next-circle)
   ("<S-prior>" . torus-history-newer)
   ("<S-next>" . torus-history-older)
   ("C-^" . torus-alternate)
   ("<S-home>" . torus-alternate-circles)
   ("<S-end>" . torus-alternate-in-same-circle)
   ("s-SPC" . torus-switch-circle)
   ("s-=" . torus-switch-location)
   ("s-^" . torus-switch-torus)
   ("s-*" . torus-search)
   ("s-/" . torus-search-history)
   :map torus-map
   ("t" . torus-copy-to-circle))
  :custom
  ((torus-prefix-key "s-t")
   (torus-binding-level 3)
   (torus-verbosity 2)
   (torus-dirname "~/racine/plugin/data/torus")
   (torus-load-on-startup t)
   (torus-save-on-exit t)
   (torus-autoread-file "~/racine/plugin/data/torus/dernier")
   (torus-autowrite-file torus-autoread-file)
   (torus-history-maximum-elements 30)
   (torus-maximum-horizontal-split 3)
   (torus-maximum-vertical-split 4)
   (torus-prefix-separator " : ")
   (torus-join-separator " - "))
  :config
  (torus-init)
  (torus-install-default-bindings))

@WorldsEndless
Copy link
Author

WorldsEndless commented Mar 6, 2019 via email

@chimay chimay closed this as completed Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants