Browse Source

babel: Avoid addition of unnecessary ellipsis

* lisp/ob-table.el (org-babel-table-truncate-at-newline): Only add
"..." if there is something after the newline.
Dan Davison 14 years ago
parent
commit
b59074eca8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lisp/ob-table.el

+ 3 - 3
lisp/ob-table.el

@@ -57,9 +57,9 @@
   "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)) "...")
-    string))
+  (if (and (stringp string) (string-match "[\n\r]\\(.\\)?" string))
+      (concat (substring string 0 (match-beginning 0))
+	      (if (match-string 1 string) "...")) string))
 
 (defmacro sbe (source-block &rest variables)
   "Return the results of calling SOURCE-BLOCK with VARIABLES.