From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0KqANoqzRGFyawEAgWs5BA (envelope-from ) for ; Fri, 17 Sep 2021 17:26:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iPY6MoqzRGGbGQAAB5/wlQ (envelope-from ) for ; Fri, 17 Sep 2021 15:26:02 +0000 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 101EB12CEC for ; Fri, 17 Sep 2021 17:26:02 +0200 (CEST) Received: from localhost ([::1]:47184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRFkX-0001py-7q for larch@yhetil.org; Fri, 17 Sep 2021 11:26:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRFk4-0001po-Ub for emacs-orgmode@gnu.org; Fri, 17 Sep 2021 11:25:33 -0400 Received: from au.jabatus.fr ([109.234.163.49]:45357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRFk2-0000Y1-FJ for emacs-orgmode@gnu.org; Fri, 17 Sep 2021 11:25:32 -0400 X-MailPropre-MailScanner-From: victor@svictor.net X-MailPropre-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.45, required 5, autolearn=disabled, BAYES_05 1.50, GMAILCOM 0.01, RCVD_IN_DNSWL_HI 0.01, SPF_HELO_PASS -0.10, SPF_PASS -1.00, SUKEN_2 0.01, SUKE_2 0.01, TOGMAIL 0.01) X-MailPropre-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailPropre-MailScanner-ID: 7ED14100515.AC243 X-MailPropre-MailScanner-Information: Please contact the ISP for more information DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=svictor.net ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6nEvYM48aXqdGSdF9CirQkpr6iuBRMkMWTEHXwpA89M=; b=YZCcsmUVbkUNkKN6A/vbAGVjHE 9xlHGpF803IJgTcn7vIniGAnL+t4ID/ML+3uw0/JLTTSQc5ro9MTVjoirsVF4wYPFHe1TpBSMbFqi 05A/tgGaxeFzB5Fxl3Le8oP3yTMnPMqsfTcKfsHp09HT3yx65Z6nSfTCyvPMFC0X2zWg=; References: <87lf4594t3.fsf@svictor.net> <87y285vats.fsf@gmail.com> <87ilz98s5a.fsf@svictor.net> <875yv4uvqr.fsf@gmail.com> From: "Victor A. Stoichita" To: Marco Wahl Subject: Re: behavior of (org-insert-heading-respect-content) In-reply-to: <875yv4uvqr.fsf@gmail.com> Date: Fri, 17 Sep 2021 17:23:50 +0200 Message-ID: <87czp74455.fsf@svictor.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - pam.o2switch.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - svictor.net X-Get-Message-Sender-Via: pam.o2switch.net: authenticated_id: victor@svictor.net X-Authenticated-Sender: pam.o2switch.net: victor@svictor.net X-Source: X-Source-Args: X-Source-Dir: Received-SPF: pass client-ip=109.234.163.49; envelope-from=victor@svictor.net; helo=au.jabatus.fr X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631892362; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=6nEvYM48aXqdGSdF9CirQkpr6iuBRMkMWTEHXwpA89M=; b=DPt44fsDoTrcVInkPla+bPyOyH/GVFC+Jx9LxtEQuAgep8NmLS1zRsr9/TDK8WiTtJyYx+ opPNmxZyaO7xYF2WUaqGv+664VEi9vje39/P1GGiu/py88CU1xV5BiuVzGQBDV68AqTgXV ovDJYmobtXkgpnW4OlGlaHEO/I16SOthZ4dDtp7fg7RBmxKMPiodNpLwRIHU3H5lZaGU12 XnCy1vDR2+ykwGPHHgrU5EcT5iRQBDMO6Xu7WvnmdjElluRFWjM6RCv2H7rfBD7fnwb3uq vykC9BiqIZRmiVZNvZY2+9le5WerI/s2eFeVrbfp05qwrS4s0+dmkFR1eZ7+sw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631892362; a=rsa-sha256; cv=none; b=OfdbEGDiI68iu2IoHYMiUayWLTJv5Q0gPgQwoDZ/nlsEdA4WTWqS8VILZ7vNZXwQ36xtjq 32ssW7yZUDnHVAyFFtqw2oRXJtMoskDYJgxkzYV4QvtjGYtNmCpT4z4ODQW56Q6hiCTpIa RWYvzIsJdA9HiL1A0tdi76/biS9IX9KB1oon/mqq/OAarj70MB00xs5HxNtPVV6pAF5/IB 6oco64TMByCnwvINjFfRQlqXx9TQUG+Te/sLsgenyT2G73xa0+MB8Rqnau+N8U4AL2Tf9r h4Zm0yDqlBgja2q9tbRmtmlvcPnvcwxhBymdDFQDXh2Gr4BcdfRyIqy9hiiokQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=svictor.net header.s=default header.b=YZCcsmUV; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=svictor.net header.s=default header.b=YZCcsmUV; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 101EB12CEC X-Spam-Score: -1.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: TLa01psWxQdY Le 13 Sep 2021, Marco Wahl a =C3=A9crit : > As far is I see it, the intended behavior of > org-insert-heading-respect-content with point before the first heading > is to > > - insert the new heading immediately before the first heading. Respect > the content! Hi Marco=C2=A0! I agree with you. But this does not work. Say I have a buffer with this con= tent=C2=A0: --8<---------------cut here---------------start------------->8--- put point HERE and C- Some more stuff=20 * Heading content --8<---------------cut here---------------end--------------->8--- When point is at HERE and I C-, org inserts a new asterisk on the after "stuff", but on the same line =E2=86=92 not a proper heading. > > - If there is no heading at all in the file the heading shall be > inserted at the bottom of the file. Yes. But I get the same behavior with=20 --8<---------------cut here---------------start------------->8--- put point HERE and C- Some more stuff=20 --8<---------------cut here---------------end--------------->8--- The asterisk is inserted right after "stuff", on the same line =E2=86=92 not a proper heading. > > Do we agree on the desired behavior of > org-insert-heading-respect-content? Yes, we do! > > With your proposition the respect for the content gets lost, > doesn't it? Yes, you=E2=80=99re right. It currently does not respect the content before first heading. Therefore it=E2=80=99s not a fix for the behavior of org-insert-heading-respect-content. It=E2=80=99s just the quickest workaround I=E2=80=99ve come up with to make= my own function work (in my use-case, when I call that function, either point is at point-min in a brand new buffer, or point is below the first heading). Regards, Victor