summaryrefslogtreecommitdiff
path: root/lisp/htmlfontify.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-05-28 23:45:29 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-05-28 23:45:29 -0400
commit6711a21f1125c0047c56eb266eb374c1ec90a967 (patch)
tree07e761cee4e5ff11f95debfb4f9885c1a6b0c6f6 /lisp/htmlfontify.el
parent2662ca5cd9fad3160df88f180600f68cd34331f6 (diff)
downloademacs-6711a21f1125c0047c56eb266eb374c1ec90a967.tar.gz
emacs-6711a21f1125c0047c56eb266eb374c1ec90a967.tar.bz2
emacs-6711a21f1125c0047c56eb266eb374c1ec90a967.zip
* lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.
(font-lock-fontify-buffer): Mark interactive-only. (font-lock-multiline, font-lock-fontified, font-lock-set-defaults): Make buffer-local. (font-lock-specified-p): Remove redundant boundp check. (font-lock-flush-function, font-lock-ensure-function): New vars. (font-lock-turn-on-thing-lock): Set them. (font-lock-default-fontify-buffer): Obey font-lock-dont-widen. (font-lock-after-change-function): Make `old-len' optional. (font-lock-set-defaults): Remove redundant `set' of font-lock-defaults. Call font-lock-flush, just in case. * lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in recent Emacsen. * lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete. (vera-mode-map, vera-mode-menu): Remove bindings to it. * lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure and with-syntax-table. * lisp/textmodes/conf-mode.el (conf-quote-normal): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/prog-mode.el (prettify-symbols-mode): * lisp/progmodes/f90.el (f90-font-lock-n): * lisp/progmodes/cwarn.el (cwarn-mode): * lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display): * lisp/progmodes/compile.el (compilation-setup, compilation--unsetup): * lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer) (hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush. * lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of font-lock-fontify-buffer-function and font-lock-unfontify-buffer-function. (rmail-unfontify-buffer-function, rmail-fontify-message): Use with-silent-modifications. * lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now and font-lock-ensure. * lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure. * lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure. * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush. * lisp/org/org-compat.el (org-font-lock-ensure): New function. * lisp/org/ox-odt.el (org-odt-do-format-code): * lisp/org/ox-html.el (org-html-fontify-code): * lisp/org/org.el (org-fontify-like-in-org-mode): * lisp/org/org-src.el (org-src-font-lock-fontify-block): * lisp/org/org-clock.el (org-clock-get-clocktable): Use it. * lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file from Elisp. * test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure. (ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
Diffstat (limited to 'lisp/htmlfontify.el')
-rw-r--r--lisp/htmlfontify.el26
1 files changed, 17 insertions, 9 deletions
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 56887f39bef..5128ca8f9c4 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -1809,17 +1809,25 @@ fontified. This is a simple convenience wrapper around
(eval-and-compile (require 'font-lock))
(if (boundp 'font-lock-cache-position)
(or font-lock-cache-position
- (set 'font-lock-cache-position (make-marker))))
- (if (not noninteractive)
- (progn
- (message "hfy interactive mode (%S %S)" window-system major-mode)
- (when (and font-lock-defaults
- font-lock-mode)
- (font-lock-fontify-region (point-min) (point-max) nil)))
+ (setq font-lock-cache-position (make-marker))))
+ (cond
+ (noninteractive
(message "hfy batch mode (%s:%S)"
(or (buffer-file-name) (buffer-name)) major-mode)
- (when font-lock-defaults
- (font-lock-fontify-buffer)) ))
+ (if (fboundp 'font-lock-ensure)
+ (font-lock-ensure)
+ (when font-lock-defaults
+ (font-lock-fontify-buffer))))
+ ((fboundp #'jit-lock-fontify-now)
+ (message "hfy jit-lock mode (%S %S)" window-system major-mode)
+ (jit-lock-fontify-now))
+ (t
+ (message "hfy interactive mode (%S %S)" window-system major-mode)
+ ;; If jit-lock is not in use, then the buffer is already fontified!
+ ;; (when (and font-lock-defaults
+ ;; font-lock-mode)
+ ;; (font-lock-fontify-region (point-min) (point-max) nil))
+ )))
;;;###autoload
(defun htmlfontify-buffer (&optional srcdir file)