summaryrefslogtreecommitdiff
path: root/lisp/ob-table.el
diff options
context:
space:
mode:
authorS├ębastien Delafond <sdelafond@gmail.com>2016-11-07 10:41:54 +0100
committerS├ębastien Delafond <sdelafond@gmail.com>2016-11-07 10:41:54 +0100
commit1a7cd65ca362047cd97d4127d49108994baebc6c (patch)
treef18735f3b77120ef2e91043f2f662b03e47ccbb0 /lisp/ob-table.el
parent55074078ca876273e3fa58ee6838cba90d2b6100 (diff)
parentec84430cf4e09ba25ec675debdf802bc28111e06 (diff)
Merge tag 'upstream/9.0'
Upstream version 9.0
Diffstat (limited to 'lisp/ob-table.el')
-rw-r--r--lisp/ob-table.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/ob-table.el b/lisp/ob-table.el
index 6e6d7ac..efee5b7 100644
--- a/lisp/ob-table.el
+++ b/lisp/ob-table.el
@@ -1,4 +1,4 @@
-;;; ob-table.el --- support for calling org-babel functions from tables
+;;; ob-table.el --- Support for Calling Babel Functions from Tables -*- lexical-binding: t; -*-
;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
@@ -23,8 +23,8 @@
;;; Commentary:
-;; Should allow calling functions from org-mode tables using the
-;; function `org-sbe' as so...
+;; Should allow calling functions from Org tables using the function
+;; `org-sbe' as so...
;; #+begin_src emacs-lisp :results silent
;; (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
@@ -55,13 +55,15 @@
;;; Code:
(require 'ob-core)
+(declare-function org-trim "org" (s &optional keep-lead))
+
(defun org-babel-table-truncate-at-newline (string)
"Replace newline character with ellipses.
If STRING ends in a newline character, then remove the newline
character and replace it with ellipses."
(if (and (stringp string) (string-match "[\n\r]\\(.\\)?" string))
(concat (substring string 0 (match-beginning 0))
- (if (match-string 1 string) "...")) string))
+ (when (match-string 1 string) "...")) string))
(defmacro org-sbe (source-block &rest variables)
"Return the results of calling SOURCE-BLOCK with VARIABLES.
@@ -142,7 +144,7 @@ as shown in the example below.
nil (list "emacs-lisp" "results" params)
'((:results . "silent"))))
"")))
- (org-babel-trim (if (stringp result) result (format "%S" result)))))))
+ (org-trim (if (stringp result) result (format "%S" result)))))))
(provide 'ob-table)