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: [nongnu] elpa/eat 64dcbd2c07: Fix recursive load error Date: Mon, 03 Jul 2023 23:10:30 -0400 Message-ID: References: <168840363703.15967.5071736694173434331@vcs2.savannah.gnu.org> <20230703170037.5C229C11DC2@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7555"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Akib Azmain Turja To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 04 05:11:29 2023 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 1qGWRr-0001jD-3z for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jul 2023 05:11:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGWRA-0005Sb-8S; Mon, 03 Jul 2023 23:10:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGWR4-0005SK-J3 for emacs-devel@gnu.org; Mon, 03 Jul 2023 23:10:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGWR2-0005vZ-Ob for emacs-devel@gnu.org; Mon, 03 Jul 2023 23:10:38 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 15E2B4425C9; Mon, 3 Jul 2023 23:10:33 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 784EE4425CA; Mon, 3 Jul 2023 23:10:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688440231; bh=SrG9y5w72lODZXYfEWrp4u9Cpn9Q+9X+Us4XKrW4+FE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RDnLBXX9Hyvm40Y0Xgn2XWi+ApfYII3l7T4wpEwg13IAzpIYM4ns3BR5Ks02AlN/O 8Chsg7vshyPnsaUmpLLVMtikhRqPVxqBZGm5e9Y+41JhtzDDIPLf6jTCMjN4HOkWqt A8S7lsLya28whG76Ua+Eb+lSBvD5dSZfNs1Y6/+g3kgVsYcaYL/vhM1Ydx8WpHREpt sw4okTOIylqmly3MoK9k0JaoyHyDadjjl7gHvz19rM7Ljh+LWzWhy2k4SFg0Fr7HJV OsFhpjFT3R/jfF5ODCbH7M/2yNoEwGMTTpaRj+MLBJtdEE3daOfytgKt8tztV+7oL6 iT+eW+2RY5MaQ== Original-Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 52DAA12027B; Mon, 3 Jul 2023 23:10:31 -0400 (EDT) In-Reply-To: <20230703170037.5C229C11DC2@vcs2.savannah.gnu.org> (ELPA Syncer's message of "Mon, 3 Jul 2023 13:00:37 -0400 (EDT)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307398 Archived-At: > diff --git a/eat.el b/eat.el > index 8b17743906..8270f6fb25 100644 > --- a/eat.el > +++ b/eat.el > @@ -221,7 +221,9 @@ make the changes effective." > (when (and (not eat--being-loaded) > (boundp 'eat-semi-char-mode-map)) > (eat-update-semi-char-mode-map) > - (eat-reload))) > + (let ((after-load-alist nil) > + (after-load-functions nil)) > + (eat-reload)))) > :group 'eat-ui) > > (defcustom eat-eshell-semi-char-non-bound-keys > @@ -267,7 +269,9 @@ Eat to make the changes effective." > (when (and (not eat--being-loaded) > (boundp 'eat-eshell-semi-char-mode-map)) > (eat-eshell-update-semi-char-mode-map) > - (eat-reload))) > + (let ((after-load-alist nil) > + (after-load-functions nil)) > + (eat-reload)))) > :group 'eat-eshell) > > (defcustom eat-enable-directory-tracking t Hmm... 2 questions: - Why not do the let-binding inside `eat-reload` so you do it at one place instead of two? - Why `eat-reload` at all? This is highly unusual and likely to bump into all kinds of odd corner cases for that reason. Wouldn't you be better served with a (re)initialization function which you can then call without having to reload any file? I include a not-really-related patch below for ... completeness? Stefan diff --git a/eat.el b/eat.el index 8b17743906..a2ce661c48 100644 --- a/eat.el +++ b/eat.el @@ -540,11 +540,10 @@ This value is used by terminal programs to identify the terminal." ;; Upgrading Eat causes `eat-term-terminfo-directory' and ;; `eat-term-shell-integration-directory' to be outdated, so update it ;; if not modified by user (or something else). -(defvar eat--load-file-path nil - "Path to currently loaded Eat.") -(defvar eat--install-path nil - "Path to directory where Eat is installed.") +;; FIXME: The GNU convention used in Emacs is for "path" to mean a list of +;; directories (as in `load-path' or $PATH), so these should be called +;; "file names". (defvar eat--terminfo-path nil "Path to directory where Terminfo databases are installed.") @@ -552,10 +551,13 @@ This value is used by terminal programs to identify the terminal." (defvar eat--shell-integration-path nil "Path to directory where shell integration scripts are installed.") -(setq eat--load-file-path (or load-file-name buffer-file-name)) +(defconst eat--load-file-path + (if (fboundp 'macroexp-file-name) (macroexp-file-name) + (or load-file-name buffer-file-name)) + "Path to currently loaded Eat.") -(setq eat--install-path - (copy-sequence (file-name-directory eat--load-file-path))) +(defconst eat--install-path (file-name-directory eat--load-file-path) + "Path to directory where Eat is installed.") (defvar eat-term-terminfo-directory) (defvar eat-term-shell-integration-directory)