From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id +ErcEjT3SGZ8nQAAqHPOHw:P1 (envelope-from ) for ; Sat, 18 May 2024 20:45:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +ErcEjT3SGZ8nQAAqHPOHw (envelope-from ) for ; Sat, 18 May 2024 20:45:08 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kristofernelson.com header.s=MBO0001 header.b=cV9XalpL; dmarc=none; 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=1716057908; 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=kIq6cdF0xENoj7wO9UJHxUj/xB+IHvF7QW5N8ErXmIU=; b=LTPSaNa1XSyBUpdFCm0uYJ/gYoHzjL62VUktrpJGiekfgxnp2R1GlBINdO7s57cNMqElrp vLgUFY9pWBJfmddBVN2StA23Id+EzoXlW/X5NbpZ5KF3CsKZgCI/utUSHVtIujNE+ZHVIi Gkvi1kRooAU86ISmp7U2jhQnvbPRolLD7I6g8IgQq1dKgcbBYCGur2jXXlPP8DLHiJPnvx 74zGoJM3Zwrn6A09cmg3r8/hWAzwBc2mOqODeZpmcHM/Y76EyM5jel0uUXzyVFdeRLTkV1 2DoZT8gRSiKi2u8jaQsiEXZQgV4o9XPdDofeFmxXMBj1ZMkYchbZNlADLjDnMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716057908; a=rsa-sha256; cv=none; b=iXQ598eW+cLOUfPIL+uDE0gMC3asF1ADIdqvfjqP9ZjHNvHUT12lMiLXKCXtdm/OMhCRpm Rjs5ftNn8BvlR8tGwA6QN6TBLOIARp+/QwAbHyMUNbZU9Avw2U59L8hiLBb6UfwAyzu+2n bzrVVST/w7k/hmug5jMMrBR0pd7+DE6Bv6bpoVSlBQIBSjaGXSVaH4Huo1MBJgRUmg1i6f Mm3Raf9Ibo9RAO5X7mfJ1VwgPQYOsKbgWzh7P+tU6Qv836a/LR6wBzhNv43w8lJTQVv3dd ylxuQPshTDpbSWXx0yLux9UUTEuW2iK7WEne2H5OYxIQvzqZk3Fcpseu5HcTJA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kristofernelson.com header.s=MBO0001 header.b=cV9XalpL; dmarc=none; 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" 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 11D33AB66 for ; Sat, 18 May 2024 20:45:08 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8P2e-0000lz-0J; Sat, 18 May 2024 14:44:24 -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 1s8P2d-0000lh-3f for emacs-orgmode@gnu.org; Sat, 18 May 2024 14:44:23 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1s8P2b-0007Wm-4O for emacs-orgmode@gnu.org; Sat, 18 May 2024 14:44:22 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4VhXmX3WCLz9sPq; Sat, 18 May 2024 20:44:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kristofernelson.com; s=MBO0001; t=1716057852; h=from:from: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; bh=kIq6cdF0xENoj7wO9UJHxUj/xB+IHvF7QW5N8ErXmIU=; b=cV9XalpLNpsSuwTVXpYLWmqiy5PAroenpdI9IJNBcXsLhqPRW7KzXsWzHrpJSHcmdpC/BP gg9uEf8lT792vrgrq/ZSZGsLulsz/T7EUms7ZkbG+xYe9O9sCQEujFpoXY/QkevPuHlAY0 gGqq5RsYMcRLODt0mlyg9LnO3m8LjPyLYc/AwS/cU/1PgwwpKT9FQlQ/Nd0GOCcsgxc2ml mNFLhYavUOodq7PAR7NeVfjxWe1DTLoc/QCqBF0S9dL7q2/UE/2r98gzofhvoBS2v+fB6L Q1vG+IjDorWvTfdb/Crce3pqteJHP/dDy1FeBZebZwT7/Bn1EoX+TI4kbts96A== Content-Type: multipart/mixed; boundary="------------30gpSidXasJMB0z0r8fJeR8I" Message-ID: <31465f70-3985-4e0e-aae7-d0fe59e4c69e@KristoferNelson.com> Date: Sat, 18 May 2024 12:44:07 -0600 MIME-Version: 1.0 Subject: Re: LOGBOOK drawer now being created with blank line afterwards To: Ihor Radchenko , Rens Oliemans Cc: "emacs-orgmode@gnu.org" References: <766237934.317726.1715720181047@office.mailbox.org> <874jawadjs.fsf@localhost> Content-Language: en-CA From: Kris Nelson In-Reply-To: <874jawadjs.fsf@localhost> Received-SPF: pass client-ip=80.241.56.151; envelope-from=Kris@KristoferNelson.com; helo=mout-p-101.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, 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-Spam-Score: -3.06 X-Spam-Score: -3.06 X-Migadu-Queue-Id: 11D33AB66 X-Migadu-Scanner: mx11.migadu.com X-TUID: x0mrn3/cGkMt This is a multi-part message in MIME format. --------------30gpSidXasJMB0z0r8fJeR8I Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-05-17 05:22, Ihor Radchenko wrote: > Fixed, on main. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=288c7069c > > Thanks Kris for reporting, and thanks Rens for hunting down the cause! Thanks for the prompt fix, Ihor! I tested it out and confirmed I'm not seeing a blank space after the LOGBOOK anymore. However, I did notice that it now errors out when creating the LOGBOOK on a heading which is at the end of the buffer. The error is: Error in post-command-hook (org-add-log-note): (end-of-buffer) I did some debugging and found that the error was coming from the (forward-char) call in the following line: (if (eolp) (forward-char) (insert "\n")) I've taken a crack at fixing this, which seems to work correctly from all my tests. See attached for the patch file. The basic reasoning behind the included changes is: - Keep point at the end of the LOGBOOK entry (right after :END:) instead of needing it to be on the line after. - Adjust the values for folding the drawer and moving the point after folding based on the logic above. --------------30gpSidXasJMB0z0r8fJeR8I Content-Type: text/x-patch; charset=UTF-8; name="0001-org-log-beginning-Fix-error-creating-LOGBOOK-drawer-.patch" Content-Disposition: attachment; filename*0="0001-org-log-beginning-Fix-error-creating-LOGBOOK-drawer-.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAyYzUzZmEyNGUyYTdhYmZhNzNlMDcwMTQ1MzY1ZDg5YWQxMTk3YjhhIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBLcmlzIE5lbHNvbiA8S3Jpc0BLcmlzdG9mZXJOZWxz b24uY29tPgpEYXRlOiBTYXQsIDE4IE1heSAyMDI0IDEyOjE2OjA2IC0wNjAwClN1YmplY3Q6 IFtQQVRDSF0gb3JnLWxvZy1iZWdpbm5pbmc6IEZpeCBlcnJvciBjcmVhdGluZyBMT0dCT09L IGRyYXdlciBhdCBlbmQKIG9mIGJ1ZmZlcgoKKiBsaXNwL29yZy5lbCAob3JnLWxvZy1iZWdp bm5pbmcpOiBGaXggcmVncmVzc2lvbiBhZnRlciAyODhjNzA2OWMgd2hlcmUKIkVycm9yIGlu IHBvc3QtY29tbWFuZC1ob29rIChvcmctYWRkLWxvZy1ub3RlKTogKGVuZC1vZi1idWZmZXIp IgppcyBkaXNwbGF5ZWQgYWZ0ZXIgY3JlYXRpbmcgdGhlIExPR0JPT0sgZHJhd2VyIG9uIGEg aGVhZGluZyB3aGljaCBpcwphdCB0aGUgZW5kIG9mIHRoZSBidWZmZXIuCgpSZXBvcnRlZC1i eTogS3JpcyBOZWxzb24gPGtyaXNAa3Jpc3RvZmVybmVsc29uLmNvbT4KTGluazogaHR0cHM6 Ly9vcmdtb2RlLm9yZy9saXN0Lzc2NjIzNzkzNC4zMTc3MjYuMTcxNTcyM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