mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Refactor jupyter-repl-eval-file
for readability
This commit is contained in:
parent
83fb582270
commit
e94db94851
1 changed files with 8 additions and 8 deletions
|
@ -1787,14 +1787,14 @@ are displayed."
|
||||||
(message "Evaluating %s..." file)
|
(message "Evaluating %s..." file)
|
||||||
(setq file (expand-file-name file))
|
(setq file (expand-file-name file))
|
||||||
(if (file-exists-p file)
|
(if (file-exists-p file)
|
||||||
(let ((buf (find-buffer-visiting file)))
|
(let* ((buf (find-buffer-visiting file))
|
||||||
(jupyter-repl-eval-string
|
(killp (null buf)))
|
||||||
(if buf (with-current-buffer buf
|
(when (null buf)
|
||||||
(buffer-string))
|
(setq buf (delay-mode-hooks (find-file-noselect file))))
|
||||||
(with-current-buffer (delay-mode-hooks (find-file-noselect file))
|
(with-current-buffer buf
|
||||||
(prog1 (buffer-string)
|
(jupyter-repl-eval-string (buffer-string) 'silently))
|
||||||
(kill-buffer))))
|
(when killp
|
||||||
'silently))
|
(kill-buffer)))
|
||||||
(error "Not a file (%s)" file)))
|
(error "Not a file (%s)" file)))
|
||||||
|
|
||||||
(defun jupyter-repl-eval-region (beg end &optional silently)
|
(defun jupyter-repl-eval-region (beg end &optional silently)
|
||||||
|
|
Loading…
Add table
Reference in a new issue