From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Zhao Subject: Re: (org-insert-headline '(4)) should insert new headline before point Date: Sun, 20 Apr 2014 16:46:42 -0400 Message-ID: References: <87a9bk9guf.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbydQ-0005Pl-MP for emacs-orgmode@gnu.org; Sun, 20 Apr 2014 16:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WbydP-0005Ep-MU for emacs-orgmode@gnu.org; Sun, 20 Apr 2014 16:46:44 -0400 In-Reply-To: <87a9bk9guf.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode 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 wrote: > Hi York, > > York Zhao 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