emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Samuel Banya" <sbanya@fastmail.com>
To: "Charles Berry" <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Re: [BUG] Adding note to heading without newline at the end
Date: Sun, 26 Jun 2022 22:42:01 -0400	[thread overview]
Message-ID: <62e3e328-a40e-4e81-a552-5fada3182859@www.fastmail.com> (raw)
In-Reply-To: <8160125c-131b-4623-85fe-e8747718273e@www.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 2709 bytes --]

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 <yantar92@gmail.com> 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

[-- Attachment #2: Type: text/html, Size: 4045 bytes --]

  parent reply	other threads:[~2022-06-27  2:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  0:27 [BUG] Adding note to heading without newline at the end Tor Kringeland
2022-06-20 13:41 ` Ihor Radchenko
2022-06-20 15:11   ` Tor Kringeland
2022-06-21  2:24     ` [PATCH] " Ihor Radchenko
2022-06-21 10:58       ` Tor Kringeland
2022-06-21 11:13         ` Tim Cross
2022-06-21 11:38         ` Ihor Radchenko
2022-06-22 14:28           ` Tor Kringeland
2022-06-23 15:59             ` Samuel Banya
2022-06-26 23:32               ` Samuel Banya
2022-06-26 23:45                 ` Ihor Radchenko
2022-06-27  2:42                 ` Samuel Banya [this message]
2022-06-27 10:18                   ` Ihor Radchenko
2022-06-28  2:47                     ` Samuel Banya
2022-06-28  2:57                       ` Ihor Radchenko
2022-09-13 14:13         ` Ihor Radchenko
2022-06-21  1:56 ` Samuel Banya
2022-06-21  2:21   ` Tor Kringeland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62e3e328-a40e-4e81-a552-5fada3182859@www.fastmail.com \
    --to=sbanya@fastmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).