From b9e145c4db30cee2a65f0ef8be0105756cfebfa3 Mon Sep 17 00:00:00 2001 From: John Miller Date: Fri, 12 Sep 2014 12:37:24 -0500 Subject: [PATCH] Cleaning up status messages Corrected error in response code checking when saving a network (IPython server now returns 200 instead of 204). Cleaned up error that was being raised from EIN's notification system. Seems like there is some logic for popping to a buffer once a notification event first, but to what buffer is unclear so for know I have disabled that functionality. --- lisp/ein-notebook.el | 5 +++-- lisp/ein-notebooklist.el | 4 +++- lisp/ein-notification.el | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/ein-notebook.el b/lisp/ein-notebook.el index d748fc3..3b08cf0 100644 --- a/lisp/ein-notebook.el +++ b/lisp/ein-notebook.el @@ -651,7 +651,8 @@ of NOTEBOOK." ;; accessed via PUT or DELETE. As it seems Emacs failed to ;; choose PUT method every two times, let's check the response ;; here and fail when 204 is not returned. - (unless (eq response-status 204) + ;; UPDATE 12Sep2014 (JMM) - IPython server now returns 200 on successful save. + (unless (eq response-status 200) (with-current-buffer (ein:notebook-buffer notebook) (if (< retry ein:notebook-save-retry-max) (progn @@ -660,7 +661,7 @@ of NOTEBOOK." callback cbarg)) (ein:notebook-save-notebook-error notebook :status status) (ein:log 'info - "Status code (=%s) is not 204 and retry exceeds limit (=%s)." + "Status code (=%s) is not 200 and retry exceeds limit (=%s)." response-status ein:notebook-save-retry-max))))) (defun ein:notebook-save-notebook-success (notebook &rest ignore) diff --git a/lisp/ein-notebooklist.el b/lisp/ein-notebooklist.el index 32d5cdd..e306625 100644 --- a/lisp/ein-notebooklist.el +++ b/lisp/ein-notebooklist.el @@ -52,7 +52,7 @@ is opened at first time.:: `ein:$notebooklist-url-or-port' URL or port of IPython server. -`ein:$notbooklist-url-or-port' +`ein:$notbooklist-path' The path for the notebooklist. `ein:$notebooklist-data' @@ -142,6 +142,7 @@ To suppress popup, you can pass a function `ein:do-nothing' as CALLBACK." "Open notebook list buffer." (interactive (list (ein:notebooklist-ask-url-or-port))) (unless url-or-port (setq url-or-port (ein:default-url-or-port))) + (unless path (setq path "")) (ein:subpackages-load) (let ((success (if no-popup @@ -311,6 +312,7 @@ Notebook list data is passed via the buffer local variable (remove-overlays) ;; Create notebook list (widget-insert "IPython Notebook list\n\n") + (widget-insert " | " (ein:$notebooklist-path ein:%notebooklist%) " |\n") (widget-create 'link :notify (lambda (&rest ignore) (ein:notebooklist-new-notebook)) diff --git a/lisp/ein-notification.el b/lisp/ein-notification.el index 8ae6f11..fd1ee76 100644 --- a/lisp/ein-notification.el +++ b/lisp/ein-notification.el @@ -161,8 +161,9 @@ where NS is `:kernel' or `:notebook' slot of NOTIFICATION." (lambda (ns message status next) (when (equal (oref ns :status) status) (ein:notification-status-set ns next) - (ein:with-live-buffer (oref ns :buffer) - (force-mode-line-update)))) + ;; (ein:with-live-buffer (oref ns :buffer) + ;; (force-mode-line-update)) + )) packed))) (defun ein:notification-setup (buffer events &rest tab-slots)