-1

https://github.com/Cheatinikle/Spacemacs-settings/blob/master/emacs-package/preetest-mode.el

This is my full source code, and 'just-utils package is also included in the repository.

The problem is, when I open up a test (using preetest-open-test) and execute some function like preetest-next-question as a command, I get an error "No such directory found via CDPATH environment variable". However, when I run it with something like eval-last-sexp, it works well.

  • I presume you're unaware that most of preetest-mode.el is duplicated. Search for (provide 'preetest). – phils Sep 14 '17 at 23:46
  • 1
    If you provided an example 'test' file, people could try to replicate the issue. – phils Sep 14 '17 at 23:51
  • 'test' file can be easily created with preetest-create-test, and my 'test' file has nothing special. – Cheati Nikle Sep 14 '17 at 23:57
  • @phils By the way, what do you mean by 'most of preetest-mode.el is duplicated'? – Cheati Nikle Sep 14 '17 at 23:58
  • 1
    Please consider posting a self-contained question, with whatever code is necessary to repro your problem, and no more than that. If you just dump your entire config out there and ask people to debug it for you, you might not get the best help you need. – Drew Sep 15 '17 at 0:44
0

I changed

(defun preetest--update (n location)
  (with-directory location
    (select-window-2)
    (with-directory PREETEST-ANSWER-DIR
      (let ((buf (current-buffer)))
        (save-buffer)
        (unless (file-exists-p (number-to-string n)) (create-file (number-to-str    ing n)))
        (switch-to-buffer (find-file (number-to-string n)))

(kill-buffer buf)))

to

(defun preetest--update (n location)
  (with-directory location
    (select-window-2)
    (with-directory (concat location PREETEST-ANSWER-DIR)
      (let ((buf (current-buffer)))
        (save-buffer)
        (unless (file-exists-p (number-to-string n)) (create-file (number-to-str    ing n)))
        (switch-to-buffer (find-file (number-to-string n)))

(kill-buffer buf)))

and it worked. I guess it was a directory reference 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.