On Fri, Jul 15, 2022 at 12:32:30AM +0200, Stephen Berman wrote: > On Wed, 13 Jul 2022 12:51:31 -0500 Archmux wrote: > > > Dear Emacs Help, > > > > I need to filter the results of `find-name-dired' programmatically. > > > > I am attempting it with this command-prototype: > > > > """"" > > > > (with-current-buffer (find-name-dired "~/Musica/" "*.flac") > >   (occur "Hunter") > > ) > > > > """"" > > > > It returns: > > > > """"" > > > > (wrong-type-argument stringp (":%s")) > > > > set-buffer((":%s")) > > > > ... > > > > """"" > > > > > > 1. How do I troubleshoot/discover the issue causing, `set-buffer((":%s"))' ? > > One way is to look at the source of `find-name-dired' and you'll see it > contains no "(:%s)" but it calls `find-dired', which also contains no > "(:%s)" but it calls `find-dired-with-command', which indeed ends with > `(setq mode-line-process '(":%s"))', which means `(":%s")' is the return > value, and that's causing the error. Another useful tool for such things is setting up debug on error, by doing "M-x toggle-debug-on-error". This will lead you to the spot in the source where the error was caught. Cheers -- t