diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-27 23:26:38 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-27 23:26:38 +0100 |
commit | c1d7b2cda3b667f75331a9b8a0a71cfb26ee8ce5 (patch) | |
tree | 8787d826e985dcf4b8cbbe34e23d78ca549b5175 | |
parent | 68544f4f21f329a0349884686c12ddbc09d2507b (diff) | |
parent | d7940ae2a7ca01f01d17ba85e113ad7cc65b10ea (diff) | |
download | org-mode-c1d7b2cda3b667f75331a9b8a0a71cfb26ee8ce5.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/ob-core.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 2b6b8ed..00f0fe3 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2460,12 +2460,18 @@ in the buffer." (cond ((looking-at-p "^[ \t]*$") (point)) ;no result ((looking-at-p (format "^[ \t]*%s[ \t]*$" org-bracket-link-regexp)) (line-beginning-position 2)) - (t (save-excursion - (goto-char - (min (point-max) ;for narrowed buffers - (org-element-property :end (org-element-at-point)))) - (skip-chars-backward " \r\t\n") - (line-beginning-position 2))))) + (t + (let ((element (org-element-at-point))) + (if (memq (org-element-type element) + ;; Possible results types. + '(drawer export-block fixed-width item plain-list src-block + table)) + (save-excursion + (goto-char (min (point-max) ;for narrowed buffers + (org-element-property :end element))) + (skip-chars-backward " \r\t\n") + (line-beginning-position 2)) + (point)))))) (defun org-babel-result-to-file (result &optional description) "Convert RESULT into an `org-mode' link with optional DESCRIPTION. |