From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oJjlGCkVXmTdRAEASxT56A (envelope-from ) for ; Fri, 12 May 2023 12:30:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eMTDGCkVXmRwNgAAauVa8A (envelope-from ) for ; Fri, 12 May 2023 12:30:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE8D439C97 for ; Fri, 12 May 2023 12:30:00 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxQ0a-0004Ec-Kn; Fri, 12 May 2023 06:28:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxQ0Z-0004Dx-OY for emacs-orgmode@gnu.org; Fri, 12 May 2023 06:28:19 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxQ0T-00067P-Nh for emacs-orgmode@gnu.org; Fri, 12 May 2023 06:28:19 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f22908a082so7966675e87.1 for ; Fri, 12 May 2023 03:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683887291; x=1686479291; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KPPf33Gud3GcZ11skKZJb6jTYGwJs+yCTUXlk9oHJf4=; b=mJpeiI4q6BnJM1EMAQiCb0B4wbIeuQrb3e9jGlSCxnA77Zd2FAOdRf6x9nZLDTMayC IxPQ+l9Q8dJQibmvA4zRCiF9S0ZRd2JQu4DvSCVhemLXguOGbt/RMMNkfrLVJY58HlVo GH+hMIyhtp0NtU57Zbc58FBxfEaqcRNGToLhLNvLLhky5kYOZnBHms6MQmeDH/VzKBwQ gYwiMFQnyVFJxur4FcpTlEe/Uby9U7Vg6fW6L9kNRznZH35yAdLaqByNXv7+MYVTRf4f vHq9K8B64VSPqOtzxhHzybEbXWSqqm2w5dpW17mjS/cvFHchFo5r0BIz0+6ARrlitIZu Vb0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683887291; x=1686479291; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KPPf33Gud3GcZ11skKZJb6jTYGwJs+yCTUXlk9oHJf4=; b=cWp3CVnlNJL4GQwq3Ocr4UmTl3t4JlW88v0yAPt7GJbIw3b2XLR+wVmh+n938wIBsw YITrEzGIRYxYoaBd9Z0clKCP/9K3ILHsWFIa9fBlhl7gyZpy0Vs+NoPOcYNwuS4ZVnk7 GSM1ukzvYE5G0dxqIKE3O0Qs0w10n93FK0T2Oi2UbeCsbjKN6+75mHAPmwu8l/XxCSP+ ihwEIOtJBoCX6tabs8QopchfiZR3fZ8r+XkxWD2269u+EWeGg2bN/HcuqcJKCaoguiwv l2mjUjcE2StXETMZ9qczISw+La3Tvj1nyebrI9l1VpY2QzasVYDa1FIZuaFsAGJfWdRX cc6g== X-Gm-Message-State: AC+VfDzhuzVmm4My6Xi1FQ+V+WnfbfqR6bgbi7CYyUmM6wWXgRKrEMmS 3YWb+KDVFkChNDWfCbrud6QItYs7jyiy6x29+F4W5YH6 X-Google-Smtp-Source: ACHHUZ4OaOhrJuD2vl9yl7+rTHxpFeSnn02perTwihB9kU9hWFtEExzRyFshLKWWMBhn8bSylL2U83aJiHE61pNcFFc= X-Received: by 2002:ac2:4436:0:b0:4ec:85f6:5bf3 with SMTP id w22-20020ac24436000000b004ec85f65bf3mr3317440lfl.21.1683887290783; Fri, 12 May 2023 03:28:10 -0700 (PDT) MIME-Version: 1.0 References: <87wn1f41ji.fsf@localhost> In-Reply-To: <87wn1f41ji.fsf@localhost> From: Michael Dauer Date: Fri, 12 May 2023 12:27:59 +0200 Message-ID: Subject: Re: BUG: (org-insert-subheading) fails when on true begin of line (first star) of heading To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000cf1e8405fb7c8f3e" Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=mick.dauer@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683887401; a=rsa-sha256; cv=none; b=ljiRH22r+wzuZT0hMiGLyf7brLKbD+DYiKhj0wF4qGPiHrBHqFjYwR0FNQuis7Uic3IkRV Ua+XA8ha27vpreC+A2YKf2B1UZ9Te0FHcUx7tEPMFbwzblDRbJkyFw65xivTW1FahjP8bf GIx805dSwswc2rqnP/btyOtskZRZoThu3qJ1zy5rov4M01hTL5TB0ISa7a76ZrGha/fWfA MjSbqpfmgN1l5lZKakJFKoOEpaLx9NrjCyRlfnmalpjADx6ZwR4kzfFBXNNF7DkJMLAUao bpamhUAI9CYCcOcPlN4/6WbBmE/shU5JI6bOnXYEzIbJiuWJcLe56X6hQNkE+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=mJpeiI4q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683887401; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KPPf33Gud3GcZ11skKZJb6jTYGwJs+yCTUXlk9oHJf4=; b=qoiI0I6agmt0IjJxtN6n13D9RwYmWEFf4Hiwr9aMccWRwr9u0FV61+GDCIUvRVCAQESQGQ 0WSSfg766tjR0nbyLhmNFq/F0ck5tkHByZkLxel0SsJ21WuHjp96qvUVELO/UOT2+XWWNZ w35vsEC1evoq9ysmHu9ra1nmo53fRyGpguLWW8X5lT1YzxvpzBGHnbjQOMF+9ghz+GmkQ2 p7ujamaQPuraYv6Xz2KS0CpvT+1vezii8FV5KlN2zeurZDdnZSzHuBZqRi+8d6oG2xwOZ4 C60k9i0fkpbMMGpaxaLLCMr0rdtc0SOmTymPoKkWtKFVV/FmlPnusGUyWXn3mQ== X-Migadu-Spam-Score: -9.86 X-Spam-Score: -9.86 X-Migadu-Queue-Id: DE8D439C97 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=mJpeiI4q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: yC2JrCWTt9Hq --000000000000cf1e8405fb7c8f3e Content-Type: text/plain; charset="UTF-8" I understand that it's behavior is derived from org-insert-heading. But IMO that does not make sense for this function, advice all that it is taking the current indentation level as basis to devote the new heading as child of the previous heading. It e.g. created a "orphan" grand child instead of a child. Not important for me, just strangely non-intuitive. Ihor Radchenko schrieb am Do., 11. Mai 2023, 12:11: > Michael Dauer writes: > > > Example > > * h1 > > <>** h11 > > > > brings: > > * h1 > > *** <> > > ** h11 > > This is expected. `org-insert-subheading' inherits what > `org-insert-heading' does: > > Insert a new heading or an item with the same depth at point. > > *************************************************************** > If point is at the beginning of a heading, insert a new heading > or a new headline above the current one. When at the beginning > of a regular line of text, turn it into a heading. > *************************************************************** > > If point is in the middle of a line, split it and create a new > headline with the text in the current line after point (see > org-M-RET-may-split-line on how to modify this behavior). As > a special case, on a headline, splitting can only happen on the > title itself. E.g., this excludes breaking stars or tags. > > With a C-u prefix, set org-insert-heading-respect-content to > a non-nil value for the duration of the command. This forces the > insertion of a heading after the current subtree, independently > on the location of point. > > With a C-u C-u prefix, insert the heading at the end of the tree > above the current heading. For example, if point is within a > 2nd-level heading, then it will insert a 2nd-level heading at > the end of the 1st-level parent subtree. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --000000000000cf1e8405fb7c8f3e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I understand that it's behavior is derived from = org-insert-heading. But IMO that does not make sense for this function, adv= ice all that it is taking the current indentation level as basis to devote = the new heading as child of the previous heading. It e.g. created a "o= rphan" grand child instead of a child.=C2=A0

Not important for = me, just strangely non-intuitive.=C2=A0

Michael Dauer <mick.dauer@gmail.com> writes:

> Example
> * h1
> <>** h11
>
> brings:
> * h1
> *** <>
> ** h11

This is expected. `org-insert-subheading' inherits what
`org-insert-heading' does:

=C2=A0 =C2=A0 Insert a new heading or an item with the same depth at point.=

=C2=A0 =C2=A0 *************************************************************= **
=C2=A0 =C2=A0 If point is at the beginning of a heading, insert a new headi= ng
=C2=A0 =C2=A0 or a new headline above the current one.=C2=A0 When at the be= ginning
=C2=A0 =C2=A0 of a regular line of text, turn it into a heading.
=C2=A0 =C2=A0 *************************************************************= **

=C2=A0 =C2=A0 If point is in the middle of a line, split it and create a ne= w
=C2=A0 =C2=A0 headline with the text in the current line after point (see =C2=A0 =C2=A0 org-M-RET-may-split-line on how to modify this behavior).=C2= =A0 As
=C2=A0 =C2=A0 a special case, on a headline, splitting can only happen on t= he
=C2=A0 =C2=A0 title itself.=C2=A0 E.g., this excludes breaking stars or tag= s.

=C2=A0 =C2=A0 With a C-u prefix, set org-insert-heading-respect-content to<= br> =C2=A0 =C2=A0 a non-nil value for the duration of the command.=C2=A0 This f= orces the
=C2=A0 =C2=A0 insertion of a heading after the current subtree, independent= ly
=C2=A0 =C2=A0 on the location of point.

=C2=A0 =C2=A0 With a C-u C-u prefix, insert the heading at the end of the t= ree
=C2=A0 =C2=A0 above the current heading.=C2=A0 For example, if point is wit= hin a
=C2=A0 =C2=A0 2nd-level heading, then it will insert a 2nd-level heading at=
=C2=A0 =C2=A0 the end of the 1st-level parent subtree.

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mo= de>,
or support my work at <https://liberapay.com/yantar92>
--000000000000cf1e8405fb7c8f3e--