mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 09:01:40 -05:00
Implement ein-pager.el: help? works now
This commit is contained in:
parent
1a36c9bf3f
commit
93d8688928
2 changed files with 24 additions and 13 deletions
|
@ -76,12 +76,15 @@ Note that SLOT should not be quoted."
|
|||
(ein:log 'warn "Not in notebook buffer")))
|
||||
|
||||
(defun ein:notebook-new (notebook-id data &rest args)
|
||||
(apply #'make-ein:$notebook
|
||||
:notebook-id notebook-id
|
||||
:data data
|
||||
:msg-cell-map (make-hash-table :test 'equal)
|
||||
:nbformat 2
|
||||
args))
|
||||
(let ((notebook (apply #'make-ein:$notebook
|
||||
:notebook-id notebook-id
|
||||
:data data
|
||||
:msg-cell-map (make-hash-table :test 'equal)
|
||||
:nbformat 2
|
||||
args)))
|
||||
(setf (ein:$notebook-pager notebook)
|
||||
(ein:pager-new (format "*ein: %s/pager*" notebook-id)))
|
||||
notebook))
|
||||
|
||||
(defun ein:notebook-setup (&rest args)
|
||||
(setq ein:notebook (apply #'ein:notebook-new args)))
|
||||
|
@ -243,7 +246,7 @@ when the prefix argument is given."
|
|||
for text = (plist-get p :text)
|
||||
for source = (plist-get p :source)
|
||||
if (equal source "IPython.zmq.page.page")
|
||||
when (equal (ein:trim text) "")
|
||||
when (not (equal (ein:trim text) ""))
|
||||
do (let ((pager (ein:$notebook-pager notebook)))
|
||||
(ein:pager-clear pager)
|
||||
(ein:pager-expand pager)
|
||||
|
|
20
ein-pager.el
20
ein-pager.el
|
@ -25,19 +25,27 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'ansi-color)
|
||||
|
||||
(require 'ein-log)
|
||||
|
||||
(defun ein:pager-new (name)
|
||||
(get-buffer-create name))
|
||||
|
||||
(defun ein:pager-clear (pager)
|
||||
;; FIXME: implement!
|
||||
(ein:log 'info "`ein:pager-clear' is not implemented!"))
|
||||
(with-current-buffer pager
|
||||
(erase-buffer)))
|
||||
|
||||
(defun ein:pager-expand (pager)
|
||||
;; FIXME: implement!
|
||||
(ein:log 'info "`ein:pager-expand' is not implemented!"))
|
||||
(pop-to-buffer pager)
|
||||
(goto-char (point-min))
|
||||
(unless font-lock-mode
|
||||
(font-lock-mode)))
|
||||
|
||||
(defun ein:pager-append-text (pager text)
|
||||
;; FIXME: implement!
|
||||
(ein:log 'info "`ein:pager-append-text' is not implemented!"))
|
||||
(with-current-buffer pager
|
||||
(save-excursion
|
||||
(insert (ansi-color-apply text)))))
|
||||
|
||||
(provide 'ein-pager)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue