Fix bug with multiple archiving to sibling.
commit6e31b9eace84bd41198f6082e51f596cd9bf5198
authorCarsten Dominik <carsten.dominik@gmail.com>
Wed, 3 Dec 2008 14:00:10 +0000 (3 15:00 +0100)
committerCarsten Dominik <carsten.dominik@gmail.com>
Wed, 3 Dec 2008 14:00:10 +0000 (3 15:00 +0100)
treec9f7d94f4a985ce0caede32a99422fd47c0cbba9
parentc7fc66edbe6c0a477211b94955451c65ee0531fb
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
lisp/org-archive.el