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.
This commit is contained in:
Carsten Dominik 2008-12-03 15:00:10 +01:00
parent c7fc66edbe
commit 6e31b9eace
2 changed files with 4 additions and 1 deletions

View File

@ -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.

View File

@ -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"