emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] (org-insert-headline '(4)) should insert new headline before poi


From: York Zhao
Subject: Re: [O] (org-insert-headline '(4)) should insert new headline before point
Date: Sun, 20 Apr 2014 16:46:42 -0400

Hi Bastian,

I apologize for missing your reply until I check in the folder "Sent".

I'm sorry that my bug report might not be clear enough. What I meant was that
with one prefix argument, the command `org-insert-heading' should insert a new
heading *before* the current heading, not after. In this regard the behavior
should be exactly the same as when this command is executed with no prefix
argument. I've written a test for this:

--8<---------------cut here---------------start------------->8---
(ert-deftest yz-test-org/org-insert-heading ()
  "Test `org-insert-heading' with one universal prefix argument."
  (org-test-with-temp-text
      "* Headline"
    (org-insert-heading '(4)) ; This test will pass without prefix argument
    (forward-line)
    (should (looking-at "\\* Headline"))))
--8<---------------cut here---------------end--------------->8---

This test fails on current org-mode version, but will pass if you test it on the
version shipped with Emacs 24.3. Also, if you change `(org-insert-heading '(4))'
to `(org-insert-heading)' this test will pass too.

Also, with current org-mode, if you replace `(forward-line)' in the test with
`(forward-line -1)' (moving to previous line) the test will pass, which means
that the new heading had been inserted after the current heading, not before.

Let me know if this is still not clear.


Thanks,

York

On Thu, Apr 17, 2014 at 10:21 AM, Bastien <address@hidden> wrote:
> Hi York,
>
> York Zhao <address@hidden> writes:
>
>> (org-insert-headline '(4)) used to insert new heading before point. But this 
>> had
>> broken recently. According to the docstring, this command inserts new
>> heading at the end of the parent subtree  ONLY if two universal prefix
>> arguments is given, not one. Here's the reproducer:
>
> Not sure what precise error you're reporting here, but I fixed the
> docstring in the master branch -- please have a look and report if
> the behavior differs from what the docstring says.
>
> Thanks,
>
> --
>  Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]