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: "Philip K." <philip <at> warpmail.net>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 41868 <at> debbugs.gnu.org
Subject: bug#41868: [PATCH] Add project-clean-up command
Date: Mon, 15 Jun 2020 13:32:36 +0200
Thanks for the notes, just a few questions/justifications below:

"Basil L. Contovounesios" <contovob <at> tcd.ie> 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.




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.