Strike through org-mode checkbox items when checked

Hi crafters,

I can do something like

(set-face-attribute 'org-headline-done nil :strike-through t)

to strike through the current org headline when its status changes to DONE. e.g.

Is there anything similar but for checkbox items? I’d like it to look like

2 Likes

I haven’t found exactly what you’re looking for, but it might be that you can roll your own solution for this based off of what’s in org-faces.el. For checkboxes, this is all I see:

(defface org-checkbox '((t :inherit bold))
  "Face for checkboxes."
  :group 'org-faces)

(defface org-checkbox-statistics-todo '((t (:inherit org-todo)))
  "Face used for unfinished checkbox statistics."
  :group 'org-faces)

(defface org-checkbox-statistics-done '((t (:inherit org-done)))
  "Face used for finished checkbox statistics."
  :group 'org-faces)

I took the liberty of digging a bit on Stack Exchange, and found this question, which seems very similar to me. The comments to the question may provide some clue, and there’s an answer that includes some code (and while that seems incomplete, it may offer ideas for a starting point).

Thanks so much for the pointers.

I wish there was a dedicated face for the text part, but looks like there isn’t one.

I’m happy with

(custom-theme-set-faces
 'punpun-light ;; the theme that I'm using
 '(org-checkbox-statistics-done ((t (:inherit org-done :strike-through t)))))

for now. Using the previous example, it would look like

3 Likes