[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a526e86 041/272: Refactor swiper-font-lock-ensure
From: |
Oleh Krehel |
Subject: |
[elpa] master a526e86 041/272: Refactor swiper-font-lock-ensure |
Date: |
Mon, 25 Apr 2016 10:13:15 +0000 |
branch: master
commit a526e86e5ad9f4cda7bb9ab4b57c000b1d99bd22
Author: Will Maier <address@hidden>
Commit: Will Maier <address@hidden>
Refactor swiper-font-lock-ensure
- expose the list of misbehaving major modes
- add swiper-font-lock-ensure-p predicate
No change in behavior.
---
swiper.el | 68 ++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 38 insertions(+), 30 deletions(-)
diff --git a/swiper.el b/swiper.el
index 280e736..e76d68f 100644
--- a/swiper.el
+++ b/swiper.el
@@ -199,38 +199,46 @@
(with-ivy-window
(recenter-top-bottom arg)))
+(defvar swiper-font-lock-exclude
+ '(package-menu-mode
+ gnus-summary-mode
+ gnus-article-mode
+ gnus-group-mode
+ emms-playlist-mode
+ emms-stream-mode
+ erc-mode
+ org-agenda-mode
+ dired-mode
+ jabber-chat-mode
+ elfeed-search-mode
+ elfeed-show-mode
+ fundamental-mode
+ Man-mode
+ woman-mode
+ mu4e-view-mode
+ mu4e-headers-mode
+ help-mode
+ debbugs-gnu-mode
+ occur-mode
+ occur-edit-mode
+ bongo-mode
+ bongo-library-mode
+ bongo-playlist-mode
+ eww-mode
+ twittering-mode
+ vc-dir-mode
+ w3m-mode)
+ "List of major-modes that are incompatible with font-lock-ensure.")
+
+(defun swiper-font-lock-ensure-p ()
+ "Return non-nil if we should font-lock-ensure."
+ (or (derived-mode-p 'magit-mode)
+ (bound-and-true-p magit-blame-mode)
+ (memq major-mode swiper-font-lock-exclude)))
+
(defun swiper-font-lock-ensure ()
"Ensure the entired buffer is highlighted."
- (unless (or (derived-mode-p 'magit-mode)
- (bound-and-true-p magit-blame-mode)
- (memq major-mode '(package-menu-mode
- gnus-summary-mode
- gnus-article-mode
- gnus-group-mode
- emms-playlist-mode
- emms-stream-mode
- erc-mode
- org-agenda-mode
- dired-mode
- jabber-chat-mode
- elfeed-search-mode
- elfeed-show-mode
- fundamental-mode
- Man-mode
- woman-mode
- mu4e-view-mode
- mu4e-headers-mode
- help-mode
- debbugs-gnu-mode
- occur-mode
- occur-edit-mode
- bongo-mode
- bongo-library-mode
- bongo-playlist-mode
- eww-mode
- twittering-mode
- vc-dir-mode
- w3m-mode)))
+ (unless (swiper-font-lock-ensure-p)
(unless (> (buffer-size) 100000)
(if (fboundp 'font-lock-ensure)
(font-lock-ensure)
- [elpa] master 09cb5c9 025/272: ivy: fix ivy--resize-minibuffer-to-fit for small delta, (continued)
- [elpa] master 09cb5c9 025/272: ivy: fix ivy--resize-minibuffer-to-fit for small delta, Oleh Krehel, 2016/04/25
- [elpa] master 6051225 020/272: Call ivy-set-actions with t to affect all commands, Oleh Krehel, 2016/04/25
- [elpa] master 12523d0 023/272: Use flx for highlighting fuzzy matches, Oleh Krehel, 2016/04/25
- [elpa] master 1cd501a 029/272: ivy.el (ivy-completion-in-region): Optimize for 1 cand, Oleh Krehel, 2016/04/25
- [elpa] master 0c844c1 030/272: ivy.el (ivy-completion-in-region): Fix for 1 cand, Oleh Krehel, 2016/04/25
- [elpa] master b5dc239 032/272: counsel.el (counsel--async-sentinel): Fix issue with ivy--regex-ignore-order, Oleh Krehel, 2016/04/25
- [elpa] master b3cd0d5 016/272: ivy.el (ivy-mode): Set completing-read-function, Oleh Krehel, 2016/04/25
- [elpa] master 89ed19e 035/272: ivy.el (ivy--regex-plus): Prettify a bit, Oleh Krehel, 2016/04/25
- [elpa] master 2135752 040/272: counsel.el (counsel--async-filter): Fix up, Oleh Krehel, 2016/04/25
- [elpa] master 426cfcb 028/272: ivy.el (ivy-completion-in-region): Fix a few bugs, Oleh Krehel, 2016/04/25
- [elpa] master a526e86 041/272: Refactor swiper-font-lock-ensure,
Oleh Krehel <=
- [elpa] master 0d410d3 047/272: ivy.el (ivy-flx-limit): Configure when flx is used, Oleh Krehel, 2016/04/25
- [elpa] master c210bf6 050/272: counsel.el (counsel-tmm): Fix tmm free variable, Oleh Krehel, 2016/04/25
- [elpa] master bcb81dd 049/272: Fix swiper "backward" search, Oleh Krehel, 2016/04/25
- [elpa] master a1e0063 018/272: ivy.el (ivy--reset-state): Don't null initial-input, Oleh Krehel, 2016/04/25
- [elpa] master fdb21f6 033/272: counsel.el (counsel--async-sentinel): Re-display when no cands, Oleh Krehel, 2016/04/25
- [elpa] master 1365b2b 031/272: Change tramp prompt from "Find File: " to "address@hidden: ", Oleh Krehel, 2016/04/25
- [elpa] master d1216eb 036/272: Add the '!' behavior into `ivy--regex-ignore-order', Oleh Krehel, 2016/04/25
- [elpa] master 66e00ed 034/272: counsel: Add counsel-up-directory to find-file-map, Oleh Krehel, 2016/04/25
- [elpa] master e23c175 039/272: Insert intermediate candidates during async completions, Oleh Krehel, 2016/04/25
- [elpa] master bc4d4a8 043/272: swiper.el (swiper-font-lock-exclude): Add sauron-mode, Oleh Krehel, 2016/04/25