Hello,

Yes you are right, i digged deeper in the problem and it seems to be
that the cond:

(cond ((org-face-from-face-or-color
                       'priority nil
                       (cdr (assoc p org-priority-faces))))
                     ((and (listp org-agenda-fontify-priorities)
                           (org-face-from-face-or-color
                            'priority nil
                            (cdr (assoc p org-agenda-fontify-priorities)))))
                     ((equal p l) 'italic)
                     ((equal p h) 'bold))

returns nil altogether for priorities which are neither the highest
(equal p h) or the lowest (equal p l) (hence the bug appearing on #B
priorities by default).

That gives (nil . org-priority) so:
(overlay-put ov 'face (nil . 'org-priority))

Which triggers the message the second time it runs.

>From the elisp manual for (overlay-put ... 'face (a-cons . cell)):

• A cons cell of the form ‘(foreground-color . COLOR-NAME)’ or
‘(background-color . COLOR-NAME)’.  This specifies the
foreground or background color, similar to ‘(:foreground
COLOR-NAME)’ or ‘(:background COLOR-NAME)’.  This form is
osupported for backward compatibility only, and should be
avoided.

Which makes me think the whole cond inside it:
(overlay-put ov 'face (cons (cond ...)))

is kinda wrong from the start. But i don't know, just guessing because
overlay-put is a C function.

Anyways, for the ECM:

(setq org-priority-faces nil)
(setq org-agenda-fontify-priorities 'cookies)
(setq org-highest-priority ?A)
(setq org-lowest-priority ?C)

Create an .org with:

* TODO [#B] Test

Start the agenda for TODO items with buffer restriction on that file.
When it loads and everytime you pass the cursor on the line with the
TODO item it gives the message:
"Invalid face reference: nil"

I hope that helps, thanks already for looking into it!

Renato Ferreira

Reply via email to