From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Akib Azmain Turja <akib@disroot.org>
Subject: Re: [nongnu] elpa/eat 64dcbd2c07: Fix recursive load error
Date: Mon, 03 Jul 2023 23:10:30 -0400 [thread overview]
Message-ID: <jwvlefw5qrc.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20230703170037.5C229C11DC2@vcs2.savannah.gnu.org> (ELPA Syncer's message of "Mon, 3 Jul 2023 13:00:37 -0400 (EDT)")
> 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)
parent reply other threads:[~2023-07-04 3:10 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20230703170037.5C229C11DC2@vcs2.savannah.gnu.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvlefw5qrc.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=akib@disroot.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.