diff options
author | Bastien Guerry <bzg@altern.org> | 2012-01-31 09:27:47 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-01-31 09:27:47 +0100 |
commit | 1ec188b00a25ab9c3316b36c6b0da148a4f989ab (patch) | |
tree | c5ef7c9459a7a242999ecb7be10b773c8e0b9dc0 | |
parent | d9ac2ffa37fe0f7f99890c1be565bb223ce50011 (diff) | |
parent | 900b988742f52cf88ae976b89587591a52709a53 (diff) | |
download | org-mode-1ec188b00a25ab9c3316b36c6b0da148a4f989ab.tar.gz |
Merge branch 'maint' of orgmode.org:org-mode into maint
-rw-r--r-- | lisp/ob-R.el | 3 | ||||
-rw-r--r-- | lisp/ob.el | 2 | ||||
-rw-r--r-- | testing/lisp/test-ob.el | 66 |
3 files changed, 69 insertions, 2 deletions
diff --git a/lisp/ob-R.el b/lisp/ob-R.el index d8c3d6b..05e3f48 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -279,7 +279,8 @@ last statement in BODY, as elisp." (with-temp-buffer (insert (org-babel-chomp body)) (let ((ess-local-process-name - (process-name (get-buffer-process session)))) + (process-name (get-buffer-process session))) + (ess-eval-visibly-p nil)) (ess-eval-buffer nil))) (let ((tmp-file (org-babel-temp-file "R-"))) (org-babel-comint-eval-invisibly-and-wait-for-file @@ -2150,7 +2150,7 @@ block but are passed literally to the \"example-block\"." (with-temp-buffer (insert body) (goto-char (point-min)) (setq index (point)) - (while (and (re-search-forward "<<\\([^ \t].+?[^ \t]\\|[^ \t]\\)>>" + (while (and (re-search-forward "<<\\([^ \t\n].+?[^ \t\n]\\|[^ \t\n]\\)>>" nil t)) (save-match-data (setf source-name (match-string 1))) (save-match-data (setq evaluate (string-match "\(.*\)" source-name))) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index c819fac..988ef33 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -588,6 +588,72 @@ on two lines (org-babel-balanced-split ":a 1 :b [2 3] :c (4 :d (5 6))" '((32 9) . 58))))) +(ert-deftest test-org-babel/inline-src_blk-preceded-punct-preceded-by-point () + (let ((test-line ".src_emacs-lisp[ :results verbatim ]{ \"x\" }")) + (org-test-with-temp-text + test-line + (forward-char 1) + (org-ctrl-c-ctrl-c) + (should (string= (concat test-line " =\"x\"=") + (buffer-substring-no-properties + (point-min) (point-max))))))) + +(ert-deftest test-org-babel/inline-src-block-preceded-by-equality () + (let ((test-line "=src_emacs-lisp[ :results verbatim ]{ \"x\" }")) + (org-test-with-temp-text + test-line + (forward-char 1) + (org-ctrl-c-ctrl-c) + (should (string= (concat test-line " =\"x\"=") + (buffer-substring-no-properties + (point-min) (point-max))))))) + +(ert-deftest test-org-babel/inline-src-block-enclosed-within-parenthesis () + (let ((test-line "(src_emacs-lisp[ :results verbatim ]{ \"x\" }")) + (org-test-with-temp-text + (concat test-line ")") + (forward-char 1) + (org-ctrl-c-ctrl-c) + (should (string= (concat test-line " =\"x\"=)" ) + (buffer-substring-no-properties + (point-min) (point-max))))))) + +(ert-deftest test-org-babel/inline-src-block-enclosed-within-parenthesis () + (let ((test-line "{src_emacs-lisp[ :results verbatim ]{ \"x\" }")) + (org-test-with-temp-text + (concat test-line "}") + (forward-char 1) + (org-ctrl-c-ctrl-c) + (should (string= (concat test-line " =\"x\"=}") + (buffer-substring-no-properties + (point-min) (point-max))))))) + +(ert-deftest test-org-babel/inline-src_blk-preceded-by-letter () + "Test inline source block invalid where preceded by letter" + + ;; inline-src-blk preceded by letter + (org-test-with-temp-text + "asrc_emacs-lisp[ :results verbatim ]{ \"x\" }" + (forward-char 1) + (let ((error-result + (should-error + (org-ctrl-c-ctrl-c)))) + (should (equal `(error "C-c C-c can do nothing useful at this location") + error-result))))) + +(ert-deftest test-org-babel/inline-src_blk-preceded-by-number () + "Test inline source block invalid where preceded by number" + + ;; inline-src-blk preceded by number + (org-test-with-temp-text + "0src_emacs-lisp[ :results verbatim ]{ \"x\" }" + (forward-char 1) + (let ((error-result + (should-error + (org-ctrl-c-ctrl-c)))) + (should (equal `(error "C-c C-c can do nothing useful at this location") + error-result))))) + (provide 'test-ob) ;;; test-ob ends here |