5.17 Update Org block delimiter fontification

As noted in the section about modus-themes-org-blocks, Org contains a variable that determines whether the block’s begin and end lines are extended to the edge of the window (Option for org-mode block styles). The variable is org-fontify-whole-block-delimiter-line.

Users who change the style of Org blocks from time to time may prefer to automatically update delimiter line fontification, such as with the following setup:

(defun my-modus-themes-org-fontify-block-delimiter-lines ()
  "Match `org-fontify-whole-block-delimiter-line' to theme style.
Run this function at the post theme load phase, such as with the
`modus-themes-after-load-theme-hook'."
  (if (eq modus-themes-org-blocks 'gray-background)
      (setq org-fontify-whole-block-delimiter-line t)
    (setq org-fontify-whole-block-delimiter-line nil)))

(add-hook 'modus-themes-after-load-theme-hook
          #'my-modus-themes-org-fontify-block-delimiter-lines)

Then M-x org-mode-restart for changes to take effect, though manual intervention can be circumvented by tweaking the function thus:

(defun my-modus-themes-org-fontify-block-delimiter-lines ()
  "Match `org-fontify-whole-block-delimiter-line' to theme style.
Run this function at the post theme load phase, such as with the
`modus-themes-after-load-theme-hook'."
  (if (eq modus-themes-org-blocks 'gray-background)
      (setq org-fontify-whole-block-delimiter-line t)
    (setq org-fontify-whole-block-delimiter-line nil))
  (when (derived-mode-p 'org-mode)
    (font-lock-flush)))