Support multiple worksheet in ein-org.el

This commit is contained in:
Takafumi Arakaki 2012-10-15 21:16:44 +02:00
parent 5da4a9eb5b
commit 5da71023d9

View file

@ -29,16 +29,26 @@
(require 'org) (require 'org)
(require 'ein-notebooklist) (require 'ein-notebooklist)
(defun* ein:org-goto-link (notebook -created-not-used-
&key worksheet-index
&allow-other-keys)
(if worksheet-index
(ein:notebook-worksheet-open-ith notebook worksheet-index
#'pop-to-buffer)
(pop-to-buffer (ein:notebook-buffer notebook)))
;; More to come here:
)
;;;###autoload ;;;###autoload
(defun ein:org-open (link-path) (defun ein:org-open (link-path)
"Open IPython notebook specified by LINK-PATH. "Open IPython notebook specified by LINK-PATH.
This function is to be used for FOLLOW function of This function is to be used for FOLLOW function of
`org-add-link-type'." `org-add-link-type'."
(destructuring-bind (&key url-or-port name (let ((link (read link-path)))
&allow-other-keys) (destructuring-bind (&key url-or-port name &allow-other-keys)
(read link-path) link
(ein:notebooklist-open-notebook-by-name name url-or-port))) (ein:notebooklist-open-notebook-by-name name url-or-port
#'ein:org-goto-link link))))
;;;###autoload ;;;###autoload
(defun ein:org-store-link () (defun ein:org-store-link ()
@ -64,6 +74,9 @@ node `(org) External links' and Info node `(org) Search options'"
(link (list :url-or-port (ein:get-url-or-port) (link (list :url-or-port (ein:get-url-or-port)
:name name)) :name name))
(description name)) (description name))
(ein:aif (ein:notebook-worksheet-index notebook)
(unless (= it 0)
(plist-put link :worksheet-index it)))
(org-store-link-props (org-store-link-props
:type "ipynb" :type "ipynb"
:link (let ((print-length nil) :link (let ((print-length nil)