org-e-html: Small refactoring

* contrib/lisp/org-e-html.el (org-e-html-fontify-code): Activating
  major mode before inserting contents avoid problem of initial
  visibility for an Org buffer.
This commit is contained in:
Nicolas Goaziou 2012-12-12 23:16:51 +01:00
parent 2c39a4ae85
commit 627d5733be
1 changed files with 1 additions and 4 deletions

View File

@ -1484,12 +1484,9 @@ is the language used for CODE, as a string, or nil."
(t
;; htmlize
(setq code (with-temp-buffer
(insert code)
;; Switch to language-specific mode.
(funcall lang-mode)
;; "Org" as language. Be sure to disclose
;; everything when activating the major mode.
(when (eq lang-mode 'org-mode) (org-cycle '(64)))
(insert code)
;; Fontify buffer.
(font-lock-fontify-buffer)
;; Remove formatting on newline characters.