From b83621299e1f44f828decd2a989bfbf6697add54 Mon Sep 17 00:00:00 2001 From: John Miller Date: Thu, 20 Nov 2014 12:36:24 -0600 Subject: [PATCH] Fixing :prompt_number property on saving. More conditional code for saving notebooks in nbformat v4.0. `prompt_number` is no longer a valid property so it has to be corrected to be `execution_count` instead. --- lisp/ein-cell.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ein-cell.el b/lisp/ein-cell.el index 98f4065..3b61654 100644 --- a/lisp/ein-cell.el +++ b/lisp/ein-cell.el @@ -989,7 +989,7 @@ prettified text thus be used instead of HTML type." (loop while ocopy do (let ((prop (pop ocopy)) (value (pop ocopy))) - (ein:log 'info "Checking property %s for output type %s" + (ein:log 'info "Checking property %s for output type '%s'" prop otype) (cond ((equal prop :stream) (progn (push value new-output) @@ -1012,6 +1012,12 @@ prettified text thus be used instead of HTML type." (push (list new-prop (list value)) new-output) (push :data new-output))) + ((and (equal otype "execute_result") + (equal prop :prompt_number)) + (ein:log 'info "SAVE-NOTEBOOK: Fixing prompt_number property.") + (push value new-output) + (push :execution_count new-output)) + (t (progn (push value new-output) (push prop new-output))))) finally return new-output)) renamed-outputs))))