From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Autoloads and subdirectories Date: Sun, 29 May 2016 11:01:13 -0400 Message-ID: References: <57491DA5.4020002@gmail.com> <57492904.7050603@gmail.com> <5749E7C9.3030300@gmail.com> <5749EFAF.1010206@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464534106 26659 80.91.229.3 (29 May 2016 15:01:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 May 2016 15:01:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 29 17:01:38 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b72Dh-0003db-8e for ged-emacs-devel@m.gmane.org; Sun, 29 May 2016 17:01:37 +0200 Original-Received: from localhost ([::1]:56131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b72Dg-0000E7-Aj for ged-emacs-devel@m.gmane.org; Sun, 29 May 2016 11:01:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b72DW-0000Ce-T4 for emacs-devel@gnu.org; Sun, 29 May 2016 11:01:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b72DR-0004Co-Tc for emacs-devel@gnu.org; Sun, 29 May 2016 11:01:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:60380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b72DR-0004Ch-N5 for emacs-devel@gnu.org; Sun, 29 May 2016 11:01:21 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b72DP-0003XW-Ec for emacs-devel@gnu.org; Sun, 29 May 2016 17:01:19 +0200 Original-Received: from 45.72.245.251 ([45.72.245.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 May 2016 17:01:19 +0200 Original-Received: from monnier by 45.72.245.251 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 May 2016 17:01:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 45.72.245.251 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:pHmKb/b8GdfYzGhLg+HUYzxOf3w= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:204127 Archived-At: > The docs of load-file-name don't say what this variable becomes when outside > of load. It is always nil when load-in-progress is nil? I believe so, yes. >> And why do you need to fallback on byte-compile-current-file or >> buffer-file-name? > I'd like this code to work when the form is evaluated with C-M-x in an Emacs > buffer. Since this isn't in an eval-when-compile form, though, I guess it > would work to remove the byte-compile-current-file part. For C-M-x I guess you do need buffer-file-name. For M-x eval-buffer you could use ;;;###autoload (defconst realgud-subdir-autoloads-name "subdirectory-autoloads.el") ;;;###autoload (defconst realgud-content-dir) ;;;###autoload (file-name-directory load-file-name)) ;;;###autoload (with-demoted-errors "Error loading autoloads: %s" ;;;###autoload (load (expand-file-name realgud-subdir-autoloads-name realgud-content-dir) t t)) -- Stefan