help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: (require 'filename) doesn't find the file


From: hector
Subject: Re: (require 'filename) doesn't find the file
Date: Fri, 10 Mar 2017 11:26:31 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

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.



reply via email to

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