Hi Nicolas,
fair enough if you feel it's not worth the hassle.
I'm pasting here a simple filter implementing the rule I described
above (use the special arg if present and if it doesn't conflict with
any ATTR directive for the current backend) for anyone interested, if
any at all:
(defun my-org-special-block-filter (tree backend _symbol)
(pcase-let ((`(,prop ,fmt)
(cond ((org-export-derived-backend-p backend 'latex)
'(:attr_latex ":options [%s]")))))
(when prop
(org-element-map tree 'special-block
(lambda (element)
(unless (org-element-property prop element)
(save-excursion
(goto-char (org-element-property :begin element))
(when (re-search-forward "#\\+BEGIN_\\S-+[ \t]+\\(.+\\)" nil t)
(let ((attr (format fmt (match-string-no-properties 1))))
(org-element-put-property element prop (list attr))))))
nil)))))
It can easily be extended to other backends by just adding a new
clause to the cond at the beginning.
This plus a little extra font locking allows me to edit my
presentations like the attached screenshot shows. I think it's quite
an improvement over subsectioning and ignoreheading cruft but it must
be said that, although it looks nicer, it's only a marginal
improvement over special blocks plus affiliated ATTRs.
Best regards
--
Carlos