Bugfix: Make sure TODO keyword is inserted at the right position
commita2a7550591f6a05986f13e6bf1457e55832555e0
authorCarsten Dominik <carsten.dominik@gmail.com>
Tue, 10 Mar 2009 16:27:10 +0000 (10 17:27 +0100)
committerCarsten Dominik <carsten.dominik@gmail.com>
Tue, 10 Mar 2009 16:27:10 +0000 (10 17:27 +0100)
tree39114cb9e4c7c7d0199f7fa353c0db0a846dd894
parent9382d960cac15c9c54ce042e92ccb849275f3bff
Bugfix: Make sure TODO keyword is inserted at the right position

Wanrong Lin writes:

>  Suppose I have an org file with following lines:
>
>  * Test1
>  Test2
>
>  Now if I put the cursor at the beginning of the "Test2" line and
>  press "M-S-RET"  (Alt-Shift-Return on my machine), I got this:
>
>  * Test1
>  * Test2TODO
>
>  The "TODO" keyword was inserted at the end instead of the
>  beginning of the task text. This seems a bug to me.

Yes, this is a bug that occurs in the special case when the
heading stars are inserted in front of an existing line.  The
commit adds code to make sure the correct position is used.
lisp/ChangeLog
lisp/org.el