Skip to content

Commit 54b4aa3

Browse files
authored
Merge pull request #52 from dellison/julia-editor
add commands to set JULIA_EDITOR, update README.md
2 parents 89386fa + 121e3d5 commit 54b4aa3

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ Note some keybindings for `term`:
111111

112112
See the help of `term` for more.
113113

114+
## Using the @edit macro
115+
116+
The `@edit` macro can be called with `C-c C-e` when the `julia-repl-mode` minor mode is enabled. The behavior depends on the value of the `JULIA_EDITOR` envoronment variable in the Julia session. The command `julia-repl-set-julia-editor` is provided to conveniently control this from emacs.
117+
118+
To use "emacsclient" as a default in each Julia REPL, call `julia-repl-use-emacsclient`:
119+
120+
```elisp
121+
(add-hook 'julia-repl-hook #'julia-repl-use-emacsclient)
122+
```
123+
114124
## Limitations
115125

116126
See the [issues](https://github.com/tpapp/julia-repl/issues).

julia-repl.el

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,16 @@ When called with a prefix argument, activate the home project."
544544
(expand-file-name (file-name-directory projectfile)) "\")")))
545545
(message "could not find project file")))))
546546

547+
(defun julia-repl-set-julia-editor (editor)
548+
"Set the JULIA_EDITOR environment variable."
549+
(interactive)
550+
(julia-repl--send-string (format "ENV[\"JULIA_EDITOR\"] = \"%s\";" editor)))
551+
552+
(defun julia-repl-use-emacsclient ()
553+
"Use emacsclient as the JULIA_EDITOR."
554+
(interactive)
555+
(julia-repl--send-string "ENV[\"JULIA_EDITOR\"] = \"emacsclient\";"))
556+
547557
;;;###autoload
548558
(define-minor-mode julia-repl-mode
549559
"Minor mode for interacting with a Julia REPL running inside a term."

0 commit comments

Comments
 (0)