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 ms5.migadu.com with LMTPS id 2Gs9Hy8ZuWJtjwAAbAwnHQ (envelope-from ) for ; Mon, 27 Jun 2022 04:42:55 +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 2OoTHy8ZuWIODQAAauVa8A (envelope-from ) for ; Mon, 27 Jun 2022 04:42:55 +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 36D072D6D0 for ; Mon, 27 Jun 2022 04:42:55 +0200 (CEST) Received: from localhost ([::1]:59750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5eiD-000329-G2 for larch@yhetil.org; Sun, 26 Jun 2022 22:42:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5ehm-00031z-QS for emacs-orgmode@gnu.org; Sun, 26 Jun 2022 22:42:26 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5ehk-0002xp-M1 for emacs-orgmode@gnu.org; Sun, 26 Jun 2022 22:42:26 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EEB6F5C00C2 for ; Sun, 26 Jun 2022 22:42:21 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute5.internal (MEProxy); Sun, 26 Jun 2022 22:42:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1656297741; x=1656384141; bh=BakA0sFilW lqkUi/Tl0hEAKsw9RtqeJrPGdDnsJu4Es=; b=crLvtVRW+kqyUenMeBbNgYD/lE j/g6zY7xWpakx48HHFQwCrye3UAcmYTqepP66vC3XJZB66wz1Vk9rytoGzA731SK EvORuhpiz3465mLeNoh+vneaK2wwirCUpFpSH3eKV7NXOGDsKA4KamCA/gtKlyKd c3rOg5fe8nrVPzAYaZcvG+QtTUo0fS0Jt6Z8Y02XT6vxOHRxGDeiZhl8K9YOPGQ7 exVYhAfg+6m8ABaLxNBykT7h3Iw79lV748ieR4gZpwAkYFpEY++QTeBo+20A+tK0 8QhexKMWLRQ/8XMDIy/69jS1GbwesABfhhK1c6ifaqVJLJDfVZwcsjncV7jA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1656297741; x=1656384141; bh=BakA0sFilWlqkUi/Tl0hEAKsw9Rt qeJrPGdDnsJu4Es=; b=EAo9pWmAU5umfnsotUwsASXXeq6cz27jIW994JGWOBkF a7RTY4odJ6x2vqU29NYCbtZH7QYB2pLQWHoC466W6obUaDL99FBf5ZHNrBqayUA6 lSzFgNGJ9oiCTyT36rTgYK/RjbiPUnSru4SK4A5Q8bXXELwg57Ao2hvU06tXP7Tg xugNhxq/EqxERWQ2Xbh2ZJrCh40rP7Tx6nVPXaPNsSZH6IK+9TLTn5bHnk0Fr+Z4 JOVEkZv0DVCb1XClW8EznhxDnqewXeFVp/53ZWVFLpZ29YBUAEQZ6Gs4xtpg5VTR vb8XG2WzVDHNNvfoHNh7NldbsizPrnF2Rws8pRewyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeggedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfufgrmhhuvghluceurghnhigrfdcuoehssggrnhihrges fhgrshhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpedugffhffettddvgfetud duvdetjedvueekheekleegudeukeeguefhledthefggeenucffohhmrghinhepohhrghhm ohguvghnohhtvggsuhhgrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepshgsrghnhigrsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib97947f6:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B965A1700077; Sun, 26 Jun 2022 22:42:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-713-g1f035dc716-fm-20220617.001-g1f035dc7 Mime-Version: 1.0 Message-Id: <62e3e328-a40e-4e81-a552-5fada3182859@www.fastmail.com> In-Reply-To: <8160125c-131b-4623-85fe-e8747718273e@www.fastmail.com> References: <87o7yn3117.fsf@localhost> <87fsjysqhk.fsf@localhost> <87letqqmad.fsf@localhost> <8160125c-131b-4623-85fe-e8747718273e@www.fastmail.com> Date: Sun, 26 Jun 2022 22:42:01 -0400 From: "Samuel Banya" To: "Charles Berry" Subject: Re: [PATCH] Re: [BUG] Adding note to heading without newline at the end Content-Type: multipart/alternative; boundary=4f3c57460bc44a2584dd3ae9204a33ac Received-SPF: pass client-ip=66.111.4.25; envelope-from=sbanya@fastmail.com; helo=out1-smtp.messagingengine.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656297775; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=BakA0sFilWlqkUi/Tl0hEAKsw9RtqeJrPGdDnsJu4Es=; b=LxFznVb05vYzqDgzuKSZi2/Hks7haj42nBHBU+xZclixQ7tkchT3cLvIVu1OeKgAb/iYY7 5s81UwYUE7h64Rbv0bQxAGHD/5J6aERxkFLDsS2lnJWnnnC6sayGq8FqvgWt7CWIhid0Fr JjpRl19asz+Mqe7HFfSss7Y+go5qUkNogFAzKqGn8tZQpYrOOOq6liZcenArXbALnUiR3W CwMxe0UpkU+rUhnw2fdqXYuxXL2h2NRj6jJyvuQmVWPrzZgyJz8Yv16bbTA86WQCdbZX/a 6UGBP06mPGRSedus9FplPAtgUO3FzJXzxcJk77pLhPq6gzIYNn/UeNMLym9mug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656297775; a=rsa-sha256; cv=none; b=Z5i8+zk1EeJW8rCh+bmjO1fpF6G2mlRzExMVNpi8V86QEtzublPnSKD5yDllh0/4fodLJm YJdKUwyJcUwgKreApeC7sAxNfNa9wOcWOAMkzVC25RMjOgLXak6K27dtOVBoDUO4fIdOyj YFs81A5wmXAzrwEjGKE1KRnRT+5aLjzUCldsOlrDa6hOoZWtIoYRFqNnxuhbDqBD4W12zO 2HP4uYz6XeRSx+7tBHIORB9BQsy+qkGUscLkCy04j1Hhfl1JLcmx59PwqNQKfvZ/5NDa0I 0U8WlHbMiVUC6DRVhe5YH0iIzXe5SeThI1QEgGy8NG2ilBwaN2a1p7sH1MYTHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fastmail.com header.s=fm2 header.b=crLvtVRW; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=EAo9pWmA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fastmail.com (policy=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" X-Migadu-Spam-Score: 5.46 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fastmail.com header.s=fm2 header.b=crLvtVRW; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=EAo9pWmA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fastmail.com (policy=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" X-Migadu-Queue-Id: 36D072D6D0 X-Spam-Score: 5.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: HxU39qHAMx6P --4f3c57460bc44a2584dd3ae9204a33ac Content-Type: text/plain Gotcha, after this great advice, I am also able to get the following result: ``` - Note taken on [2022-06-26 Sun 22:31] \\ Adding test note * test ``` However, even after toggling 'M-x toggle-debug-on-error', it didn't enter the debugger since I guess this would be considered a 'user error' according to the '*Messages*' buffer present: ``` user-error: Before first headline at position 43 in buffer orgModeNoteBug.org ``` I checked 'org.el' which has the related 'org-add-note' function present. This appears to call the 'org-add-log-setup' function, and passes the 'note' argument to it. I then took a look at the 'org-add-log-setup' function. >From the bug's nature itself, it most likely is moving the cursor incorrectly to the previous line above it, when it should be really doing it on the line AFTER it. This to me is probably the 'moving' section that should be modified: ``` (move-marker org-log-note-marker (point)) ``` It's probably the position that needs to be recalculated or adjusted accordingly. I used 'C-h f' and found that 'move-marker' is just an alias for 'set-marker' which is in the Emacs codebase itself. I think the issue is HOW we are calling it here. Can you give me a few pointers in terms of how we can maybe force it to go to the next line instead of adjusting it based on the point present? Thanks, Sam On Sun, Jun 26, 2022, at 7:32 PM, Samuel Banya wrote: > Hey everyone, > > I'm using Emacs 28.1 on Manjaro, and pulled the latest version of Org Mode from the git repo. > > I'm still unable to reproduce this as I basically just opened up a new .org file and did Tom's exact steps. I was able to add a blank note without receiving an error at the exact cursor point that was mentioned. > > Ihor, can you take a look at the .mkv video I attached of my test and let me know what you did to be able to reproduce this because I'm not observing any errors on my machine. > > Thanks, > > Sam > > On Thu, Jun 23, 2022, at 11:59 AM, Samuel Banya wrote: >> Hey Ihor, >> >> I can check it out on the weekend, sounds like fun. >> >> Will step through the debugger to see what's up and get back to you on this, thanks for tagging me on this. >> >> On Wed, Jun 22, 2022, at 10:28 AM, Tor Kringeland wrote: >>> Ihor Radchenko writes: >>> >>> > Confirmed. >>> > >>> > Samuel, do you want to try fixing this? >>> > It should be fairly easy to debug. >>> >>> Nice. But these are distinct bugs, it seems like. The one you sent a >>> patch for earlier fixes the former bug (which is also present in Org >>> 9.5). While my original problem is only present in Org 9.6. >> > > > *Attachments:* > * orgAddNoteBugVideo-2022-06-26_19.25.54.mkv --4f3c57460bc44a2584dd3ae9204a33ac Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Gotcha, af= ter this great advice, I am also able to get the following result:
```
- Note taken on [2022-06-26 Sun 22:31] \\
=
  Adding test note
* test
``= `

However, even after toggling 'M-x toggle-= debug-on-error', it didn't enter the debugger since I guess this would b= e considered a 'user error' according to the '*Messages*' buffer present= :
```
user-error: Before first headline at p= osition 43 in buffer orgModeNoteBug.org
```
I ch= ecked 'org.el' which has the related 'org-add-note' function present.

This appears to call the 'org-add-log-setup' = function, and passes the 'note' argument to it.

=
I then took a look at the 'org-add-log-setup' function.

From the bug's nature itself, it most likely is moving= the cursor incorrectly to the previous line above it, when it should be= really doing it on the line AFTER it.

This= to me is probably the 'moving' section that should be modified:
```
  (move-marker org-log-note-marker (point)= )
```

It's probably the posit= ion that needs to be recalculated or adjusted accordingly.

I used 'C-h f' and found that 'move-marker' is just an = alias for 'set-marker' which is in the Emacs codebase itself.
<= div>
I think the issue is HOW we are calling it here.
<= /div>

Can you give me a few pointers in terms of how = we can maybe force it to go to the next line instead of adjusting it bas= ed on the point present?

Thanks,
<= div>
Sam


On Su= n, Jun 26, 2022, at 7:32 PM, Samuel Banya wrote:
Hey everyone,

I'm using Emacs 28.1 on Manjaro, and pulled the latest version = of Org Mode from the git repo.

I'm still un= able to reproduce this as I basically just opened up a new .org file and= did Tom's exact steps. I was able to add a blank note without receiving= an error at the exact cursor point that was mentioned.
Ihor, can you take a look at the .mkv video I attached of m= y test and let me know what you did to be able to reproduce this because= I'm not observing any errors on my machine.

Thanks,

Sam

= On Thu, Jun 23, 2022, at 11:59 AM, Samuel Banya wrote:
Hey Ihor,
<= br>
I can check it out on the weekend, sounds like fun.

Will step through the debugger to see what's up a= nd get back to you on this, thanks for tagging me on this.

On Wed, Jun 22, 2022, at 10:28 AM, Tor Kringeland wrote:=

>
> Samuel, do you want to try fixing this?
> It should be fairly easy to debug.

Nice.  But these are distinct bugs, it seems like.  The = one you sent a
patch for earlier fixes the former bug (whi= ch is also present in Org
9.5).  While my original pr= oblem is only present in Org 9.6.

<= /blockquote>


Attachments:
  • orgAddNoteBugVideo-2022-06-26_19.25.54.mkv

--4f3c57460bc44a2584dd3ae9204a33ac--