emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: York Zhao <gtdplatform@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: (org-insert-headline '(4)) should insert new headline before point
Date: Sun, 20 Apr 2014 16:46:42 -0400	[thread overview]
Message-ID: <CAD3zm22UAzgbmOmQoBcySFWTubAgY7EN1OxXYoLjyjPHS5BxHQ@mail.gmail.com> (raw)
In-Reply-To: <87a9bk9guf.fsf@bzg.ath.cx>

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 <bzg@gnu.org> wrote:
> Hi York,
>
> York Zhao <gtdplatform@gmail.com> 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	other threads:[~2014-04-20 20:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 22:59 (org-insert-headline '(4)) should insert new headline before point York Zhao
2014-04-05  3:01 ` York Zhao
2014-04-05  6:03   ` Grant Rettke
2014-04-17 14:21 ` Bastien
2014-04-20 20:46   ` York Zhao [this message]
2014-04-21  8:39     ` Nicolas Goaziou
2014-04-22  9:23     ` Bastien
2014-04-23 21:42       ` Leonard Randall
2014-04-23 21:48         ` Leonard Randall
2014-04-25  5:43           ` Eric Abrahamsen
2014-04-25  7:29           ` Bastien
2014-04-25 10:39             ` Leonard Randall
2014-04-29 12:35               ` Bastien
2014-04-29 13:59                 ` Leonard Randall
2014-04-29 14:20                   ` Bastien
2014-04-30  7:12                     ` Leonard Randall
2014-04-30  8:44                       ` Bastien
2014-04-30 17:03                         ` Leonard Randall
2014-05-04  2:37                           ` Leonard Randall
2014-05-21  1:43                             ` Bastien
2014-06-02 12:11                               ` Leonard Avery Randall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD3zm22UAzgbmOmQoBcySFWTubAgY7EN1OxXYoLjyjPHS5BxHQ@mail.gmail.com \
    --to=gtdplatform@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).