From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35508: 27.0.50; Fine-ordering of functions on hooks Date: Wed, 01 May 2019 21:00:21 +0300 Message-ID: <831s1iqclm.fsf@gnu.org> References: Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="122102"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35508@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 01 20:01:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLtXi-000Vap-EX for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2019 20:01:18 +0200 Original-Received: from localhost ([127.0.0.1]:37879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLtXh-0004e5-BX for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2019 14:01:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLtXW-0004by-CH for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:01:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLtXU-0001xo-8M for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:01:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLtXS-0001wy-Ji for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:01:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hLtXS-0003AI-6u for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 May 2019 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35508 X-GNU-PR-Package: emacs Original-Received: via spool by 35508-submit@debbugs.gnu.org id=B35508.155673364912139 (code B ref 35508); Wed, 01 May 2019 18:01:02 +0000 Original-Received: (at 35508) by debbugs.gnu.org; 1 May 2019 18:00:49 +0000 Original-Received: from localhost ([127.0.0.1]:44859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLtXE-00039i-Uc for submit@debbugs.gnu.org; Wed, 01 May 2019 14:00:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLtXD-00039X-OX for 35508@debbugs.gnu.org; Wed, 01 May 2019 14:00:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLtX7-0001k8-IR; Wed, 01 May 2019 14:00:41 -0400 Original-Received: from [176.228.60.248] (port=2892 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hLtX2-0002Kf-LR; Wed, 01 May 2019 14:00:40 -0400 In-reply-to: (message from Stefan Monnier on Tue, 30 Apr 2019 16:37:08 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158593 Archived-At: > From: Stefan Monnier > Date: Tue, 30 Apr 2019 16:37:08 -0400 > > Occasionally it's important to control the relative ordering of > functions on hooks. It's usually a bad idea, but sometimes alternatives > are worse. Could you please give a couple of examples? I agree that it's usually a bad idea, so maybe we should resist the temptation. If the worse comes to worst, a Lisp program could concoct the entire hook list in any order it sees fit, right? > +The place where the function is added depends on the DEPTH > +parameter. DEPTH defaults to 0. So from now on, omitting DEPTH will not necessarily put the function at the beginning of the hook list? That's backward-incompatible, no? In any case, this default is insufficiently tested by the tests you propose. > By convention, should be > +a number between -100 and 100 where 100 means that the function > +should be at the very end of the list, whereas -100 means that > +the function should always come first. When two functions have > +the same depth, the new one gets added after the old one if > +depth is strictly positive and before otherwise. So using 100 more than once makes the last one "win"? > +For backward compatibility reasons, a symbol other than nil is > +interpreted as a DEPTH of 90. This is not explicitly tested by the test. Thanks.