today's fruit

(defun xah-redo-syntax-coloring-html-buffer ()
  "redo all pre lang code syntax coloring in current html page."
  (let (langCode p1-inner p2-inner)
    (goto-char (point-min))
      (re-search-forward "<pre class=\"\\([-A-Za-z0-9]+\\)\">" nil "NOERROR")
      (setq langCode (match-string 1))
      (setq p1-inner (point))
      (backward-char 1)
      (search-backward "</pre>")
      (setq p2-inner (point))
        (narrow-to-region p1-inner p2-inner)
        (xhm-dehtmlize-precode (point-min) (point-max))
        (xhm-htmlize-region (point-min) (point-max) (xhm-langcode-to-major-mode-name langCode xhm-lang-name-map) t)))))

so, i press one button, and the current html file's pre tag of programing lang source code are all regenerated.

why do i want to regenerate? because i'm using several of my own emacs modes for coloring, including xah-elisp-mode, xah-html-mode, xah-css-mode, xah-js-mode, because the default doesn't color many keywords. But in my modes, i constantly add new keywords or tweak how i want them colored. e.g. in javascript should coloring be grouped by keywords, object name, function name, or builtin vs 3rd party, or methods should get one color, etc. So, when i made a change, i sometimes want to update all pages on my site.

the basics is at
Emacs Lisp: Syntax Color Source Code in HTML
Shared publiclyView activity