mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -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)
|
||||
(setq file (expand-file-name file))
|
||||
(if (file-exists-p file)
|
||||
(let ((buf (find-buffer-visiting file)))
|
||||
(jupyter-repl-eval-string
|
||||
(if buf (with-current-buffer buf
|
||||
(buffer-string))
|
||||
(with-current-buffer (delay-mode-hooks (find-file-noselect file))
|
||||
(prog1 (buffer-string)
|
||||
(kill-buffer))))
|
||||
'silently))
|
||||
(let* ((buf (find-buffer-visiting file))
|
||||
(killp (null buf)))
|
||||
(when (null buf)
|
||||
(setq buf (delay-mode-hooks (find-file-noselect file))))
|
||||
(with-current-buffer buf
|
||||
(jupyter-repl-eval-string (buffer-string) 'silently))
|
||||
(when killp
|
||||
(kill-buffer)))
|
||||
(error "Not a file (%s)" file)))
|
||||
|
||||
(defun jupyter-repl-eval-region (beg end &optional silently)
|
||||
|
|
Loading…
Add table
Reference in a new issue