Skip to content

Commit

Permalink
Temporary fix for slow rendering of deft file list: jrblevin/deft#43
Browse files Browse the repository at this point in the history
Issue: jrblevin/deft#43

Temp fix: use a advising function to limit `deft-current-files` to 30
items, which speeds up rendering.
  • Loading branch information
Anks committed Dec 11, 2017
1 parent 410d92f commit ca19cd1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions writing.el
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@
(replace-regexp-in-string "-\\*-.*-\\*-" "" (deft-strip-title str)))
(setq deft-parse-title-function 'deft-title-fn-strip-file-vars)

;; Overwrite `deft-current-files` for the `deft-buffer-setup` and limit it to 30 entries
(defun anks-deft-limiting-fn (orig-fun &rest args)
(let
((deft-current-files (-take 30 deft-current-files)))
(apply orig-fun args)))

(advice-add 'deft-buffer-setup :around #'anks-deft-limiting-fn)

:bind (([f8] . deft)))


Expand Down

0 comments on commit ca19cd1

Please sign in to comment.