From 6e31b9eace84bd41198f6082e51f596cd9bf5198 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 3 Dec 2008 15:00:10 +0100 Subject: [PATCH] Fix bug with multiple archiving to sibling. Calling `org-archive-to-archive-sibling' caused problems when used several times in a row. The new killed subtree would be appended to the current head of the kill-ring, instead of being pushed there. The reason for this is that the command `kill-region', which is called by `org-cut-subtree' changes the variable `this-command', so that during the next archive command, `kill-region' will think that the previous command was also a kill and do the append. Normally this is wanted, to make sure that several kill commands create one big yank string. But in this case it has to be avoided. The patch fixes the problem by let-binding (and therefore protecting) the value of `this-command' around the call to `org-cut-subtree'. Reported by Bernt Hansen. --- lisp/ChangeLog | 3 +++ lisp/org-archive.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 632352076..5c5000ba5 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2008-12-03 Carsten Dominik + * org-archive.el (org-archive-to-archive-sibling): Protect + `this-command' to avoid appending kills during archiving. + * org-exp.el (org-export-with-priority): New variable. (org-export-add-options-to-plist): Use `org-export-plist-vars' instead of internal list of strings and properties. diff --git a/lisp/org-archive.el b/lisp/org-archive.el index 323b70b03..095acb1ca 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -345,7 +345,7 @@ sibling does not exist, it will be created at the end of the subtree." (org-end-of-subtree t t) (save-excursion (goto-char pos) - (org-cut-subtree)) + (let ((this-command this-command)) (org-cut-subtree))) (org-paste-subtree (org-get-valid-level level 1)) (org-set-property "ARCHIVE_TIME" -- 2.11.4.GIT