News for hackers. Stuff that matters.
Re:Bare Metal (The Emacs Essay) by rrgok on Wednesday October 22, 2025 @03:46AM (#45665988)
Would you mind sharing how you did the prioritization of the sources when searching?
Re:Bare Metal (The Emacs Essay) by kragen on Wednesday October 22, 2025 @06:32AM (#45667110)
Not the original poster, but if I were doing it with find rather than fd (or ag or rg, which I think can do it without fd or find) I'd do (untested)

    (find "$projroot" -name .git -prune -o -name node_modules -prune -o \
         \( -name '*.[tj]s' -o -name '*.[tj]sx' \) -print0 ;
     find "$projroot"/node_modules \
         \( -name '*.[tj]s' -o -name '*.[tj]sx' \) -print0 ;
     find "$projroot" -name .git -prune -o -name dist -prune -o \
         \( -name '*.py' \) -print0 ) |
    xargs -0 grep /dev/null "$search_pattern"
And, although that approach does work (and maybe even that script will work without any bug fixes) it probably goes a substantial distance toward showing why fd was written.

Doing the three searches separately and exiting after one succeeds is only slightly more code.

Re:Bare Metal (The Emacs Essay) by paddy_m on Wednesday October 29, 2025 @08:29AM (#45745951)
https://github.com/paddymul/emacs-from-scratch/blob/master/p...

and

https://github.com/paddymul/emacs-from-scratch/blob/master/p...

The emacs-lisp for changing the behaviour of consult-grep was quite complex and took a while to write.