From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: inverse of add-to-list: remove-from-list Date: Thu, 15 Oct 2020 12:31:27 -0400 Message-ID: References: <87pn5mtt2x.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31733"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel To: Thibaut Verron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 15 18:32:21 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kT6Au-00086p-VT for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 18:32:20 +0200 Original-Received: from localhost ([::1]:32934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6Au-0006BP-1S for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 12:32:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6A9-0005iZ-9p for emacs-devel@gnu.org; Thu, 15 Oct 2020 12:31:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6A7-0007If-BX for emacs-devel@gnu.org; Thu, 15 Oct 2020 12:31:32 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F034C44112C; Thu, 15 Oct 2020 12:31:29 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A7816441119; Thu, 15 Oct 2020 12:31:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1602779488; bh=FoJb03VG2hb0qtpbeujwD+tDsKSkuCI4ehv8AwHTC8A=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=HI1OSwHWCkn1w7l8dvfK6PRoDcyiMYO/QF1lvTNT0hSXnLjUH61nJPO8wiOx2weHw DrC9cH285dDpJiRYXDqVrW1Vo6wpvPGegQ8TsnloXCXi7hBnLM4baGkjOl3GagWFFQ Tx+NyCPVpct33qyzNhgmR8ejW5PjWFQXpVY9d1s9aQs3dWQX+KLYvGAdEBorzPBKXE MRVFwBKNT9j0UNOMx9NCeIO1Pf4pHFEBJjEoV6UDaj6r0h1d5uYz5k1ko/W1zl8Twd ryBLbpgmCZJZ5R35azZfhCALO1F8zcUVR/4fSiJbuwv2eJ7yfPC0iG3wzcxBmqBpLU bXLDlmaFjgBPg== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 83C061203A6; Thu, 15 Oct 2020 12:31:28 -0400 (EDT) In-Reply-To: (Thibaut Verron's message of "Wed, 14 Oct 2020 07:58:14 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 08:25:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:257750 Archived-At: > I might be missing something, but where would the harm be in using >> (add-hook 'org-export-filter-src-block-functions 'my-html-filter-src-blocks) > even if it is not a hook? I think none, but it would be harmful to do: (add-hook 'org-export-filter-src-block-functions #'my-html-filter-src-blocks nil t) > So basically the answer would be, instead of looking for an opposite > to add-to-list, use cl-pushnew which has a natural opposite in > cl-remove. Is that so? `cl-remove` is not the opposite of `cl-pushnew`, because (cl-pushnew V X :test F) (cl-remove V X :test F) will usually result in X being different from what it started (because `cl-remove` does not modify its argument X). Stefan