GNU bug report logs - #41868
[PATCH] Add project-clean-up command

Previous Next

Package: emacs;

Reported by: "Philip K." <philip <at> warpmail.net>

Date: Mon, 15 Jun 2020 10:02:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: "Philip K." <philip <at> warpmail.net>
Cc: 41868 <at> debbugs.gnu.org
Subject: bug#41868: [PATCH] Add project-clean-up command
Date: Mon, 15 Jun 2020 12:38:38 +0100
"Philip K." <philip <at> warpmail.net> writes:

> Thanks for the notes, just a few questions/justifications below:
>
> "Basil L. Contovounesios" <contovob <at> 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




This bug report was last modified 4 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.