Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:
> > Did you try to set the hook to a different value before (funcall lang-mode)? > Yes, like I said in previous messages, I want to make lang-mode-hook empty. It tested a few times, with restarting Emacs (loading a refresh Org Mode). It failed to fontify source blocks. Reports error: Failed to fontify source block. I can see all source blocks are not fontified. Until I manually load the mode with [M-x load-library RET clojure-mode RET]. Then I reopen the Org file, the clojure source blocks are fontified. Also I improved my code: #+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) + ;; FIXME: Org mode fontification error in #<buffer Code.org> at 203 + ;; (let (hook (intern (format "%s-hook" lang-mode))) + ;; (message "%s enabled in source block" lang-mode) + ;; (make-local-variable hook) + ;; (set hook nil) + ;; (message "%s is %s" hook (symbol-value hook))) + (funcall lang-mode)) (org-font-lock-ensure) (let ((pos (point-min)) next) (while (setq next (next-property-change pos)) #+end_src -- [ stardiviner ] don't need to convince with trends. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3