1

I am new to the world of Emacs, and like most ex-vimmers, I am starting with Spacemacs. I have been trying to find time to do some leetcode and would like to use the package leetcode-emacs.

I have been trying to follow the docs and have tried the following :

  1. I pressed SPC SPC configuration-layer/create-layer.
  2. In the corresponding files that were created, in packages.el, I added the following code.
(defconst myleetcode-packages
  '((ctable :location local)
    names
    (leetcode :location (recipe
                         :fetcher github
                         :repo "ginqi7/leetcode-emacs"))))


(defun myleetcode/init-ctable ()
  (use-package ctable))

(defun myleetcode/init-names ()
  (use-package names))

(defun myleetcode/init-leetcode ()
  (use-package leetcode
    :after names
    :config
    (setq
     leetcode-path "/tmp/"
     leetcode-language "python")))

I asked around on different forums and somebody on Reddit pointed out that this is happening since the package is using the names package for implementing namespaces.

That's why I added the code to import that package as well, but I am getting the exact same error as before :

Error (use-package): leetcode/:catch: Symbol’s value as variable is void: leetcode-

ELisp is so damn hard :(

  • Show the complete error msg, if you haven't. The msg you show says that code you're using refers to a variable leetcode-, which has no value. Search the code you use for that variable name. It looks like the last part of the variable name is missing (unless you copied the error message wrong). – Drew Apr 17 at 15:29
  • That's the complete error message. In the code, the author has used names package to manage namespaces, so that's where this is coming from. – Anmol Jagetia Apr 17 at 18:10
  • If that's the whole error message then there is, somewhere in the code (or in code generated by the code) a symbol named leetcode- that the code is trying to use as a variable (trying to get its value). That's the code with the problem. – Drew Apr 17 at 19:44
0

Got it to work. The layer is available at leetcode-emacs-layer.

It was because the original package depends on the names package and the old compiled code was causing this weird behavior. Deleting all packages and cache fixes the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.