[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize 9145b68 128/134: Simplify ensuring of font-lock.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize 9145b68 128/134: Simplify ensuring of font-lock. |
Date: |
Sat, 7 Aug 2021 09:17:21 -0400 (EDT) |
branch: elpa/htmlize
commit 9145b68557296fadcf7302e219db062dfdff9429
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>
Simplify ensuring of font-lock.
---
htmlize.el | 41 +++++++++++------------------------------
1 file changed, 11 insertions(+), 30 deletions(-)
diff --git a/htmlize.el b/htmlize.el
index ab90c28..4faeff2 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -1681,28 +1681,19 @@ it's called with the same value of KEY. All other
times, the cached
;; actually fontify the buffer. If font-lock is not in use, we
;; don't care because, except in htmlize-file, we don't force
;; font-lock on the user.
- (when (and (boundp 'font-lock-mode)
- font-lock-mode)
+ (when font-lock-mode
;; In part taken from ps-print-ensure-fontified in GNU Emacs 21.
- (cond
- ((and (boundp 'jit-lock-mode)
- (symbol-value 'jit-lock-mode))
+ (when (and (boundp 'jit-lock-mode)
+ (symbol-value 'jit-lock-mode))
(htmlize-with-fontify-message
(jit-lock-fontify-now (point-min) (point-max))))
- ((and (boundp 'lazy-lock-mode)
- (symbol-value 'lazy-lock-mode))
- (htmlize-with-fontify-message
- (lazy-lock-fontify-region (point-min) (point-max))))
- ((and (boundp 'lazy-shot-mode)
- (symbol-value 'lazy-shot-mode))
- (htmlize-with-fontify-message
- ;; lazy-shot is amazing in that it must *refontify* the region,
- ;; even if the whole buffer has already been fontified. <sigh>
- (lazy-shot-fontify-region (point-min) (point-max))))
- ;; There's also fast-lock, but we don't need to handle specially,
- ;; I think. fast-lock doesn't really defer fontification, it
- ;; just saves it to an external cache so it's not done twice.
- )))
+
+ (if (fboundp 'font-lock-ensure)
+ (font-lock-ensure)
+ ;; Emacs prior to 25.1
+ (with-no-warnings
+ (font-lock-mode 1)
+ (font-lock-fontify-buffer)))))
;;;###autoload
@@ -1820,11 +1811,7 @@ does not name a directory, it will be used as output
file name."
(font-lock-auto-fontify nil)
(global-font-lock-mode nil)
;; Ignore the size limit for the purposes of htmlization.
- (font-lock-maximum-size nil)
- ;; Disable font-lock support modes. This will only work in
- ;; more recent Emacs versions, so htmlize-buffer-1 still needs
- ;; to call htmlize-ensure-fontified.
- (font-lock-support-mode nil))
+ (font-lock-maximum-size nil))
(with-temp-buffer
;; Insert FILE into the temporary buffer.
(insert-file-contents file)
@@ -1834,12 +1821,6 @@ does not name a directory, it will be used as output
file name."
(let ((buffer-file-name file))
;; Set the major mode for the sake of font-lock.
(normal-mode)
- (if (fboundp 'font-lock-ensure)
- (font-lock-ensure)
- ;; Emacs prior to 25.1
- (with-no-warnings
- (font-lock-mode 1)
- (font-lock-fontify-buffer)))
;; htmlize the buffer and save the HTML.
(with-current-buffer (htmlize-buffer-1)
(unwind-protect
- [nongnu] elpa/htmlize 31bc1a8 094/134: Remove stray debugging print., (continued)
- [nongnu] elpa/htmlize 31bc1a8 094/134: Remove stray debugging print., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 8c09264 097/134: Bump version and copyright., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a95e591 107/134: Bump version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 2c41d79 101/134: Update mail address., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 9d4ad62 102/134: Set type and group attribute for custom variable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 88e2cb6 109/134: Update copyright info., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5ea2cc3 113/134: Let `overlays-at' sort the overlays. (#9), ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 1bc2f1b 118/134: Bump version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 726c77b 120/134: Correctly sort overlays in Emacs 24., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a8b73f1 122/134: New option htmlize-untabify. (#21), ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 9145b68 128/134: Simplify ensuring of font-lock.,
ELPA Syncer <=
- [nongnu] elpa/htmlize 86f22f2 132/134: Add Homepage to the package header, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 999eef2 032/134: Support searching for any property change., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 7f94aa2 039/134: Conditionalize on color-instance-rgb-components., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 34845c5 042/134: Update comment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize c847998 057/134: The future has come: switch to lexical scope., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 845329e 060/134: Don't attempt to use lexical binding in emacsen that don't support it., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a6f9f07 066/134: Decide at each macroexpansion whether to use `lexical-let' or `let'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 58775c8 064/134: Improve introductory text., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize db4b76e 076/134: New file: NEWS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 87d4a43 080/134: Recognize tmp overlays with an overlay property., ELPA Syncer, 2021/08/07