diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-01-31 23:59:50 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-02-01 00:01:25 +0100 |
commit | ffb08b28cd504ba543542d467788c4dc7dc9a69b (patch) | |
tree | 05e5d6089a0043637c9e399bd73d3d33475e179f | |
parent | 3aa355c037eb30b1e10155428942ffc787b3ae80 (diff) | |
download | org-mode-ffb08b28cd504ba543542d467788c4dc7dc9a69b.tar.gz |
ob-tangle: Fix :comment org behavior
* lisp/ob-tangle.el (org-babel-spec-to-string): Do not try to comment
empty text.
Reported-by: Titus von der Malsburg <malsburg@posteo.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/104637>
-rw-r--r-- | lisp/ob-tangle.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 399da66..a42dd1d 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -42,6 +42,7 @@ (declare-function org-link-escape "org" (text &optional table)) (declare-function org-open-link-from-string "org" (s &optional arg reference-buffer)) (declare-function org-store-link "org" (arg)) +(declare-function org-string-nw-p "org" (s)) (declare-function outline-previous-heading "outline" ()) (defvar org-link-types-re) @@ -367,8 +368,9 @@ that the appropriate major-mode is set. SPEC has the form: (if (stringp le) le (format "%S" le))))) '(start-line file link source-name))) (insert-comment (lambda (text) - (when (and comments (not (string= comments "no")) - (> (length text) 0)) + (when (and comments + (not (string= comments "no")) + (org-string-nw-p text)) (if org-babel-tangle-uncomment-comments ;; Plain comments: no processing. (insert text) |