micanzhang / ob-rust

28 stars 10 forks source link

Do not (require 'org) #4

Closed crosiek closed 5 years ago

crosiek commented 6 years ago

For me, requiring org leads to a "Recursive require for feature" error when ob-rust.el is required via org-babel-load-languages as the manual suggests. As a minimal example:

$ ls .
init.el  ob-rust.el
$ cat init.el
(setq org-babel-load-languages '((emacs-lisp . t)
                                 (rust . t)))
(add-to-list 'load-path ".")
(require 'org)
$ emacs -Q --batch -l init.el
Recursive ‘require’ for feature ‘org’
$ emacs --version | head -1
GNU Emacs 26.1

For the same effect, (setq ... may be replaced with an M-x customized variable such as in the following:

(custom-set-variables
'(org-babel-load-languages
  (quote
   ((rust . t)
    (emacs-lisp . t)))))

I guess org should not be required from an ob-*.el file. Compare with e.g. lisp/org/ob-C.el. This PR removes it.

Best regards,

micanzhang commented 6 years ago

please make sure unit test passed

crosiek commented 6 years ago

As was also pointed out in #2, the unit tests were failing even though they show up Travis as successfully completed. I have now updated the unit tests to install cargo-script and yield the appropriate exit status upon failure. I have also replaced emacs-snapshot with emacs25. @micanzhang, please have a look at the PR again.