emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make bootstrap error


From: Tino Calancha
Subject: Re: make bootstrap error
Date: Mon, 31 Jul 2017 00:36:50 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Tino Calancha <address@hidden>
>> Date: Sun, 30 Jul 2017 20:35:06 +0900 (JST)
>> cc: address@hidden, address@hidden, Emacs developers <address@hidden>
>> 
>> > After commit 6f6639d6ed6c6314b2643f6c22498fc2e23d34c7
>> > ls-lisp.el requires 'em-glob.  When eshell package is
>> > compiled, teh following file is generated:
>> > esh-groups.el
>> >
>> > but ls-lisp.el is compiled _before_ eshell, so that
>> > esh-groups.el doesn't exist yet.
>> 
>> I moved the "(require 'em-glob)" inside `ls-lisp--dired'
>> to not break the build.
>
> Thanks, but I think this is still a bit fragile: it assumes that
> ls-lisp--dired will never be called before Eshell files are compiled,
> which might one day become false.
>
> How about simply adding to ls-lisp.el an autoload form for em-glob,
> instead of requiring it (with a suitable comment explaining why it is
> there)?
Thanks for the suggestion.
Proposed patch below:
--8<-----------------------------cut here---------------start------------->8---
commit 7bbc5990c05839520bae0deb407cba17f89b002e
Author: Tino Calancha <address@hidden>
Date:   Mon Jul 31 00:33:33 2017 +0900

    ls-lisp: Autoload call instead of cookie
    
    * lisp/ls-lisp.el (eshell-extended-glob): autoload call instead of cookie.

diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 2f723ca8ac..9a4fc19744 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -479,14 +479,19 @@ ls-lisp-insert-directory
        (message "%s: doesn't exist or is inaccessible" file)
        (ding) (sit-for 2)))))          ; to show user the message!
 
-
-(declare-function eshell-extended-glob "em-glob" (glob))
+;; We cannot require 'em-glob' in the top of the file:
+;; ls-lisp is compiled before than eshell, and esh-groups.el
+;; wouldn't be created yet.  If we require 'em-glob' inside
+;; `ls-lisp--dired', then this function cannot be called
+;; before eshell is compiled.
+;; So instead we add an autoload call here.
+;; (https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg01083.html).
+(autoload 'eshell-extended-glob "em-glob")
 (declare-function dired-read-dir-and-switches "dired" (str))
 (declare-function dired-goto-next-file "dired" ())
 
 (defun ls-lisp--dired (orig-fun dir-or-list &optional switches)
   (interactive (dired-read-dir-and-switches ""))
-  (require 'em-glob)
   (if (consp dir-or-list)
       (funcall orig-fun dir-or-list switches)
     (let ((dir-wildcard (insert-directory-wildcard-in-dir-p

--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-07-30
Repository revision: c8f44e4b53c40dfea1c83ad0ff3bd653e72c4f4e



reply via email to

[Prev in Thread] Current Thread [Next in Thread]