Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapp committed Oct 26, 2023
2 parents 3729740 + b2c5e2e commit 7a3a7cf
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions julia-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ Note that this affects all buffers using the ‘ansi-term’ map."
:type 'boolean
:group 'julia-repl)

(defcustom julia-repl-pop-to-buffer t
"When non-nil pop to julia repl"
:type 'symbol
:group 'julia-repl)

(defcustom julia-repl-path-rewrite-rules nil
"A list of rewrite rules applied to paths sent with ‘include’ and similar.
Expand Down Expand Up @@ -571,13 +576,17 @@ This is the standard entry point for using this package."
(inferior-buffer (julia-repl-inferior-buffer)))
(with-current-buffer inferior-buffer
(setq julia-repl--script-buffer script-buffer))
(pop-to-buffer inferior-buffer)))
(if julia-repl-pop-to-buffer
(pop-to-buffer inferior-buffer)
(switch-to-buffer inferior-buffer))))

(defun julia-repl--switch-back ()
"Switch to the buffer that was active before last call to `julia-repl'."
(interactive)
(when (buffer-live-p julia-repl--script-buffer)
(switch-to-buffer-other-window julia-repl--script-buffer)))
(if julia-repl-pop-to-buffer
(switch-to-buffer-other-window julia-repl--script-buffer)
(switch-to-buffer julia-repl--script-buffer))))

;;
;; path rewrites
Expand Down Expand Up @@ -632,7 +641,8 @@ Unless NO-BRACKETED-PASTE, bracketed paste control sequences are used."
(when (eq no-newline 'prefix)
(setq no-newline current-prefix-arg))
(let ((inferior-buffer (julia-repl-inferior-buffer)))
(display-buffer inferior-buffer)
(if julia-repl-pop-to-buffer
(display-buffer inferior-buffer))
(julia-repl--send-to-backend julia-repl--terminal-backend
inferior-buffer (s-trim string) (not no-bracketed-paste)
(not no-newline))))
Expand Down Expand Up @@ -725,7 +735,7 @@ If a buffer corresponds to a file and is not saved, the function prompts the use
(save-buffer)
(unless (file-exists-p file)
(message "need to save the file first"))))
(julia-repl--send-string (concat "Revise.includet(\""
(julia-repl--send-string (concat "using Revise; Revise.includet(\""
(julia-repl--path-rewrite file julia-repl-path-rewrite-rules)
"\");")))
(message "buffer does not correspond to a file"))))
Expand Down

0 comments on commit 7a3a7cf

Please sign in to comment.