From c1f8de5eec6d20c8c8a199503f0c3fc7922d3fb9 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 11 Jul 2009 23:59:04 -0400 Subject: [PATCH] Cosmetic changes only: shortening lines to fit my screen. --- lisp/langs/org-babel-R.el | 6 ++++-- lisp/langs/org-babel-python.el | 3 ++- lisp/langs/org-babel-sh.el | 3 ++- lisp/org-babel-comint.el | 9 ++++++--- lisp/org-babel-lob.el | 5 +++-- lisp/org-babel-ref.el | 3 ++- lisp/org-babel-table.el | 17 +++++++++-------- lisp/org-babel.el | 6 +++--- 8 files changed, 31 insertions(+), 21 deletions(-) diff --git a/lisp/langs/org-babel-R.el b/lisp/langs/org-babel-R.el index 30db605c6..c085f917c 100644 --- a/lisp/langs/org-babel-R.el +++ b/lisp/langs/org-babel-R.el @@ -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\"") diff --git a/lisp/langs/org-babel-python.el b/lisp/langs/org-babel-python.el index e7d9a2aff..981a3f545 100644 --- a/lisp/langs/org-babel-python.el +++ b/lisp/langs/org-babel-python.el @@ -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) diff --git a/lisp/langs/org-babel-sh.el b/lisp/langs/org-babel-sh.el index 3cb734165..1218dfffc 100644 --- a/lisp/langs/org-babel-sh.el +++ b/lisp/langs/org-babel-sh.el @@ -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) diff --git a/lisp/org-babel-comint.el b/lisp/org-babel-comint.el index 9e068743c..ac9e989a5 100644 --- a/lisp/org-babel-comint.el +++ b/lisp/org-babel-comint.el @@ -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)))) diff --git a/lisp/org-babel-lob.el b/lisp/org-babel-lob.el index 040f0dd9e..5c45947c6 100644 --- a/lisp/org-babel-lob.el +++ b/lisp/org-babel-lob.el @@ -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 diff --git a/lisp/org-babel-ref.el b/lisp/org-babel-ref.el index 5a4c6b83b..31b22b2f0 100644 --- a/lisp/org-babel-ref.el +++ b/lisp/org-babel-ref.el @@ -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) diff --git a/lisp/org-babel-table.el b/lisp/org-babel-table.el index 5830d71a0..04ff35ce6 100644 --- a/lisp/org-babel-table.el +++ b/lisp/org-babel-table.el @@ -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))) ""))) diff --git a/lisp/org-babel.el b/lisp/org-babel.el index 7cb6ade4b..2119dfe0d 100644 --- a/lisp/org-babel.el +++ b/lisp/org-babel.el @@ -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)))