From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Philip K." Newsgroups: gmane.emacs.bugs Subject: bug#42386: Acknowledgement ([PATCH] Handle symbols in project-kill-buffers-ignores) Date: Fri, 17 Jul 2020 10:16:59 +0200 Message-ID: <87y2nitv2c.fsf@warpmail.net> References: <878sfjkh8o.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39581"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42386@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 17 10:21:25 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 1jwLcR-000ABp-DI for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jul 2020 10:21:24 +0200 Original-Received: from localhost ([::1]:36568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwLcQ-0004o7-EO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jul 2020 04:21:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwLZC-0007Au-U2 for bug-gnu-emacs@gnu.org; Fri, 17 Jul 2020 04:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jwLZC-00081g-It for bug-gnu-emacs@gnu.org; Fri, 17 Jul 2020 04:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jwLZC-0005nV-Av for bug-gnu-emacs@gnu.org; Fri, 17 Jul 2020 04:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jul 2020 08:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42386 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42386-submit@debbugs.gnu.org id=B42386.159497382922223 (code B ref 42386); Fri, 17 Jul 2020 08:18:02 +0000 Original-Received: (at 42386) by debbugs.gnu.org; 17 Jul 2020 08:17:09 +0000 Original-Received: from localhost ([127.0.0.1]:56658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwLYK-0005mN-QE for submit@debbugs.gnu.org; Fri, 17 Jul 2020 04:17:09 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:44225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwLYI-0005lx-TJ for 42386@debbugs.gnu.org; Fri, 17 Jul 2020 04:17:08 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C9C6F5C00F1; Fri, 17 Jul 2020 04:17:01 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 17 Jul 2020 04:17:01 -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=fm1; bh=zxKFLirRbce4ciz4PWHI8zDv3yZuuiz66QaOc2u dJzc=; b=Xr0qE92kOlTHuAVsJJlQK/Ci7z5ZJ76CBI/wnjnnHhAFaICYsYzI4Jd 4DDkc3BaCf2fLZuJa4Cv57E7vQTJ3/1dw1AgceX9Biur8E64pOHUGwDNKG1MME04 cKr0E/XT3k4uQLFKtj7Uq42dpFaYmkmfRz7tBgvxy2VIhggzFhoTn6CcXdZdaTSf VCTfEgr5eZTqh73asUJ8/HKtAHP2gjPUZgTsAi2yjmyYlQ4XaodQrey1OylsAK5Z PTsMm0ZPuuEfyCp+Nqq9gfh5Me4RPG/GSeCODdHxXX8ooiiYBtwrXt0R2XyYd8q0 lS3AaCJ2pdxubJ0Gt7FUq9lqAFjkVoQ== 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=zxKFLirRbce4ciz4P WHI8zDv3yZuuiz66QaOc2udJzc=; b=m+myE6PzdeWl0TaabmMVMkMTthnF+5E8w k3p5Zwu+0QJbWjlJhmhWg8ouEtnjQwV5Rg/cUOU1JaNyg55KT4f7wqd/Ir3xg3kw qGT2wm3Te+uu9bRZ/5RH8PHLqxg0R5iiwBv22f+V9zpkBwIu/+DIyd813Xz0BvEa RbMPRjgiOTsBJiiFYHmpgam8+ApXExpHnriuDPjFCFimwnunsT/OLfCC24fSKVE1 QIOarAZy96e0DC5IZLH6vULkSna4hX3XaZBtUQKfA1oCmmqVuoPGroziy2+dptMj nq5QoTvgN+J2eqTLZIQCziPsqaZWNxpESgK8WT91J+YtdbYy8KV6Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrfeehgddufedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfffkgggtsehttdertddttddtnecuhfhrohhmpedfrfhhihhlihhp ucfmrddfuceophhhihhlihhpseifrghrphhmrghilhdrnhgvtheqnecuggftrfgrthhtvg hrnhepheeuieffveevkeetffeufeekfeejkeekkeefjeelueeftdduffdugfeuieegfffh necukfhppeekjedrudeghedrtddrudehieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesfigrrhhpmhgrihhlrdhnvght X-ME-Proxy: Original-Received: from localhost (p5791009c.dip0.t-ipconnect.de [87.145.0.156]) by mail.messagingengine.com (Postfix) with ESMTPA id 548553280060; Fri, 17 Jul 2020 04:17:01 -0400 (EDT) In-Reply-To: <83d04uk5nf.fsf@gnu.org> (message from Eli Zaretskii on Fri, 17 Jul 2020 09:38:28 +0300) 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:183135 Archived-At: Eli Zaretskii writes: >> + (lambda (c) >> + (cond ((stringp c) >> + (string-match-p c (buffer-name buf))) >> + ((and (not (memq c project-kill-buffers-ignores)) >> + (functionp c)) > > Once again, I don't think I understand why you need the memq part. The issue is that a major mode symbol is interpreted as a function, and that triggers an error. So if I want to keep shell-mode buffers, and I'm checking an emacs-lisp-mode buffer, the major mode isn't part of project-kill-buffers-ignores (-> first memq), so the seq-some is evaluated, and because shell-mode is a function, the code would try to evaluate it as a predicate, but that fails. I realise just now how stupid the memq is, because instead of stopping major-mode symbols from being evaluated, I just stop everything, as every member of the list is tautologically part of the list. I don't see any way around this, except for trying to analyse the symbols string representation or checking the arity if the function. Neither seem like a particularly clean approach. -- Philip K.