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:
> 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