I think you're right.

This request was prompted by an issue encounted in org-journal, and it
probably exists in org-roam and other similar packages.

Ignoring blank lines sounds like a reasonable approach.

For more significant syntax violations such as your example, perhaps
org-entry-get and other functions should raise errors instead of
silently returning nil?

I'm going to investigate how it might be possible to initiate an org-
lint if an exception situation was to arise in org-journal.




On February 7, 2024, Ihor Radchenko <yanta...@posteo.net> wrote:
> Jason May <j...@pobox.com> writes:
>
> > Extraneous content (e.g. blank lines) in the PROPERTIES drawer
> > cause =org-entry-get= to return nil without indication of any
> problem.
> >
> > Desired behavior: =org-entry-get= should be forgiving.
> > It should ignore blank PROPERTIES lines, or any line with invalid
> > syntax.
> > A message to the *Warnings* buffer might be appropriate.
>
> Blank lines in properties might be an ok change.
> I am not so sure about invalid syntax.
>
> Consider
>
> :PROPERTIES:
> :PROP1: val1
> :PROP2: this line was
> accidentally modified
> :END:
>
> Property drawer not being recognized is more likely to be noticed
> compared to `org-entry-get' returning incomplete "this line was".
>
> In any case, M-x org-lint will report problems with property drawers.
>
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>

Reply via email to