From 3d1ae7b7f2592fac95072882be08aa1ffd798531 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 3 Nov 2012 00:25:13 +0100 Subject: [PATCH] org-export: Do not push empty strings to kill ring * contrib/lisp/org-export.el (org-export-as): Do not push empty strings to kill ring. --- contrib/lisp/org-export.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el index f1965e7aa..210cdd906 100644 --- a/contrib/lisp/org-export.el +++ b/contrib/lisp/org-export.el @@ -2651,7 +2651,8 @@ Return code as a string." info (org-export-collect-tree-properties tree info))) ;; Eventually transcode TREE. Wrap the resulting string into ;; a template, if required. Finally call final-output filter. - (let* ((body (org-element-normalize-string (org-export-data tree info))) + (let* ((body (org-element-normalize-string + (or (org-export-data tree info) ""))) (template (cdr (assq 'template (plist-get info :translate-alist)))) (output (org-export-filter-apply-functions @@ -2660,7 +2661,8 @@ Return code as a string." (funcall template body info)) info))) ;; Maybe add final OUTPUT to kill ring, then return it. - (when org-export-copy-to-kill-ring (org-kill-new output)) + (when (and org-export-copy-to-kill-ring (org-string-nw-p output)) + (org-kill-new output)) output))))) (defun org-export-to-buffer -- 2.11.4.GIT