GNU bug report logs - #24491
Avoid recursive require of eshell

Previous Next

Package: emacs;

Reported by: "Brendan O'Dea" <bod <at> debian.org>

Date: Wed, 21 Sep 2016 05:47:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 34954

Found in versions 25.1.1, 26.1.92

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24491 in the body.
You can then email your comments to 24491 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24491; Package emacs. (Wed, 21 Sep 2016 05:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Brendan O'Dea" <bod <at> debian.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 21 Sep 2016 05:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brendan O'Dea" <bod <at> debian.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Avoid recursive require of eshell
Date: Wed, 21 Sep 2016 13:14:33 +1000
[Message part 1 (text/plain, inline)]
Package: emacs
Version: 25.1.1
Tags: patch

Attempting add a function to eshell-load-hook, and that function is
autoloaded from a file which also requires eshell, produces the
following error:

  Recursive ‘require’ for feature ‘eshell’

Specifically, I'm trying to do this:

  (add-hook 'eshell-load-hook #'eshell-local-setup)

where eshell-local-setup is an autoloaded function which does a few
things, including adding to eshell-variable-aliases-list and the file
it is defined in has:

  (require 'esh-var)

which indirectly attempts to require eshell.

The simple fix for this is to run the hook after providing eshell.
This seems to be fairly common (see align.el, autorevert.el, dired.el,
expand.el, ibuffer.el, etc) although not consistent (bookmark.el,
cmuscheme.el, etc. do it in the other order).

--bod
[eshell.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24491; Package emacs. (Wed, 21 Sep 2016 20:34:01 GMT) Full text and rfc822 format available.

Message #8 received at 24491 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Brendan O'Dea" <bod <at> debian.org>
Cc: 24491 <at> debbugs.gnu.org
Subject: Re: bug#24491: Avoid recursive require of eshell
Date: Wed, 21 Sep 2016 16:33:31 -0400
You ought to be able to avoid such problems by using
(with-)eval-after-load instead of foo-load-hook, since the former runs
after provide (effectively).

Frankly all foo-load-hooks are probably historical baggage that should
be obsoleted. There's no need for them to exist given that a general
solution does.




Merged 24491 34954. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 04 Apr 2019 02:56:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 04 Apr 2019 02:56:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 34954 <at> debbugs.gnu.org and Mauro Aranda <maurooaranda <at> gmail.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 04 Apr 2019 02:56:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 May 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 332 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.