From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#21563: 24.5; discourage load-hook variables Date: Wed, 15 Jan 2020 21:42:39 +0100 Message-ID: <87zheozc1s.fsf@marxist.se> References: <39185.7955.374134.22021@gargle.gargle.HOWL> <87tv4w1poj.fsf@marxist.se> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129300"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Roland Winkler , 21563@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 15 21:43:19 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 1irpVW-000Xbc-S6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Jan 2020 21:43:18 +0100 Original-Received: from localhost ([::1]:60440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irpVV-00038k-Ov for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Jan 2020 15:43:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46698) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irpVK-00038Z-1N for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 15:43:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irpVG-0006qT-BO for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 15:43:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irpVG-0006qL-8K for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 15:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irpVG-0003K8-6J for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2020 15:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Jan 2020 20:43: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.157912096912754 (code B ref 21563); Wed, 15 Jan 2020 20:43:02 +0000 Original-Received: (at 21563) by debbugs.gnu.org; 15 Jan 2020 20:42:49 +0000 Original-Received: from localhost ([127.0.0.1]:35690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irpV3-0003Je-2c for submit@debbugs.gnu.org; Wed, 15 Jan 2020 15:42:49 -0500 Original-Received: from ted.gofardesign.uk ([67.225.143.91]:44676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irpV1-0003JP-1D for 21563@debbugs.gnu.org; Wed, 15 Jan 2020 15:42:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jvX3/AEMw2Dgdi6rfla8iI3nmc0qpShRYCoHP/6s/Hk=; b=KWj57mgoXZcLjCl8raPjw474jo 7ah7O+cWxhcdAhRmE9rADGjvGTHn/0Kz4FmPzKkKZ22YojKrFYYo3RK9apohGLzDemip5Af2jGWwv zZ9tNaZ48dMxrJY6xzbihq8Ww3qe0k2cvSDfumO8OIuu5yQ/Q5cw6l+tUZgKoLcfvHKSOJsh0VbNH uMec3DzNmD3H8dgV13XOT/nxl4gyu2iiJUyd6ww3PFuzMexZR1RWx0EXXcGc5cTjP3RwHoIVrvnDq Ju8OtNaOo5nXGNaFn1xRTRm7sgxxD1M23hOBZVPEv8oSut3pWzCNFhsGDcGogVCcVVpPEGbl61pdB lG3L46uA==; Original-Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:58374 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1irpUv-0007pW-3u; Wed, 15 Jan 2020 15:42:41 -0500 In-Reply-To: (Drew Adams's message of "Wed, 15 Jan 2020 12:21:41 -0800 (PST)") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se 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:174670 Archived-At: Drew Adams writes: >> I would suggest to declare the above variables obsolete >> and point users to eval-after-load instead. > > Why? If the only reason (only one given so far) is > that a user set a hook after loading and expected > the hook setting to be effective, then I'd say that's > not a great reason. I think the idea here was mainly to get rid of redundancy. But see below. > And there was talk at one time of discouraging that as > well, I believe. It's still discouraged for code that's > to be included in Emacs - see (emacs) `Coding Standards'. > (But see also (emacs) `Foldout'.) > > And see (elisp) `Hooks for Loading': > "Normally, well-designed Lisp programs should not > use 'with-eval-after-load'." > > Granted, that's about "Lisp programs" and not init > files. Still... > >> Does anyone disagree with that? > > I think I do. I see something like `dired-load-hook' > as a different tool than `(with-)eval-after-load'. > Not worse or better, either generally or always. > > Setting or changing the explicit hook value has > no effect if the library was already loaded, whereas > `(with-)eval-after-load' has an immediate effect in > that case. (Sure, the latter could test in its body > whether it's loaded and act conditionally...) Good point. So it seems like load-hooks and eval-after-load are slightly different and could both be useful. In that case, I guess this should be closed as a wontfix? Best regards, Stefan Kangas