Modify archive file only if archive entries found.
--- a/.emacs-my Fri Feb 12 17:55:01 2016 +0200
+++ b/.emacs-my Fri Feb 12 18:04:15 2016 +0200
@@ -1643,12 +1643,13 @@
(let ( (last-command 'kill-region) )
(kill-region entry-beg entry-end))
)
- (with-current-buffer (find-file-noselect archive)
- (goto-char (point-max))
- (insert ?\n)
- (yank)
- (save-buffer))
- (save-buffer) ))))
+ (when (> (length (car kill-ring)) 0)
+ (with-current-buffer (find-file-noselect archive)
+ (goto-char (point-max))
+ (insert ?\n)
+ (yank)
+ (save-buffer))
+ (save-buffer) )))))
(defun my/org-archive (&optional prefix)
"Move all entries marked by `org-done-keywords' to archive