From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: (require 'filename) doesn't find the file Date: Fri, 10 Mar 2017 11:46:30 +0100 Message-ID: <20170310104630.GA1688@tuxteam.de> References: <20170310091737.GA3727@workstation> <20170310093749.GC29132@tuxteam.de> <20170310102631.GA4107@workstation> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed X-Trace: blaine.gmane.org 1489142849 15321 195.159.176.226 (10 Mar 2017 10:47:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Mar 2017 10:47:29 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 10 11:47:23 2017 Return-path: Envelope-to: geh-help-gnu-emacs@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 1cmI4t-00037Y-59 for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Mar 2017 11:47:19 +0100 Original-Received: from localhost ([::1]:38427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmI4z-0002UW-2y for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Mar 2017 05:47:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmI4G-0002SQ-2d for help-gnu-emacs@gnu.org; Fri, 10 Mar 2017 05:46:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmI4B-00074O-5E for help-gnu-emacs@gnu.org; Fri, 10 Mar 2017 05:46:40 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:37854 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmI4A-000742-V1 for help-gnu-emacs@gnu.org; Fri, 10 Mar 2017 05:46:35 -0500 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1cmI46-0000UR-6J for help-gnu-emacs@gnu.org; Fri, 10 Mar 2017 11:46:30 +0100 In-Reply-To: <20170310102631.GA4107@workstation> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112514 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Mar 10, 2017 at 11:26:31AM +0100, hector wrote: > On Fri, Mar 10, 2017 at 10:37:49AM +0100, tomas@tuxteam.de wrote: > > It finds the file. But the file doesn't keep its promise of "providing" > > the feature. > > > > See it this way: a "require"d file might find out that something is > > broken. Then it would return without "provide"-ing the feature, to > > signal that sorry, this feature isn't available after all. > > > > In short: just end your file with (provide 'basename), as you noticed > > up there. Or do you see a problem with that? > > No problem at all. But I see a problem in that function require doesn't > behave as its documentation says it does. Or I just don't understand it, > which is worse. > > OK, let's widen the picture frame. > > I have 2 files: required.el and requiring.el. > > required.el contains: > > (defvar var1 "Value" > "This variable is used by \"requiring.el\"") > > Them, since requiring.el uses this variable, I write: > > (require 'required) > > expecting that "required.el" to be loaded at run time. > > I'm afraid this is not the right approach. Perhaps both files should be > put together. Or use (load "required.el") instead. I just don't know. Your expectation *is* right (assuming paths and things align correctly). The only missing bit in that picture is for the file "required.el" to contain one last line (provide 'required) Is the doc unclear about that? (sorry, no time now to check -- ping me again if you want me to, probly this afternoon) regards - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAljChAYACgkQBcgs9XrR2kaioQCfRP/FD3UValPdQ1i5JqtZyUSo jqAAnjZU4sq0f+qE5IMuE1eoqTy929/i =8zTZ -----END PGP SIGNATURE-----