summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-12-03 15:00:10 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2008-12-03 15:00:10 +0100
commit6e31b9eace84bd41198f6082e51f596cd9bf5198 (patch)
treec9f7d94f4a985ce0caede32a99422fd47c0cbba9
parentc7fc66edbe6c0a477211b94955451c65ee0531fb (diff)
downloadorg-mode-6e31b9eace84bd41198f6082e51f596cd9bf5198.tar.gz
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.
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-archive.el2
2 files changed, 4 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6323520..5c5000b 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2008-12-03 Carsten Dominik <carsten.dominik@gmail.com>
+ * 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 323b70b..095acb1 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"