From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Certner Newsgroups: gmane.emacs.bugs Subject: bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook` Date: Tue, 06 Jul 2021 16:44:56 +0200 Message-ID: <2012643.zr9gB0fHWZ@ravel> References: <87mttdh57n.fsf@gnus.org> <8b715c19-e6bf-90a8-75a2-3ae3e1ace563@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34185"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, monnier@iro.umontreal.ca, jakanakaevangeli@chiru.no To: larsi@gnus.org, 47992@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 06 17:11:00 2021 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 1m0miy-0008Yy-1q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Jul 2021 17:11:00 +0200 Original-Received: from localhost ([::1]:59168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0miw-0005nO-Tj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Jul 2021 11:10:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0mXR-0005CN-FU for bug-gnu-emacs@gnu.org; Tue, 06 Jul 2021 10:59:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0mXO-0002FD-Jj for bug-gnu-emacs@gnu.org; Tue, 06 Jul 2021 10:59:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m0mXO-0006yV-CW for bug-gnu-emacs@gnu.org; Tue, 06 Jul 2021 10:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Olivier Certner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Jul 2021 14:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47992 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed X-Debbugs-Original-To: Lars Ingebrigtsen , bug-gnu-emacs@gnu.org X-Debbugs-Original-Cc: Daniel Mendler , jakanakaevangeli@chiru.no, monnier@iro.umontreal.ca, 47992@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162558352126777 (code B ref -1); Tue, 06 Jul 2021 14:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jul 2021 14:58:41 +0000 Original-Received: from localhost ([127.0.0.1]:49679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0mX3-0006xj-3A for submit@debbugs.gnu.org; Tue, 06 Jul 2021 10:58:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0mK2-0004dK-Aw for submit@debbugs.gnu.org; Tue, 06 Jul 2021 10:45:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0mK2-0002Jv-3L for bug-gnu-emacs@gnu.org; Tue, 06 Jul 2021 10:45:14 -0400 Original-Received: from smtp5-g21.free.fr ([212.27.42.5]:42566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0mK0-0002AN-93 for bug-gnu-emacs@gnu.org; Tue, 06 Jul 2021 10:45:13 -0400 Original-Received: from ravel.localnet (unknown [2.15.208.149]) (Authenticated sender: ocert.dev@free.fr) by smtp5-g21.free.fr (Postfix) with ESMTPSA id 24E6260ADB; Tue, 6 Jul 2021 16:44:57 +0200 (CEST) In-Reply-To: <8b715c19-e6bf-90a8-75a2-3ae3e1ace563@daniel-mendler.de> Received-SPF: neutral client-ip=212.27.42.5; envelope-from=olce.emacs@certner.fr; helo=smtp5-g21.free.fr X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 06 Jul 2021 10:58:37 -0400 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:209524 Archived-At: Hi, > > either. People do `M-x eval-buffer' their .emacs files, and since we're > > using `equal' here, this happens to work -- almost by accident. > > I understand. This argument is pretty similar to Drew's argument, but > realistic. The problem is that people expect idempotence when evaluating > their ".emacs". This property breaks as soon as we require `eq` and if > we want to retain this behavior we have no alternative than keeping the > current behavior. I agree with all this. We should aim for idempotence, as much as practical. Just wanted to add that there is really no other simple general way out than naming lambdas (by whichever mechanism this is done) and matching on names. Indeed, even with `equal', and no changes in some lambda's code, idempotence is not guaranteed: Just use in the code some macro that calls `gensym'. Each evaluation of `lambda' will then raise different functions by `equal', since their code differs. -- Olivier Certner