From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id WL1ILpo/8GY55AAA62LTzQ:P1 (envelope-from ) for ; Sun, 22 Sep 2024 16:02:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id WL1ILpo/8GY55AAA62LTzQ (envelope-from ) for ; Sun, 22 Sep 2024 18:02:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="Uzecn/PC"; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727020954; 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=vUyLkR2TwsA6gxllspPDptNfGt57WGySecQsSRsQGAg=; b=TGeLNt5jg0pmu2K8HODl5CXZ8u0cLmyRqEz/p5HVxWNDaJiNP9oXAcz0o/zcsS2N/weOn9 YrdHcDGnjIk7wrbcu3SAd/lKRFdQrI/bLAfzayvCns7OBEbdNF9goIhPazo2pzQcahvRV/ BlrObqnH8cpxh1BG7Oo1BBw0cw71NqaT6VFhPmlmdeMP/E/AguAcIOgzi4uvNZaThogzkV p5A4L0ituo1LKMRc07E4/IF7FboLW+CmhGn4RUMA1DXkWS7vCaj9v6Z5sBr2cSA9GKWSFX IbaMSlN5LzGO9ZZJNwJAAnseb8LOVzYfryz36WmlEfkwuCm2WaqWNnfOxFBlfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="Uzecn/PC"; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727020954; a=rsa-sha256; cv=none; b=enOKUEpbWe0WflOqs9cKlF7hN5rjBZTp2TD10Fbjvt1nI6nK2ISznGCMEmNJdSxe8pfIoj R8tu1a6gaZnAkqWn2rx3MWz+Ltrkrr7sEJw9QAjXVdK5nLPOmkljJY6Lxeo9w8+LMkGuCO M2YCNFNRZNK92g/0WVAYPHWCg31n832pzqxPkHj0XFjXB+HxME/gFRaUtlCAuq+xaXo/Gs gUAeN/P3xJuAk6vqZzGLATdWEOMxiCBz1GIdJ6es3hF+Lpww3qloeuDJUNBgqiKcGEEwXx 0TdK8rpfdvPYHqcO4CODKmfagL38TEstPvMhGW7Yo1/SZvCXPkiXfGffNOmgqw== 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 9A6AB6F510 for ; Sun, 22 Sep 2024 18:02:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssP1w-0005Sa-S1; Sun, 22 Sep 2024 12:01:48 -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 1ssP1u-0005Rc-Sj for emacs-orgmode@gnu.org; Sun, 22 Sep 2024 12:01:46 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssP1s-0007qO-Kx for emacs-orgmode@gnu.org; Sun, 22 Sep 2024 12:01:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CA3A9240101 for ; Sun, 22 Sep 2024 18:01:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1727020901; bh=JkMO99SMyQ6utS0nZnSNOuzQYpI431FAUg/TRn4kcT0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=Uzecn/PCWjPbGGEdgxvBvlqt0QygHzgye8LgEyeLc/UUMoBjt/WgF3CztTGXl0keX KJWU/Vmx6z/63cbXUgqDREIfcOE5axuXFM+2dVwWKYIFm21NToiaiSSzbsK73YOhyS FrwCNHTp0jf5hfcB4xpnJqNbdKSYgYLziXH0asxPYb8hdKOnfZbYKvVVOMUH0f2hoK S2jjx0s0JiKejRwGDra96FQZNkAksVgQ2x5b3BQkYZ/Q0UtevzH7KeB7sMeBibxjd/ CwTjls2bSib8vB+jhnYp+KI6P1o6vpp9jzcobonVCo/Pb58Kue6lzTsgZb3I/VeI5O LUjMavV+T/nMA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XBW8P162gz6twC; Sun, 22 Sep 2024 18:01:41 +0200 (CEST) From: Ihor Radchenko To: John Wiegley Cc: emacs-orgmode@gnu.org Subject: Re: Archiving always adds a newline before entries In-Reply-To: References: Date: Sun, 22 Sep 2024 16:03:17 +0000 Message-ID: <877cb3r7zu.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 9A6AB6F510 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -9.75 X-Migadu-Spam-Score: -9.75 X-TUID: N2u//vw6M9g9 "John Wiegley" writes: > I like to avoid blank lines between Org-mode entries, but have found that= when > archiving (and not use datetrees), that this is not supported by Org-mode > out-of-the-box. Mainly it=E2=80=99s due to these lines: > ... > ;; Subtree narrowing can let the buffer end on > ;; a headline. `org-paste-subtree' then deletes it. > ;; To prevent this, make sure visible part of buffer > ;; always terminates on a new line, while limiting > ;; number of blank lines in a date tree. > ---> (unless (and datetree-date (bolp)) (insert "\n")))) > ;; Paste > (org-paste-subtree (org-get-valid-level level (and heading 1))) > > The line indicated above always appends a newline at the end of the buffe= r, > so that the pasted tree appears after this newline. It would be nice if t= his > followed the configuration of =E2=80=98org-blank-before-new-entry=E2=80= =99, for example. +1 Ideally, we should use something more Elisp-friendly compared to interactive context-dependent `org-paste-subtree'. In the current state, things are way too fragile to touch them without risking unexpected breakage in various corner cases. It would be nice to factor out context-sensitive handling in `org-paste-subtree' into some kind of API function. Then, we can use that function more safely in other places like org-archive. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at