Commits

Ivan Andrus committed 9379979

Improve sage-view-enable-inline-output and sage-view-disable-inline-output

I think this fixes #28

Comments (0)

Files changed (1)

emacs/sage-view.el

 when `sage-view' mode is enabled and sage is running."
   (interactive)
   ;; older sage
-  (sage-send-command "pretty_print_default(True)" nil t)
+  (sage-send-command "if hasattr(sys.displayhook, 'set_display'): pretty_print_default(True)" nil t)
   ;; sage 5.12
   (sage-send-command "import IPython.core.ipapi; IPython.core.ipapi.get().magic('display typeset')" nil t)
+  ;; Sage 6.2
+  (sage-send-command "get_ipython().magic('display typeset')" nil t)
   (setq sage-view-inline-output-enabled t)
   (sage-view-update-modeline))
 
 when `sage-view' mode is enabled and sage is running."
   (interactive)
   ;; older sage
-  (sage-send-command "pretty_print_default(False)" nil t)
+  (sage-send-command "if hasattr(sys.displayhook, 'set_display'): pretty_print_default(False)" nil t)
   ;; sage 5.12
   (sage-send-command "import IPython.core.ipapi; IPython.core.ipapi.get().magic('display')" nil t)
+  ;; Sage 6.2
+  (sage-send-command "get_ipython().magic('display simple')" nil t)
   (setq sage-view-inline-output-enabled nil)
   (sage-view-update-modeline))