Add ``use-package`` example in the docs
Hi, I'm currently using julia-mode and I see there are no use-package example in the docs, here is mine :
(use-package julia-mode
:defer t
:init
(setq inferior-julia-program-name "/usr/bin/julia"))
where I set inferior-julia-program-name to the output of which julia in the shell.
This is because I installed julia from a package manager but someone installing from the website will have to find the executable in their julia <julia version> directory.
Thanks for the cool package!
In #144 I revealed my work-in-progress use-package setup for the "from the website" case you mentioned:
(use-package julia-mode
:ensure t
:config
;; Set julia-program to the manually downloaded julia binary:
(unless (boundp 'julia-program)
(error "ASSERTION FAILED: Expected use-program to have bound julia-program by now by downloading it and installing it."))
(let ((julia-install-dir "~/julia"))
(when (file-directory-p julia-install-dir)
(let ((dirs (directory-files
julia-install-dir
'full
(rx "julia-"
(+ (any "0-9" "."))
eol))))
;; Assume that only one version is installed, for now:
(when (eq 1 (length dirs))
(let ((julia-dir (car dirs)))
(let ((potential-julia-program (expand-file-name "bin/julia" julia-dir)))
(when (file-executable-p potential-julia-program)
(setq julia-program potential-julia-program)))))))))
I'm not sure what you are referring to by "in the docs". I do not see any explicitly expressed documentation in GitHub here. Sure, I see doc-strings on defun's in the code, but that is not documentation in my opinion. I see this GitHub has a "Wiki' but when I click on it, it takes me back what is in the README, the latter of which only provides the required installation instructions, but not usage guidance and examples.
Also note that my use-package construct above is probably incorrect or useless, because I'm using julia-program and #144's answer indicates I should try some other mode to provide "inferior" access. Also, I see your use-package construct uses a different variable, inferior-julia-program-name, thus adding to my confusion. Note that I am not saying your construct is incorrect; it is just not understood why there are two variables. Maybe they are actually the same thing?