Looking up in the org source where org-emphasis-alist
is used, we find it is used in org-do-emphasis-faces
. This function is added to font-lock-keywords, after which font-lock fontifies the region corresponding to the match-data
.
To hide the markers, org-do-emphasis-faces
additionally adds 'invisible' text properties to those markers. In summary, the behavior you are asking for can be achieved by evaluating the following code before opening an org file (e.g. add it to your init file):
(font-lock-add-keywords 'org-mode
'(("@@comment: .*@@" . 'shadow)
(org-do-font-lock-inline-comment)))
(defun org-do-font-lock-inline-comment (limit)
(re-search-forward "\\(@@comment: \\).*\\(@@\\)" limit t)
(add-text-properties (match-beginning 1) (match-end 1)
'(invisible t))
(add-text-properties (match-beginning 2) (match-end 2)
'(invisible t)))
where I have used the shadow
face to 'grey out' the text.