Cosmetic changes only: shortening lines to fit my screen.

This commit is contained in:
Dan Davison 2009-07-11 23:59:04 -04:00
parent 08eba0ceea
commit c1f8de5eec
8 changed files with 31 additions and 21 deletions

View File

@ -86,8 +86,10 @@ called by `org-babel-execute-src-block'."
(setq session (or session "*R*"))
(if (org-babel-comint-buffer-livep session)
session
(save-window-excursion (R) (rename-buffer (if (bufferp session) (buffer-name session)
(if (stringp session) session (buffer-name)))) (current-buffer)))))
(save-window-excursion
(R)
(rename-buffer (if (bufferp session) (buffer-name session)
(if (stringp session) session (buffer-name)))) (current-buffer)))))
(defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'")
(defvar org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"")

View File

@ -104,7 +104,8 @@ then create. Return the initialized session."
(let* ((session (if session (intern session) :default))
(python-buffer (org-babel-python-session-buffer session)))
(run-python)
(setq org-babel-python-buffers (cons (cons session python-buffer) (assq-delete-all session org-babel-python-buffers)))
(setq org-babel-python-buffers (cons (cons session python-buffer)
(assq-delete-all session org-babel-python-buffers)))
session)))
(defun org-babel-python-initiate-session (&optional session)

View File

@ -110,7 +110,8 @@ then create. Return the initialized session."
(when newp
(setq sh-buffer (current-buffer))
(org-babel-comint-wait-for-output sh-buffer))
(setq org-babel-sh-buffers (cons (cons session sh-buffer) (assq-delete-all session org-babel-sh-buffers)))
(setq org-babel-sh-buffers (cons (cons session sh-buffer)
(assq-delete-all session org-babel-sh-buffers)))
session)))
(defun org-babel-sh-initiate-session (&optional session)

View File

@ -71,8 +71,9 @@ during execution of body."
;; wait for end-of-evaluation indicator
(while (progn
(goto-char comint-last-input-end)
(not (save-excursion (and (re-search-forward comint-prompt-regexp nil t)
(re-search-forward (regexp-quote ,eoe-indicator) nil t)))))
(not (save-excursion
(and (re-search-forward comint-prompt-regexp nil t)
(re-search-forward (regexp-quote ,eoe-indicator) nil t)))))
(accept-process-output (get-buffer-process (current-buffer)))
;; ;; thought this would allow async background running, but I was wrong...
;; (run-with-timer .5 .5 'accept-process-output (get-buffer-process (current-buffer)))
@ -80,7 +81,9 @@ during execution of body."
;; remove filter
(remove-hook 'comint-output-filter-functions 'my-filt)))
;; remove echo'd FULL-BODY from input
(if (and ,remove-echo (string-match (replace-regexp-in-string "\n" "\r\n" (regexp-quote ,full-body)) string-buffer))
(if (and ,remove-echo
(string-match
(replace-regexp-in-string "\n" "\r\n" (regexp-quote ,full-body)) string-buffer))
(setq raw (substring string-buffer (match-end 0))))
(split-string string-buffer comint-prompt-regexp))))

View File

@ -57,8 +57,9 @@ add files to this list use the `org-babel-lob-ingest' command."
(assq-delete-all source-name org-babel-library-of-babel)))))))
(org-babel-lob-ingest ;; actually add the source-blocks defined in library-of-babel.org
(expand-file-name "library-of-babel.org"
(expand-file-name ".." (file-name-directory (or load-file-name buffer-file-name)))))
(expand-file-name
"library-of-babel.org"
(expand-file-name ".." (file-name-directory (or load-file-name buffer-file-name)))))
;; functions for executing lob one-liners

View File

@ -68,7 +68,8 @@ and find it's value using `org-babel-ref-resolve-reference'.
Return a list with two elements. The first element of the list
will be the name of the variable, and the second will be an
emacs-lisp representation of the value of the variable."
(if (string-match "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*" assignment)
(if (string-match
"[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*" assignment)
(let ((var (match-string 1 assignment))
(ref (match-string 2 assignment)))
(cons (intern var)

View File

@ -76,14 +76,15 @@ results
(unless (stringp source-block) (setq source-block (symbol-name source-block)))
(org-babel-table-truncate-at-newline ;; org-table cells can't be multi-line
(if (and source-block (> (length source-block) 0))
(let ((params (eval `(org-babel-parse-header-arguments
(concat ":var results="
,source-block
"("
(mapconcat (lambda (var-spec)
(format "%S=%s" (first var-spec) (second var-spec)))
',variables ", ")
")")))))
(let ((params
(eval `(org-babel-parse-header-arguments
(concat ":var results="
,source-block
"("
(mapconcat (lambda (var-spec)
(format "%S=%s" (first var-spec) (second var-spec)))
',variables ", ")
")")))))
(org-babel-execute-src-block t (list "emacs-lisp" "results" params)))
"")))

View File

@ -512,11 +512,11 @@ parameters when merging lists."
(:results
;; maintain list of unique :results specifications
(setq results (org-uniquify (append (split-string (cdr pair)) results))))
(t
(t
;; replace: this covers e.g. :session
(setq params (cons pair (assq-delete-all (car pair) params))))))
plist))
plists)
plist))
plists)
(setq vars (mapcar (lambda (pair) (format "%s=%s" (car pair) (cdr pair))) vars))
(while vars (setq params (cons (cons :var (pop vars)) params)))
(cons (cons :results (mapconcat 'identity results " ")) params)))