Fork me on GitHub
#spacemacs
<
2017-11-28
>
scknkkrer16:11:20

Hi guys. I just wanna create a package and assing a binding to that function. Any tutorial or document ?

vuuvi16:11:38

@scknkkrer checkout this guide: it does a pretty good job of explaining all of spacemacs configuring

scknkkrer16:11:26

How can I fetch a package from github ? I couldn’t find any example.

vuuvi16:11:16

check this snippet out:

dotspacemacs-additional-packages
'(
  (mypackage :location (recipe :fetcher github :repo "githubuser/mypackage"))
 )

scknkkrer16:11:43

I did that. But my package doesn’t load. How can I debug the problem ?

eggsyntax16:11:52

@scknkkrer I would check the *messages* buffer first to see if it reports an error when it tries to load it.

eggsyntax16:11:13

(Probably at SM startup time)

vuuvi16:11:03

gotta love those SM startup time error messages

scknkkrer17:11:38

Wait, it install my package from source.

scknkkrer17:11:00

But it doesn’t load the functioncs inside it.

eggsyntax17:11:36

Ah, you probably need to add (require 'my-package) to your user-config.

scknkkrer17:11:49

But, use-package function don’t that for me ?

eggsyntax17:11:03

Oh. I would expect it to, on the face of it. Not sure I've actually used use-package, it just sounds like it would 😆

scknkkrer17:11:05

So, it will live ? 😂

chris17:11:28

yeah, it won't autorequire things

chris17:11:56

that would defeat the purpose of spacemacs' lazy loading

chris17:11:47

well, it won't unless the package config tells it to

scknkkrer17:11:24

Chris, here is the thing. I started development on spacemacs yesterday. I read a lot. But every documentation shows the things from far away. so tiny perspective.

scknkkrer17:11:17

(defconst exercism-layer-packages
  '(evil-magit (exercism-mode :location (recipe :fetcher github
                                                :repo "LeaveNhA/exercism-mode"))))

(defun exercism-layer/post-init-evil-magit ()
  (with-eval-after-load 'magit
    (require 'evil-magit)
    (evil-define-key 'motion magit-mode-map
      (kbd dotspacemacs-leader-key) spacemacs-default-map)))

(defun exercism-layer/init-exercism-mode ()
  (use-package exercism-mode
    :defer t))

(defun exercism-layer/post-init-exercism-mode ()
  (progn
    (spacemacs/declare-prefix "E" "Exercism")
    (spacemacs/declare-prefix "Ex" "Exercise")
    (spacemacs/set-leader-keys
      "Exf" 'exercism-mode/fetch-new-exercise
      "Exs" 'exercism-mode/send-solution-to-exercism)))

scknkkrer17:11:03

I need magit but not as owner layer. so I do my init in post-init stage.

scknkkrer17:11:15

I add my mode package from github.

scknkkrer17:11:31

It really install my package from there.

scknkkrer17:11:54

But when I don’t define the package functions in my layer. It says invalid commandp……. I think it really don’t load my mode properly.

eggsyntax17:11:02

@scknkkrer you might want to consider bringing it up in the Spacemacs gitter -- that seems to be where a lot of the SM devs hang out. https://gitter.im/syl20bnr/spacemacs

scknkkrer17:11:50

I did. They laugh at me.

eggsyntax17:11:06

Sorry to hear that.

scknkkrer17:11:39

“Community-Driven”

scknkkrer17:11:06

Says on my sapcemacs.

scknkkrer17:11:35

@eggsyntax also, when I require the package, it says; Required feature was not provided

eggsyntax17:11:26

Definitely way outside my expertise; I've never tried to do anything at all complicated with packages. I mostly stick with existing layers.

scknkkrer19:11:39

If anyone who use http://exercism.io for exercise in spacemacs.

scknkkrer19:11:49

You can use this.

jeff.terrell19:11:11

Nice work @scknkkrer! Just curious, have you opened a PR to add the layer to core spacemacs? That'd be neat to see. simple_smile

jeff.terrell19:11:22

Did you get all your problems straightened out?

scknkkrer20:11:10

Not yet. It’s too empty right now. I have to implement another features.

scknkkrer20:11:25

I am glad you like it.

vuuvi20:11:53

@eggsyntax I am with you on that!

vuuvi20:11:04

oh what a cool idea @scknkkrer!

ag20:11:17

@scknkkrer I believe you need layers.el in your dir. where you declare layers that your layer depends upon

ag20:11:37

in that file you'd add something like (configuration-layer/declare-layers '(git))

scknkkrer20:11:19

I didn’t use any external layer.

ag20:11:39

well, you need magit, magit is already comes with git layer, if you want layers to load in order I think you need to do that

scknkkrer20:11:32

Opps. wait a minute. 😞

scknkkrer20:11:48

I removed it.

scknkkrer20:11:52

Thanks for the inform.