Subject: Re: bug#41868: [PATCH] Add project-clean-up command

From: "Philip K." <[email-masked]>
Date: Mon, 15 Jun 2020 13:32:36 +0200

Thanks for the notes, just a few questions/justifications below:

"Basil L. Contovounesios" <[email-masked]> writes:

>> And it might be worth considering to add a prompt, to ask the user if
>> they actually want to kill all the buffers.
>
> Something like "Kill <N> buffers under <root>? "?

Yes, I'll propose something like that in my next patch.

>> +        (when (file-in-directory-p true root)
>> +          (push buf bufs))))
>> +    bufs))
>
> Maybe the list should be returned in the same order as (buffer-list), by
> using either nreverse or seq-filter?

Is there any benifit to this, or is this just a matter of not disrupting
expectations? My thought was that this was more like a set than a proper
list (despite the function name).

>> +    (dolist (buf (project--list-buffers pr))
>> +      (let ((match (mapcar (lambda (re)
>> +                             (and (string-match-p re (buffer-name buf)) t))
>> +                           project-dont-clean-regexps)))
>> +        (unless (memq t match)
>> +          (kill-buffer buf))))))
>
> Nit: AKA
>
>   (unless (seq-some (lambda (re)
>                       (string-match-p re (buffer-name buf)))
>                     project-dont-clean-regexps)
>     ...)

Would this require adding a "(require 'seq)" to the top? I always kind
of hesistate in adding new dependencies in patches, but if it's already
loaded, it would look better this way.

-- 
	Philip K.