Nicolas Goaziou writes: > Some major modes may use major mode hooks to finish setting up their > fontification process, who knows. > > In any case, it could be worth trying it. Do you want to provide a patch > for that? > > Regards, I dived into the source code of two functions which are related to defcustom variable ~org-src-fontify-natively~. Here is my try: #+begin_src diff modified lisp/org-src.el @@ -585,7 +585,14 @@ as `org-src-fontify-natively' is non-nil." (erase-buffer) ;; Add string and a final space to ensure property change. (insert string " ")) - (unless (eq major-mode lang-mode) (funcall lang-mode)) + (unless (eq major-mode lang-mode) + (message "%s enabled in source block" lang-mode) + ;; (make-local-variable (intern (format "%s-hook" lang-mode))) + ;; (set (intern (format "%s-hook" lang-mode)) nil) + (message "%s is %s" + (intern (format "%s-hook" lang-mode)) + (symbol-value (intern (format "%s-hook" lang-mode)))) + (funcall lang-mode)) (org-font-lock-ensure) (let ((pos (point-min)) next) (while (setq next (next-property-change pos)) #+end_src But it seems does not work as I expected. Can't find out which real function is invoked when fontify every source blocks.