I have several org files that end like:

#+CAPTION: /path/to/file.conf
#+INCLUDE: "/path/to/file.conf" src conf<EOF>

When org-lint checks these, it errors with:
     Independent keyword INCLUDE may be confused with affiliated
     keywords below

This error isn't useful because there is nothing beyond the <EOF>.

I can work around by adding an empty line, but I think 
(org-lint-regular-keyword-before-affiliated) should account for this.
It seems like there should be either:
- a check for EOF along with the post-blank check
- a check that next-element is actually some other element, and not the
  same one associated with keyword

I tried the first option, but failed to implement it. It seemed like
(eobp) would let me check, but (org-with-point-at (org-element-end
keyword)... didn't place the point at the end like I expected, nor did
calling (end-of-line) from that point.

The second option seemed to work for my documents. I just saved the
current element and compared them:

(let ((current-element (org-with-point-at (org-element-begin keyword)
                         (org-element-at-point)))
      (next-element (org-with-point-at (org-element-end keyword)
                      (org-element-at-point))))
  (when (not (eq current-element next-element))
    <actual error logic>

Emacs  : GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.49, 
cairo version 1.18.4) of 2025-07-18, modified by Debian
Package: Org mode version 9.7.29 (9.7.29 @ 
/usr/share/emacs/site-lisp/elpa/org-9.7.29/)

Reply via email to