From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: make bootstrap error Date: Mon, 31 Jul 2017 00:36:50 +0900 Message-ID: <877eyq6inh.fsf@calancha-pc> References: <877eyqh7xv.wl-nomiya@galaxy.dti.ne.jp> <83379e2ew4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1501429029 7338 195.159.176.226 (30 Jul 2017 15:37:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Jul 2017 15:37:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: rgm@gnu.org, tino.calancha@gmail.com, nomiya@galaxy.dti.ne.jp, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 30 17:37:04 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbqH5-0001Ms-J4 for ged-emacs-devel@m.gmane.org; Sun, 30 Jul 2017 17:36:59 +0200 Original-Received: from localhost ([::1]:55661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbqHB-0005At-9D for ged-emacs-devel@m.gmane.org; Sun, 30 Jul 2017 11:37:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbqH3-00059W-W3 for emacs-devel@gnu.org; Sun, 30 Jul 2017 11:36:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbqH2-0006JR-Sq for emacs-devel@gnu.org; Sun, 30 Jul 2017 11:36:57 -0400 Original-Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]:36672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dbqH2-0006Iv-L4; Sun, 30 Jul 2017 11:36:56 -0400 Original-Received: by mail-pf0-x232.google.com with SMTP id z129so72443560pfb.3; Sun, 30 Jul 2017 08:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=Z/QrGinThQgR5MNxAVpAhuxBjVSrjnp+LjOSJLIgkcM=; b=Y6IV8jpbF1Wpr2OCnOYiFm+GhKPUcQwZHgRx7DZ0LwfcThTIfgRqrcsdcp5O2rvV78 IdBXaYGwiT6/Akq4keQ4uBILHQC4GPZupqSCMZB3ql3niMA7QlhXzIT9wQZIY3XMNdOS P5RVUDYQFBiK+BPUNfhMxn8bDz4oFsAkIzo9WTwZxKioAuTFBkmH08rg+PTlx4RmQZZG Cr71tR9/X5HSzGgMXPdYePWfWhAQWv8yhwrE1RWroJYWeJCeA86fuW775YmPigxD4RYQ 9FQR/xnWlpFARkzJOrscFxZCeiF8KPCj4KnxPz7yQA64TFncvjCN/QrB06xIgA/nCX1B fxYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=Z/QrGinThQgR5MNxAVpAhuxBjVSrjnp+LjOSJLIgkcM=; b=ANruwYYcjGgaCYCuLJHE+4/dPNuGnc0IoPQcPiLKxxcbz0LJ6LR5BAMVBuvf/OOXwN +Q14a6l+v5xjmzwuws8BhMZiaR+3tDdU7TVgcKI764/rW0AxGhBVlNX8Y/CN9CfkuCIe FdIYQXCwEmyTrZc++5UhU98gc6jjQMgVbEYpddEv2qz0KFkO6rT1o8CkoyBb6x+jB7Lh gSw8DC1eTcDNWK2tv5ipMbqr137C25AfaZPIskYRTId67DhZLSN7AEZ/hVtAUWWQ1JQa dl+P3W5CP3aVabQFnVu0XS0SgRwQQfIc2lfnDWDHAXvvGkP6keKnPUjuvWSZVbahMstK 0pRA== X-Gm-Message-State: AIVw112iUsq9dcg3dEN0OkqukHjgH06CZ2Cgp6kd8+ussOMgf02SnbuW of4lsPZV4btPMg== X-Received: by 10.84.169.4 with SMTP id g4mr167300plb.254.1501429015572; Sun, 30 Jul 2017 08:36:55 -0700 (PDT) Original-Received: from calancha-pc ([240f:6e:fb29:1:9ee6:2511:da80:1c7e]) by smtp.gmail.com with ESMTPSA id c62sm32569732pfe.154.2017.07.30.08.36.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Jul 2017 08:36:54 -0700 (PDT) In-Reply-To: <83379e2ew4.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 30 Jul 2017 17:11:39 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217160 Archived-At: Eli Zaretskii writes: >> From: Tino Calancha >> Date: Sun, 30 Jul 2017 20:35:06 +0900 (JST) >> cc: rgm@gnu.org, eliz@gnu.org, Emacs developers >> >> > 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 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