From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Philip K." Newsgroups: gmane.emacs.bugs Subject: bug#41868: [PATCH] Add project-clean-up command Date: Mon, 15 Jun 2020 13:32:36 +0200 Message-ID: <87wo48r2cr.fsf@warpmail.net> References: <87k108wsvb.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="87337"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41868@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 15 13:33:19 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jknMc-000MYJ-Ig for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Jun 2020 13:33:19 +0200 Original-Received: from localhost ([::1]:43404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jknMb-0007LJ-JI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Jun 2020 07:33:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jknMM-0007L9-Ck for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2020 07:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jknMM-0000HL-3Q for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2020 07:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jknML-0007bh-U4 for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2020 07:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jun 2020 11:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41868 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41868-submit@debbugs.gnu.org id=B41868.159222076829220 (code B ref 41868); Mon, 15 Jun 2020 11:33:01 +0000 Original-Received: (at 41868) by debbugs.gnu.org; 15 Jun 2020 11:32:48 +0000 Original-Received: from localhost ([127.0.0.1]:45351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jknM7-0007bE-Qc for submit@debbugs.gnu.org; Mon, 15 Jun 2020 07:32:48 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jknM5-0007b0-4a for 41868@debbugs.gnu.org; Mon, 15 Jun 2020 07:32:46 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E9CBA5C0106; Mon, 15 Jun 2020 07:32:39 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 15 Jun 2020 07:32:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:cc:subject:in-reply-to:date:message-id:mime-version :content-type; s=fm3; bh=13EzZWme3ZcL3ch+K5q+GuXZepVH5OdxynoOLIR 1/xE=; b=LnESMGkSM3ICqqR22bmah+RGGN3l8sRHed9DePIpGmWuTp49jWBgbuJ Ovx9ZOORiHXWX4JAlFb7SyUMA5NXIdocA2ZJquVizh0PW1vM6U5/mjz1KbIugjh5 Q0EolgHLMEYfJLBuqNqvz2AJlDSoNqC8g+nggVIRQvY8HJw094meUxzCJhS58QP+ hPpqTlK8q2mrB6G8rURc+WazxyIUl3/6B6c4ADnDlBvz0UqO0Yq3Suhw2KpQL5sS yKNZZLs3C/MJh/rDlgqM42VWFQ/QkmhBOu8KolUej0Oo4VkxA9p4JHdc5nbdcUG9 89B+WMxUxRDWltXbJCCJHiB6BSEXtAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=13EzZWme3ZcL3ch+K 5q+GuXZepVH5OdxynoOLIR1/xE=; b=nXktfSv/LJZhaPCuBNz1JbEiTuhA6rfyO Y8k4y/ULQUJwd7l5XGOEc1d0kVXv9xYwPHSiZvmlZSkhTYpQ6ES1EnWqsRNDWi7G Wl2UTLZjBovkkCFxrrK9hsa7v/1Zn096D0sKvo9dUfwEVd4SMHmZ+XZBAAeTTZAT iSlUjZ9t1dX7xBr+uDBtMV1zlJ8ELllOmwRXm2NwUbCe02v4LCI8Q1MQsA4ESV1D +k4jYJAeCa5xyMJjHWZBSk1GajY+ZNKJTuyiYKT7lLdcR/G3WnhVV/YObAjhZkrj mSIW+gYG3Rc/VsDuu5z66w+qvgIf+Klc/3mkmiYTY5T0jNSJ/EOAA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeikedggeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfffkgggtsehttdertddttddtnecuhfhrohhmpedfrfhhihhlihhp ucfmrddfuceophhhihhlihhpseifrghrphhmrghilhdrnhgvtheqnecuggftrfgrthhtvg hrnhepheeuieffveevkeetffeufeekfeejkeekkeefjeelueeftdduffdugfeuieegfffh necukfhppeejledrvdduledrudelledrvdduheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesfigrrhhpmhgrihhlrdhnvght X-ME-Proxy: Original-Received: from localhost (p4fdbc7d7.dip0.t-ipconnect.de [79.219.199.215]) by mail.messagingengine.com (Postfix) with ESMTPA id 52FB7328005E; Mon, 15 Jun 2020 07:32:39 -0400 (EDT) In-Reply-To: <87sgewr3n0.fsf@tcd.ie> (contovob@tcd.ie) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181981 Archived-At: Thanks for the notes, just a few questions/justifications below: "Basil L. Contovounesios" 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 buffers under ? "? 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.