From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#21563: 24.5; discourage load-hook variables Date: Wed, 15 Jan 2020 16:24:10 -0800 (PST) Message-ID: <320a9fa6-6419-420e-ac97-9dcbe54a04a6@default> References: <39185.7955.374134.22021@gargle.gargle.HOWL> <87tv4w1poj.fsf@marxist.se> <87muaoz2qu.fsf@marxist.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="707"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Roland Winkler , 21563@debbugs.gnu.org To: Stefan Kangas , Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 16 01:25:13 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 1irsyH-00008H-7a for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jan 2020 01:25:13 +0100 Original-Received: from localhost ([::1]:34500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irsyF-0005Q6-Sw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Jan 2020 19:25:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58589) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irsy8-0005Pt-6K for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 19:25:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irsy6-0007MN-I9 for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 19:25:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irsy6-0007MC-F0 for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 19:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irsy6-0000Wn-BN for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 19:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jan 2020 00:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21563 X-GNU-PR-Package: emacs Original-Received: via spool by 21563-submit@debbugs.gnu.org id=B21563.15791342611971 (code B ref 21563); Thu, 16 Jan 2020 00:25:02 +0000 Original-Received: (at 21563) by debbugs.gnu.org; 16 Jan 2020 00:24:21 +0000 Original-Received: from localhost ([127.0.0.1]:36506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irsxR-0000Vi-J4 for submit@debbugs.gnu.org; Wed, 15 Jan 2020 19:24:21 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:41782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irsxP-0000VT-Dc for 21563@debbugs.gnu.org; Wed, 15 Jan 2020 19:24:20 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00G0DOxw157344; Thu, 16 Jan 2020 00:24:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=OAl1+haylZgWPxamv2jz8uGK7+XTXW/JOBxlgydy94I=; b=nzpmPBDjkQ9my3uvMf84dqH9Mc2cIp24Trp+F4vLD6YxdhjJwPQQK34TyYTK+MxdTJap +Du3uPmuJDL5b++QlBtfPqSmC7ZVcV04qVKMhYrkylCyrAVOrZym7cvUtnzDVlTrP4qc BdkfU2qsODJjvOwypa61kmL5WEsqHcFnvIpJpss5i5AVUavTWdNM7Eo2Rlj2Zmj+Pv+H lsP9I3TEALzsBwrgmMwwtiuqkTTtpzQhdhpsUJgu9cTo8HqMnNKkFQrM6rux5nOQjOnp D56EYfEt7NdwvcAmzi3A9xL0y/dGEOzzkUpVudFt94o9VDtArYKg5gAbr8w2/BFdkdgN Fw== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2xf73tydss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2020 00:24:13 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00G0ED7T148142; Thu, 16 Jan 2020 00:24:12 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2xj1ps3c4g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2020 00:24:12 +0000 Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00G0OB6T029703; Thu, 16 Jan 2020 00:24:11 GMT In-Reply-To: <87muaoz2qu.fsf@marxist.se> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4939.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9501 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001160000 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9501 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001160000 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:174684 Archived-At: > Interesting. Since they also seem to be prone to cause problems like > in Bug#24491, perhaps it is indeed better to get rid of them. They do > look crufty and redundant once you start reviewing them in context -- > with no clear benefit. >=20 > I believe Drew already pointed out that any use of them could be > easily replaced by (with-)?eval-after-load. No. I didn't say anything about "any use of them". I said only that the behavior that a load hook isn't invoked if the library has already been loaded can be realized by using conditional code inside `(with-)?eval-after-load'. A load hook is a function. Code can invoke it anytime, in any context. It has no predefined behavior, on its own - in particular, nothing like `(with-)?eval-after-load' behavior. The only similarity is that by convention a load hook is invoked at the end of a Lisp file. But nothing prevents using a (funcall dired-load-hook) anywhere. This is not to say that we really need to be able to do that. It's just to say that there's no way to claim that `(with-)?eval-after-load' can be made to do what a load hook does, in general. I don't have a giant objection to doing what you're talking about doing. But I think it's unfortunate, and little, if anything, is really gained. Who knows what 3rd-party code out there makes use of such hooks? And again, they're easy for users to discover. And I think they're likely to be used by code, and not just in init files. That's not so true of `(with-)?eval-after-load' (explicitly discouraged).