From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CLpwImDdjmCmPAEAgWs5BA (envelope-from ) for ; Sun, 02 May 2021 19:12:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +KkcHmDdjmBYXwAAB5/wlQ (envelope-from ) for ; Sun, 02 May 2021 17:12:00 +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 0D7CD130A8 for ; Sun, 2 May 2021 19:12:00 +0200 (CEST) Received: from localhost ([::1]:57840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldFdP-0007aT-5f for larch@yhetil.org; Sun, 02 May 2021 13:11:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldFcl-0007Z8-V0 for emacs-orgmode@gnu.org; Sun, 02 May 2021 13:11:19 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:39539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldFck-0000VW-7r; Sun, 02 May 2021 13:11:19 -0400 Received: by mail-qk1-x734.google.com with SMTP id k127so3034085qkc.6; Sun, 02 May 2021 10:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version; bh=6WR/aQHX8Gg8rwKcSLF72OK1Y1YsEVrTsuGo2HtrCOc=; b=LUAnJFARYJUQLNjAB4CTBEOCyDQfmcYlxtMl+h055dJoNTV9k6tRSqw208JZEajwh7 EgRzHoAnoyQOAlYVDl8HiULzgBh2z9l85LLeRmrY2aHS1cRNhajHTYYCce292xOtoS6z wzSCLtnmAgRJU2P1Qx4mA8Cum2EcLIQ1ikdwbyPjA0elV2sibDTE6zSI9ianWl02jsJa Otks4Cv6Sk9WcLVZbK//ZeqbAJNVkUSzL0YOS/olN3QJRZd4IfSaTvYX7Va7tpxgjAgk zYFR7Cjlh8058ibkT94/I8HExpZ+anppZdR5obHF0fUcqeDM+pokHx5ANbH+qFKQwCgq +Nbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=6WR/aQHX8Gg8rwKcSLF72OK1Y1YsEVrTsuGo2HtrCOc=; b=mMG4fDjoRxZigE83S8tN0ArXMv5CfkK0pNt5OE2nLd4qi8BXO9OPcriN0+QjclCYTo 6GWXFmiRX5oUqsQewtwnFaSNX0uMQHo/ILt2Cia5CsM6Nqymu9rOM6xCLtNOjf0T6Yk2 volA8E9S9M2so3CcwTmHxh5TeZXFhA9SBA57U9Vs0DnCA9YFBElNgsaHySbkKGGwm55B tLCMKTytyustZaHz76DTKa93iXWtZ9SfjFnKQrrw6/bvSa3k47IIhMgRntZmEQJGmV69 Di2AyKdWfr0sq/STRw3/oEJLkhoSvEIa7FrujG4d0XpdQ96b2ghiJAb5F2VivgYoHMge FQqg== X-Gm-Message-State: AOAM533XoUIgYJUt84lGo1PxJeZpsN9sFQDxbeyh5nSIkuXMl0Bl6aMv IYdziKbsheEyUQcFOC4qZZhFVAJUYyVvbA== X-Google-Smtp-Source: ABdhPJz9GWFpH0kuGV8+pUJa3ZYDs7WBLj49ovUob+8z9RW2/3eIn5JUXzA2zCHRX2Al4qGbEh9H5A== X-Received: by 2002:a37:6850:: with SMTP id d77mr11268442qkc.57.1619975476759; Sun, 02 May 2021 10:11:16 -0700 (PDT) Received: from gusbrs-laptop ([143.244.34.179]) by smtp.gmail.com with ESMTPSA id p5sm6703561qkh.135.2021.05.02.10.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 May 2021 10:11:16 -0700 (PDT) References: <875z73br32.fsf@gmail.com> <87bl9ufnnh.fsf@gnu.org> <87eeepzvcu.fsf@gmail.com> <87tunlmxqu.fsf@bzg.fr> User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: Bastien Subject: Re: Bug: org-insert-heading-respect-content before first heading [9.4 (9.4-19-gb1de0c-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20201019/)] In-reply-to: <87tunlmxqu.fsf@bzg.fr> Message-ID: <87y2cxoybz.fsf@gmail.com> Date: Sun, 02 May 2021 14:11:12 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=gusbrs.2016@gmail.com; helo=mail-qk1-x734.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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@gnu.org 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=1619975520; 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=6WR/aQHX8Gg8rwKcSLF72OK1Y1YsEVrTsuGo2HtrCOc=; b=cWDcN30KAE/MD6aHrISMuWXGqi8aQZOeqUjSnqvR2a4Y06fbYMtlbOGPL1pXaYaOeC4mI7 huKS3iqcSa3uEQ2l+1ErZDx7zmlSzdrLHnQQoNp+IupGUJchKnrBxUAsRcmrMDsqm2Scvy Ux7dhCUL+udWwd7+8knkpZz6XVBE7H+MZpLD0/jZL4COJTCp/kKg7Mwm8r8aNrvCNi+tsC gWOLyRARhsm9W7K7uTeQzH4ZnTDixNcmRJgfMqxvGlqUZt37g/+V3TI4/AUMBJRVk0QGPy NvsLNW8TMpQM5zdJnVssN00OcwILM0FzGYDhutLwSJAR6LzzcqDbLD/Jsx1cZg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619975520; a=rsa-sha256; cv=none; b=lYc293h2m0piNBQzq82Qu5bsBT5Ed80ReinJc+01QPfXhKpxptiIvPcs1ijBvUwhR/cONz OyP0k7avvr2Idw9eV8+lQLwbJ7ZjTwz6I26bX2CdZlTPAjkQUr2FLAbgUniu6BYMCv3CyE xZhT5puemIMjOFAbp/SGYRK2n8kTk28NIDTZH6+n6+JUxlR+J6pTSFHwK87nsWy51qI5xa NO8gcqf1Gu82tVApsz6Oe+8vPYioNgZPy78/btu8CVuWc+tTShz7i1JDuPi5yWRmZwMiT2 YXsJDVdwtTm+ibxjoRh9F3HmnGrFnFvUdKkKNn1/d72Hbcjx6+hIrKbBupfv4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=LUAnJFAR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: 0.14 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=LUAnJFAR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 0D7CD130A8 X-Spam-Score: 0.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: RK+0+AUqfPGa Hi Bastien, On Sun, 02 May 2021 at 03:54, Bastien wrote: > Hi Gustavo, > > Gustavo Barros writes: > >> I just tested the fix and, indeed, >> `org-insert-heading-respect-content' no longer breaks the structure >> of >> the first heading. However, if I may add a nitpick, the value of >> `org-blank-before-new-entry' does not seem to be honored in this >> case. >> For default values, a distance of one blank line is ensured to the >> next heading. > > My understanding is that `org-blank-before-new-entry' will ensure > there is a blank line before the new entry, which is what I see. > > Let me know if there is something I miss here. Thanks! Indeed, that's why I said I'm not sure `org-blank-before-new-entry' is the culprit here. Still, there is a difference of behavior in that regard if point is before or after the fist heading. An ECM to reproduce it is the following. >From the situation ("|" represents point position), call `C-RET': #+begin_src org ,#+title: Title | ,* Foo ,* Bar ,* Baz #+end_src The result is: #+begin_src org ,#+title: Title ,* | ,* Foo ,* Bar ,* Baz #+end_src Now move point to: #+begin_src org ,#+title: Title ,* ,* Foo ,* Bar | ,* Baz #+end_src And call `C-RET'. The result is: #+begin_src org ,#+title: Title ,* ,* Foo ,* Bar ,* | ,* Baz #+end_src Not quite sure what is the cause, and also not absolutely sure what would be expected behavior. Since, if we now place point at: #+begin_src org ,#+title: Title ,* ,* Foo | ,* Bar ,* ,* Baz #+end_src And call `C-RET', we get: #+begin_src org ,#+title: Title ,* ,* Foo ,* | ,* Bar ,* ,* Baz #+end_src My guess, and this is just a hunch, is that the default value of `org-blank-before-new-entry', which by default is `auto' for `heading' is somehow backward looking, and hence has somewhat of a hard time in making the said "intelligent decision" as to how many blank lines to include. Particularly before the first heading. Indeed, I can understand the last case in that perspective, since the first heading we inserted has no blank line to "Foo", so that when inserting a new heading between "Foo" and "Bar" if we look right above "no blank line" is the rule to infer. And, if that first heading is removed, inserting a new one there, will behave just as it does between "Bar" and "Baz". This was all tested with `emacs -Q', version 27.2, and Org commit 3e497bec3. No variables changed, thus out-of-the-box experience. Anyway, as mentioned, "nitpick" level stuff, since you asked for testing. Best regards, Gustavo.