[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf f83a212 213/310: Temporarily disable font-lock duri
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf f83a212 213/310: Temporarily disable font-lock during multiple batch operations. |
Date: |
Sat, 28 Nov 2020 00:33:18 -0500 (EST) |
branch: externals/vlf
commit f83a212c52a9736bca43c17091fed6c0fc23d1ce
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Temporarily disable font-lock during multiple batch operations.
---
vlf-ediff.el | 10 ++++++++++
vlf-search.el | 13 ++++++++++++-
vlf-write.el | 5 ++++-
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/vlf-ediff.el b/vlf-ediff.el
index 829ce98..232c918 100644
--- a/vlf-ediff.el
+++ b/vlf-ediff.el
@@ -158,19 +158,23 @@ logical chunks in case there is no difference at the
current ones."
(let ((end-A (= vlf-start-pos vlf-end-pos))
(chunk-A (cons vlf-start-pos vlf-end-pos))
(point-max-A (point-max))
+ (font-lock-A font-lock-mode)
(min-file-size vlf-file-size)
(forward-p (eq next-func 'vlf-next-chunk)))
+ (font-lock-mode 0)
(set-buffer buffer-B)
(setq buffer-B (current-buffer)
min-file-size (min min-file-size vlf-file-size))
(let ((end-B (= vlf-start-pos vlf-end-pos))
(chunk-B (cons vlf-start-pos vlf-end-pos))
+ (font-lock-B font-lock-mode)
(done nil)
(reporter (make-progress-reporter
"Searching for difference..."
(if forward-p vlf-start-pos
(- min-file-size vlf-end-pos))
min-file-size)))
+ (font-lock-mode 0)
(unwind-protect
(progn
(while (and (or (not end-A) (not end-B))
@@ -217,6 +221,12 @@ logical chunks in case there is no difference at the
current ones."
(and (not end-A) (not end-B)))
(vlf-ediff-refine buffer-A buffer-B)))
(setq done t))
+ (when font-lock-A
+ (set-buffer buffer-A)
+ (font-lock-mode 1))
+ (when font-lock-B
+ (set-buffer buffer-B)
+ (font-lock-mode 1))
(unless done
(set-buffer buffer-A)
(set-buffer-modified-p nil)
diff --git a/vlf-search.el b/vlf-search.el
index 32ec2bd..422fbda 100644
--- a/vlf-search.el
+++ b/vlf-search.el
@@ -40,12 +40,14 @@ BATCH-STEP is amount of overlap between successive chunks."
(match-start-pos (+ vlf-start-pos (position-bytes (point))))
(match-end-pos match-start-pos)
(to-find count)
+ (font-lock font-lock-mode)
(reporter (make-progress-reporter
(concat "Searching for " regexp "...")
(if backward
(- vlf-file-size vlf-end-pos)
vlf-start-pos)
vlf-file-size)))
+ (font-lock-mode 0)
(vlf-with-undo-disabled
(unwind-protect
(catch 'end-of-file
@@ -108,6 +110,7 @@ BATCH-STEP is amount of overlap between successive chunks."
vlf-end-pos)))))
(progress-reporter-done reporter))
(set-buffer-modified-p nil)
+ (if font-lock (font-lock-mode 1))
(if backward
(vlf-goto-match match-chunk-start match-chunk-end
match-end-pos match-start-pos
@@ -179,11 +182,17 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(let ((start-pos vlf-start-pos)
(end-pos vlf-end-pos)
(pos (point))
+ (font-lock font-lock-mode)
(success nil))
+ (font-lock-mode 0)
(unwind-protect
(if (< 0 n)
(let ((start 0)
(end (min vlf-batch-size vlf-file-size))
+ (reporter (make-progress-reporter
+ (concat "Searching for line "
+ (number-to-string n) "...")
+ 0 vlf-file-size))
(inhibit-read-only t))
(setq n (1- n))
(vlf-with-undo-disabled
@@ -230,9 +239,11 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(vlf-move-to-chunk-2 start end)
(goto-char (point-max))
(setq success (vlf-re-search "[\n\C-m]" n t 0))))))
+ (if font-lock (font-lock-mode 1))
(unless success
(vlf-move-to-chunk-2 start-pos end-pos)
- (goto-char pos)))))
+ (goto-char pos)
+ (message "Unable to find line")))))
(provide 'vlf-search)
diff --git a/vlf-write.el b/vlf-write.el
index 7e9d069..ffb948a 100644
--- a/vlf-write.el
+++ b/vlf-write.el
@@ -52,10 +52,13 @@ Save anyway? "))
region-length)))
(if (zerop size-change)
(write-region nil nil buffer-file-name vlf-start-pos t)
- (let ((pos (point)))
+ (let ((pos (point))
+ (font-lock font-lock-mode))
+ (font-lock-mode 0)
(if (< 0 size-change)
(vlf-file-shift-back size-change)
(vlf-file-shift-forward (- size-change)))
+ (if font-lock (font-lock-mode 1))
(vlf-move-to-chunk-2 vlf-start-pos
(if (< (- vlf-end-pos vlf-start-pos)
vlf-batch-size)
- [elpa] externals/vlf 516584e 187/310: Break VLF into components., (continued)
- [elpa] externals/vlf 516584e 187/310: Break VLF into components., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 27e3bbb 201/310: Reuse initial ediff session for all chunks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9343095 193/310: Fix installation interfile dependencies and fix setting of local, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 88dba8b 195/310: Remove unnecessary addition to load-path on compile., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf dd43af5 192/310: Manually decode and use several bytes buffer when loading chunk., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 98ddc3a 198/310: Add by batch Ediff functionality., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9646b00 202/310: Adjust chunk borders to minimize shift differences and optimize, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d5d9cd7 205/310: Improve refining of differences and readjustment., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0fa8e8d 210/310: Update buffer name on user interruption during ediff., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 30d2bb0 208/310: VLF buffer ediff now starts from the current chunks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f83a212 213/310: Temporarily disable font-lock during multiple batch operations.,
Stefan Monnier <=
- [elpa] externals/vlf 074f9e9 221/310: Play nicely with hexl-mode., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 8c61b77 222/310: Fix when batch hooks are run for occur and save., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 6476c1b 227/310: Update README, wording, add links and information on hooks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 8ba5bea 229/310: Don't run vlf-after-batch-functions hook in vlf-build-occur., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 569e4b2 237/310: Don't ask needles questions on changing helm batch and restore undo, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 1f9ba7c 230/310: Use derived-mode-p., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 32ff2cb 239/310: Add bookkeeping module., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5379943 242/310: Save times instead of speeds, compare on cumulative speed when tuning., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0d9cc8e 245/310: Don't measure encoding of too small region when adjusting chunk start, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e8bb4a9 248/310: Apply batch size tuning on adjacent moves, search, save adjusting and, Stefan Monnier, 2020/11/28