From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#69108: false-positive warning "variable =?UTF-8?Q?=E2=80=98=5F=E2=80=99?= not left unused" in if-let* and if-let Date: Sat, 17 Feb 2024 12:20:16 +0300 Message-ID: <78798be7b3bc7a7bb477d4ec952734b199588d00.camel@yandex.ru> References: <87il2ryi30.fsf@web.de> <87mss09bnc.fsf@web.de> <86eddbv7no.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1797"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.3 Cc: 69108@debbugs.gnu.org To: Eli Zaretskii , Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 17 10:21:00 2024 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 1rbGsW-00009I-Jd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Feb 2024 10:21:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbGsI-0006m8-E1; Sat, 17 Feb 2024 04:20:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbGsF-0006i6-5P for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 04:20:43 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbGsE-0007Ss-Ih for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 04:20:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbGsY-0007Hn-0u for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 04:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Feb 2024 09:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69108 X-GNU-PR-Package: emacs Original-Received: via spool by 69108-submit@debbugs.gnu.org id=B69108.170816164527975 (code B ref 69108); Sat, 17 Feb 2024 09:21:01 +0000 Original-Received: (at 69108) by debbugs.gnu.org; 17 Feb 2024 09:20:45 +0000 Original-Received: from localhost ([127.0.0.1]:60455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbGsG-0007H9-Vt for submit@debbugs.gnu.org; Sat, 17 Feb 2024 04:20:45 -0500 Original-Received: from forward502c.mail.yandex.net ([178.154.239.210]:55604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbGsC-0007Gv-3g for 69108@debbugs.gnu.org; Sat, 17 Feb 2024 04:20:44 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:2214:0:640:d6b5:0]) by forward502c.mail.yandex.net (Yandex) with ESMTPS id 8300060C15; Sat, 17 Feb 2024 12:20:17 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id GKKHWrMAXCg0-EL6ZksTh; Sat, 17 Feb 2024 12:20:17 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1708161617; bh=k6h6OWWCu9zl96/qbv+Mw7lr9v0LjEchC1q/TD+Kr/w=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=GjF5WyFp3i6hN/B8KA374F2w69zWcSIPTC7KEJ1qufbbzO4m9m2TGkQSSfdrE0ZZ0 XlwXkrPiNLf8qNUW7xvQEfl3zuy1v/CTJH3W/lixUZ1yFTsEL5pkQNofpTOBIXsF0a 2hr46ZGqSOT4pr8wLWq0ViTF2xVB+DqUx6ZGuMIw= Authentication-Results: mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <86eddbv7no.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280121 Archived-At: On Sat, 2024-02-17 at 10:04 +0200, Eli Zaretskii wrote: > > Cc: 69108@debbugs.gnu.org > > Date: Sat, 17 Feb 2024 01:28:55 +0100 > > From:=C2=A0 Michael Heerdegen via "Bug reports for GNU Emacs, > > =C2=A0the Swiss army knife of text editors" > >=20 > > --- a/lisp/subr.el > > +++ b/lisp/subr.el > > @@ -2575,12 +2575,12 @@ delay-mode-hooks > > =C2=A0(defun internal--build-binding (binding prev-var) > > =C2=A0=C2=A0 "Check and build a single BINDING with PREV-VAR." > > =C2=A0=C2=A0 (setq binding > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((symbolp binding) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (pcase binding > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((pred symbolp) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (list bind= ing binding)) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((null (cdr binding)) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (list (make-sym= bol "s") (car binding))) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (t binding))) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((or `(,test) `(_ ,te= st)) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (list (make-sym= bol "s") test)) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (_ binding))) >=20 > Thanks, but can we please leave this as 'cond', instead of converting > it to a 'pcase'?=C2=A0 It doesn't seem to be justified here, and even les= s > so since you need to rewrite all the existing conditions. Just a side note, from my experience pcase is very slow=C2=B9, so if a function supposed to be called often, I presume it's better to avoid `pcase`. Although, Idk how it compares to `cond`. But judging from the fact `cond` is implemented in C, it is likely faster. 1: https://github.com/ankurdave/color-identifiers-mode/commit/bc566bcdbd79f230= b35eafd2b6c4f8428402ec09