emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [Bug] incorrect indent of next heading after org-paste-subtree
Date: Tue, 30 Nov 2021 18:42:32 +0700	[thread overview]
Message-ID: <so52na$ble$1@ciao.gmane.io> (raw)

Another old bug with org-paste-subtree.

It make indentation of next heading wrong.

Consider the following document and follow described steps:

---- >8 ----
#+STARTUP: indent
Enable soft indent mode

Put to kill ring some text *without trailing newline*
that represents a subtree. In my case it is generated
by a browser extension.
#+begin_src elisp :results silent
   (kill-new "* Pasted Header\nPasted body")
#+end_src

Several levels of heading to make the problem apparent:
* H1
** H2
Ensure that the following "H3" heading is expanded,
put cursor to this line and try =C-c C-x C-y=
or [[elisp:(org-paste-subtree)]]
*** H3
:PROPERTIES:
:CUSTOM_ID: h3
:END:
Body
---- 8< ----

Actual result:

---- >8 ----
Several levels of heading to make the problem apparent:
* H1
*** H2
     Ensure that the following "H3" heading is expanded,
     put cursor to this line and try =C-c C-x C-y=
     or elisp:(org-paste-subtree)
***** Pasted Header
       Pasted body
***** H3
   :PROPERTIES:
   :CUSTOM_ID: h3
   :END:
   Body
---- 8< ----

Expected result

---- >8 ----
Several levels of heading to make the problem apparent:
* H1
*** H2
     Ensure that the following "H3" heading is expanded,
     put cursor to this line and try =C-c C-x C-y=
     or elisp:(org-paste-subtree)
***** Pasted Header
       Pasted body
***** H3
       :PROPERTIES:
       :CUSTOM_ID: h3
       :END:
       Body
---- 8< ----

Org mode version 9.5 (release_9.5-225-g494c20



             reply	other threads:[~2021-11-30 11:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 11:42 Max Nikulin [this message]
2022-05-01  2:31 ` Ihor Radchenko
2022-05-01 11:09   ` Max Nikulin
2022-05-02  4:00     ` Ihor Radchenko
2022-05-02  7:29       ` Max Nikulin
2022-05-02 23:32       ` Samuel Wales
2022-05-03  1:21         ` Ihor Radchenko
2022-07-17  8:52       ` Ihor Radchenko
2022-05-02  1:54 ` Samuel Wales

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='so52na$ble$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --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).