Hello, Bastien <b...@gnu.org> writes:
> Hi Nicolas and Rick, > > Nicolas Goaziou <n.goaz...@gmail.com> writes: > >> A new buffer keyword (which needs to be documented in org.texi), >> a defcustom with a completely free sexp... Isn't it a bit too much for >> mere checkboxes? > > Personally I think the defcustom is enough, as this choice is likely > to be made for all Org documents. > >> Filters provide almost the same functionality: >> >> (defun my-checkbox-filter (item backend info) >> (when (org-export-derived-backend-p backend 'html) >> (replace-regexp-in-string >> "\\`.*\\(<code>\\[\\(X\\| \\|-\\)\\]</code>\\).*$" >> (lambda (rep) >> (let ((check (match-string 2 rep))) >> (cond ((equal check "X") "☑") >> ((equal check "-") "☐") >> (t "☐")))) >> item >> nil nil 1))) >> (add-to-list 'org-export-filter-item-functions 'my-checkbox-filter) > > Yes, but a defcustom would be easier. As long as it doesn't let you write completely free sexps. Otherwise, a function is equally complex. Regards, -- Nicolas Goaziou