mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
ein:notebooklist: A faster, better change url.
Make the process of changing URL's via `ein:notebooklist-change-url-port' smoother and more user-friendly.
This commit is contained in:
parent
334bb46000
commit
c1d263fa13
1 changed files with 7 additions and 2 deletions
|
@ -876,6 +876,7 @@ on all the notebooks opened from the current notebooklist."
|
||||||
(unless (eql major-mode 'ein:notebooklist-mode)
|
(unless (eql major-mode 'ein:notebooklist-mode)
|
||||||
(error "This command needs to be called from within a notebooklist buffer."))
|
(error "This command needs to be called from within a notebooklist buffer."))
|
||||||
(lexical-let* ((current-nblist ein:%notebooklist%)
|
(lexical-let* ((current-nblist ein:%notebooklist%)
|
||||||
|
(old-url (ein:$notebooklist-url-or-port current-nblist))
|
||||||
(new-url-or-port new-url-or-port)
|
(new-url-or-port new-url-or-port)
|
||||||
(open-nb (ein:notebook-opened-notebooks #'(lambda (nb)
|
(open-nb (ein:notebook-opened-notebooks #'(lambda (nb)
|
||||||
(equal (ein:$notebook-url-or-port nb)
|
(equal (ein:$notebook-url-or-port nb)
|
||||||
|
@ -883,13 +884,17 @@ on all the notebooks opened from the current notebooklist."
|
||||||
(deferred:$
|
(deferred:$
|
||||||
(deferred:next
|
(deferred:next
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(ein:notebooklist-open new-url-or-port "/" nil)
|
(ein:notebooklist-open new-url-or-port "/" t)
|
||||||
(loop until (get-buffer (format ein:notebooklist-buffer-name-template new-url-or-port))
|
(loop until (get-buffer (format ein:notebooklist-buffer-name-template new-url-or-port))
|
||||||
do (sit-for 0.1))))
|
do (sit-for 0.1))))
|
||||||
(deferred:nextc it
|
(deferred:nextc it
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(dolist (nb open-nb)
|
(dolist (nb open-nb)
|
||||||
(ein:notebook-update-url-or-port new-url-or-port nb)))))))
|
(ein:notebook-update-url-or-port new-url-or-port nb))))
|
||||||
|
(deferred:nextc it
|
||||||
|
(lambda ()
|
||||||
|
(kill-buffer (ein:notebooklist-get-buffer old-url))
|
||||||
|
(ein:notebooklist-open new-url-or-port "/" nil))))))
|
||||||
|
|
||||||
|
|
||||||
;;; Generic getter
|
;;; Generic getter
|
||||||
|
|
Loading…
Add table
Reference in a new issue