News for hackers. Stuff that matters.
Re:Bare Metal (The Emacs Essay) by PaulDavisThe1st on Tuesday October 21, 2025 @11:08AM (#45656767)
To be fair, running grep from Emacs is a mistake - you should be using ag, or some other parallelized version of grep :)

Ardour has around 800k lines of code, and ag (not even the fastest of the new greps) can search it all more or less faster than I can type.

The idea of some system that analyzes/caches/indexes the code just isn't necessary anymore.

Re:Bare Metal (The Emacs Essay) by kragen on Tuesday October 21, 2025 @12:03PM (#45657454)
That seems reasonable, yeah. ripgrep, etc., are definitely faster.

Somehow I never twigged that you wrote Ardour and JACK. Thanks for JACK! (My audio editing needs are very modest and so I haven't actually tried Ardour.)

Re:Bare Metal (The Emacs Essay) by paddy_m on Tuesday October 21, 2025 @04:17PM (#45661124)
I customized grep-find on my setup. I have a shell script so that it does the following (in typescript-mode)

first search ts, tsx, js, jsx files in the current project. Exclude .git, node_modules...

then search node_modules with the ts.. extensions, still exclude .git

finally search the whole tree for .py files still exclude .git, /dist...

This is coupled with consult-find-grep. I basically want to find a string in the most relevant file type. I never want a result from node_modules first in the results. It took some work, but the results are quite nice!

Re:Bare Metal (The Emacs Essay) by kragen on Tuesday October 21, 2025 @05:05PM (#45661706)
Oh, yeah, I wrote some Emacs Lisp that did that kind of project-specific thing for a Perl project I was working on for a couple of years in 02003 and 02004. One function key would search the whole project for occurrences of the identifier under the cursor, and another one would search for definitions.
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.