bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Basil L. Contovounesios
Subject: bug#41868: [PATCH] Add project-clean-up command
Date: Mon, 15 Jun 2020 12:38:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Philip K." <philip@warpmail.net> writes:

> Thanks for the notes, just a few questions/justifications below:
>
> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>>> +        (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).

I just thought it might be more natural to process buffers in their
usual order, in case it makes a difference in any kill-buffer-related
hooks.  It probably doesn't matter much.

>>> +    (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.

A lot of seq.el functions are autoloaded, including seq-some.

Thanks,

-- 
Basil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]