branch: elpa/dirvish commit 8a0df38f19832fbf8ffc38b022fb13d8aa8807bc Author: Alex Lu <hellosimon1...@hotmail.com> Commit: Alex Lu <hellosimon1...@hotmail.com>
perf: remove redundant text property insertion --- extensions/dirvish-fd.el | 7 ++----- extensions/dirvish-narrow.el | 12 ++++++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/extensions/dirvish-fd.el b/extensions/dirvish-fd.el index 1dec7d1010..03d9f3e17c 100644 --- a/extensions/dirvish-fd.el +++ b/extensions/dirvish-fd.el @@ -259,15 +259,14 @@ value 16, let the user choose the root directory of their search." (defun dirvish-fd-proc-filter (proc string) "Filter for `dirvish-fd' processes PROC and output STRING." - (let ((buf (process-buffer proc)) - (start (process-get proc 'start)) (now (float-time))) + (let ((buf (process-buffer proc))) (if (not (buffer-name buf)) (delete-process proc) (with-current-buffer buf (save-excursion (save-restriction (widen) (let ((beg (point-max)) (data (dirvish-prop :fd-cache)) - (lazy (> (- now start) 0.5)) buffer-read-only lb le fname) + buffer-read-only lb le fname) (goto-char beg) (insert string) (goto-char (process-mark proc)) @@ -279,7 +278,6 @@ value 16, let the user choose the root directory of their search." (setq fname (buffer-substring (- fb 2) (line-end-position))) (beginning-of-line) (insert " ") (setq lb (line-beginning-position) le (line-end-position)) - (unless lazy (dired-insert-set-properties lb le)) (puthash fname (buffer-substring lb (1+ le)) data) (forward-line 1)) (goto-char (point-max)) @@ -296,7 +294,6 @@ value 16, let the user choose the root directory of their search." ((buffer-live-p buf)) (status (process-exit-status proc)) (took (float-time (time-since (process-get proc 'start))))) - (unless (buffer-live-p buf) (cl-return-from dirvish-fd-proc-sentinel)) (unless (eq status 0) (user-error "`fd' exited with status: %s" status)) (if (< took 1.0) (setq took (format "%s ms" (round took 0.001))) diff --git a/extensions/dirvish-narrow.el b/extensions/dirvish-narrow.el index 2fa461801a..db6726d627 100644 --- a/extensions/dirvish-narrow.el +++ b/extensions/dirvish-narrow.el @@ -38,28 +38,32 @@ should return a list of regular expressions." (((class color) (min-colors 88) (background dark)) :foreground "#72a4ff") (((class color) (min-colors 88) (background light)) :foreground "#223fbf") (t :foreground "blue")) - "Face for matches of components numbered 0 mod 4.") + "Face for matches of components numbered 0 mod 4." + :group 'dirvish) (defface dirvish-narrow-match-face-1 '((default :weight bold) (((class color) (min-colors 88) (background dark)) :foreground "#ed92f8") (((class color) (min-colors 88) (background light)) :foreground "#8f0075") (t :foreground "magenta")) - "Face for matches of components numbered 1 mod 4.") + "Face for matches of components numbered 1 mod 4." + :group 'dirvish) (defface dirvish-narrow-match-face-2 '((default :weight bold) (((class color) (min-colors 88) (background dark)) :foreground "#90d800") (((class color) (min-colors 88) (background light)) :foreground "#145a00") (t :foreground "green")) - "Face for matches of components numbered 2 mod 4.") + "Face for matches of components numbered 2 mod 4." + :group 'dirvish) (defface dirvish-narrow-match-face-3 '((default :weight bold) (((class color) (min-colors 88) (background dark)) :foreground "#f0ce43") (((class color) (min-colors 88) (background light)) :foreground "#804000") (t :foreground "yellow")) - "Face for matches of components numbered 3 mod 4.") + "Face for matches of components numbered 3 mod 4." + :group 'dirvish) (defun dirvish-narrow--highlight (regexps ignore-case string) "Destructively propertize STRING to highlight a match of each of the REGEXPS.