branch: elpa/julia-mode commit 64d86a45871898d9915b9e23d82f46e175b20223 Author: Philip Woods <elzairthesorce...@gmail.com> Commit: Yichao Yu <yyc1...@gmail.com>
Added customization options --- julia-mode.el | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 6ccb2cf..7507c7a 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -3101,9 +3101,24 @@ end")) ;; Code for `inferior-julia-mode' (require 'comint) -(defvar julia-file-path "/usr/bin/julia" "Path to the program used by `inferior-julia'.") +(defgroup julia + '() + "Julia Programming Language." + :group 'languages + :prefix "julia-") -(defvar julia-arguments '() "Commandline arguments to pass to `julia'.") +(defcustom julia-program "julia" + "Path to the program used by `inferior-julia'." + :type 'string + :group 'julia) + +(defcustom julia-arguments '() + "Commandline arguments to pass to `julia-program'." + :type 'string + :group 'julia) + +(defvar julia-prompt-regexp "julia>" + "Regexp for matching `inferior-julia' prompt.") (defvar inferior-julia-mode-map (let ((map (nconc (make-sparse-keymap) comint-mode-map))) @@ -3112,13 +3127,10 @@ end")) map) "Basic mode map for `inferior-julia-mode'.") -(defvar inferior-julia-prompt-regexp "julia>" - "Prompt for `inferior-julia'.") - (defun inferior-julia () "Run an inferior instance of `julia' inside Emacs." (interactive) - (let ((julia-program julia-file-path) + (let ((julia-program julia-program) (buffer (get-buffer-create "Julia"))) (when (not (comint-check-proc "Julia")) (apply #'make-comint-in-buffer "Julia" "Julia" julia-program julia-arguments)) @@ -3134,10 +3146,10 @@ end")) \\<inferior-julia-mode-map>" nil "Julia" - (setq comint-prompt-regexp inferior-julia-prompt-regexp) + (setq comint-prompt-regexp julia-prompt-regexp) (setq comint-prompt-read-only t) (set (make-local-variable 'font-lock-defaults) '(julia-font-lock-keywords t)) - (set (make-local-variable 'paragraph-start) inferior-julia-prompt-regexp) + (set (make-local-variable 'paragraph-start) julia-prompt-regexp) (set (make-local-variable 'indent-line-function) 'julia-indent-line)) (add-hook 'inferior-julia-mode-hook 'inferior-julia--initialize)