mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Merge branch 'master' of github.com:tkf/emacs-ipython-notebook
This commit is contained in:
commit
622b92eac3
5 changed files with 29 additions and 8 deletions
|
@ -131,6 +131,7 @@ Notebook
|
|||
.. el:variable:: ein:notebook-console-security-dir
|
||||
.. el:variable:: ein:notebook-console-executable
|
||||
.. el:variable:: ein:notebook-console-args
|
||||
.. el:variable:: ein:cell-traceback-level
|
||||
|
||||
Connect
|
||||
^^^^^^^
|
||||
|
|
19
ein-cell.el
19
ein-cell.el
|
@ -69,6 +69,18 @@
|
|||
"Face for stderr cell output"
|
||||
:group 'ein)
|
||||
|
||||
|
||||
;;; Customization
|
||||
|
||||
(defcustom ein:cell-traceback-level 1
|
||||
"Number of traceback stack to show.
|
||||
Hidden tracebacks are not discarded. You can always view them
|
||||
using the command `ein:notebook-view-traceback'."
|
||||
:type '(choice (integer :tag "Number of stack to show" 1)
|
||||
(const :tag "Show all traceback" nil))
|
||||
:group 'ein)
|
||||
|
||||
|
||||
|
||||
;;; EIEIO related utils
|
||||
|
||||
|
@ -643,7 +655,12 @@ Called from ewoc pretty printer via `ein:cell-insert-output'."
|
|||
(mapc (lambda (tb)
|
||||
(ein:cell-append-text tb)
|
||||
(ein:cell-append-text "\n"))
|
||||
(plist-get json :traceback))
|
||||
(let ((tb (plist-get json :traceback))
|
||||
(level ein:cell-traceback-level))
|
||||
(if (and level (> (- (length tb) 2) level))
|
||||
(cons "\nTruncated Traceback (Use C-c C-x to view full TB):"
|
||||
(last tb (1+ level)))
|
||||
tb)))
|
||||
(ein:insert-read-only "\n"))
|
||||
|
||||
(defmethod ein:cell-append-stream ((cell ein:codecell) json)
|
||||
|
|
|
@ -140,10 +140,6 @@ Create a cell if the buffer has none."
|
|||
|
||||
(add-hook 'ein:shared-output-mode-hook 'ein:truncate-lines-on)
|
||||
|
||||
(defun ein:truncate-lines-on ()
|
||||
"Set `truncate-lines' on (set it to `t')."
|
||||
(setq truncate-lines t))
|
||||
|
||||
|
||||
(provide 'ein-shared-output)
|
||||
|
||||
|
|
|
@ -128,6 +128,8 @@
|
|||
(define-derived-mode ein:traceback-mode fundamental-mode "ein:tb"
|
||||
(font-lock-mode))
|
||||
|
||||
(add-hook 'ein:traceback-mode-hook 'ein:truncate-lines-on)
|
||||
|
||||
(let ((map ein:traceback-mode-map))
|
||||
(define-key map (kbd "RET") 'ein:tb-jump-to-source-at-point-command)
|
||||
(define-key map "p" 'ein:tb-prev-item)
|
||||
|
|
11
ein-utils.el
11
ein-utils.el
|
@ -149,7 +149,7 @@ See: http://api.jquery.com/jQuery.ajax/"
|
|||
(json-read-from-string string)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Text property
|
||||
|
||||
(defun ein:propertize-read-only (string &rest properties)
|
||||
(apply #'propertize string 'read-only t 'front-sticky t properties))
|
||||
|
@ -217,7 +217,7 @@ Adapted from twittering-mode.el's `case-string'."
|
|||
clauses)))
|
||||
|
||||
|
||||
;;
|
||||
;;; Misc
|
||||
|
||||
(defun ein:plist-iter (plist)
|
||||
"Return list of (key . value) in PLIST."
|
||||
|
@ -318,8 +318,13 @@ NOTE: This function creates new list."
|
|||
(discard-input))
|
||||
answer))
|
||||
|
||||
|
||||
(defun ein:truncate-lines-on ()
|
||||
"Set `truncate-lines' on (set it to `t')."
|
||||
(setq truncate-lines t))
|
||||
|
||||
|
||||
;; utils.js compatible
|
||||
;;; utils.js compatible
|
||||
|
||||
(defun ein:utils-uuid ()
|
||||
"Return string with random (version 4) UUID.
|
||||
|
|
Loading…
Add table
Reference in a new issue