Code Monkey home page Code Monkey logo

Comments (6)

joech4n avatar joech4n commented on August 16, 2024 1

Update: Nvm, user error. :)

@Anks I'm seeing this error with your snippet after adding to dotspacemacs/user-config, any idea why?

(Spacemacs) Error in dotspacemacs/user-config: Wrong type argument: symbolp, (defalias (quote anks-deft-limit\
ing-fn) (function (lambda (orig-fun &rest args) (let ((deft-current-files (-take 30 deft-current-files))) (ap\
ply orig-fun args)))))

from deft.

jrblevin avatar jrblevin commented on August 16, 2024

Thanks for reporting this. I can confirm a similar result when profiling, although I only have about 300 notes at the moment.

I think rather than limiting the number of lines rendered (which would prevent being able to scroll down and see more), to solve the underlying issue a better approach would be a slight redesign where the widget and summary line for each file is created once and stored for re-use. I can't tackle that at the moment, but if anyone wants to take a shot at that I'll certainly accept at a PR.

from deft.

Anks avatar Anks commented on August 16, 2024

Small update: for my personal use, I ended up defining a advice function like this which limits the display to 30 files:

  ;; 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)

This gives me snappy search, and 30 results are 'good enough'.

This is probably not the best solution, but works for me.

Note: the -take function is from dash.el

from deft.

Henry-T avatar Henry-T commented on August 16, 2024

@joech4n why added into a (defalias (quote ...)) block?
I just added directly under user-config, it works quite well

from deft.

jrblevin avatar jrblevin commented on August 16, 2024

I added built-in support for limiting the number of files shown via `deft-file-limit'. See the updated README and the docstring for details.

from deft.

Anks avatar Anks commented on August 16, 2024

@jrblevin Thank you!

from deft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.