Closed tpeacock19 closed 3 years ago
Thanks; I was afraid that I might have caused a bug like this, but I was hoping not. This "before first heading" issue happens so often in Org-related packages...
I'm not sure that the change you propose will fix it correctly. In non-narrowed Org buffers, the current heading should still be selected when point is in an entry rather than before the first one. I think that, rather than testing whether the buffer is narrowed, we should probably test org-before-first-heading-p
.
I'm not sure that the change you propose will fix it correctly. In non-narrowed Org buffers, the current heading should still be selected when point is in an entry rather than before the first one.
Doesn't this case get handled by the point-olp
? I'm pretty sure this captures the current heading at point.
I can confirm the bug as well as that the proposed fix seems to work for now.
In non-narrowed Org buffers, the current heading should still be selected when point is in an entry rather than before the first one.
Also, evaling (org-heading-components)
in my non-narrowed org-mode buffers gives the same error.
Here are two test cases where point at 0 give the same error:
test.org
# a comment
* a headline
empty.org
Thanks. Would one or both of you mind testing this branch? It tests narrowing earlier in the form. https://github.com/alphapapa/burly.el/commit/9b5b480f1f378e7d8873bfaa2c4fa175ed687ef0
I can confirm that this works saving non-narrowed and narrowed buffers.
Thanks!
Since this commit cd1715d318fe831612bbc880b498c483ee958665 I have been unable to save org buffers that do not have a heading in the first line. I get thrown an error
Before first headline at position 1 in buffer wiki.org
.I believe this is an error in
burly--org-mode-buffer-url
, specifically the top-olp section:If the buffer is not narrowed
org-heading-components
will result in a user-error. This can be mitigated with the following: