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

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

Re: File for minor mode not found


From: Stephen Berman
Subject: Re: File for minor mode not found
Date: Sun, 09 Jan 2022 17:01:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Sun, 9 Jan 2022 16:46:51 +0100 (CET) fatiparty--- via Users list for the GNU 
Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> Jan 9, 2022, 15:12 by stephen.berman@gmx.net:
>
>> On Sun, 9 Jan 2022 15:43:42 +0100 (CET) fatiparty--- via Users list for the
>> GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
[...]
>>> It does not exist.  The file is named daph-ideograms.el but I am using 
>>> (provide 'daph) at the end of the file.  And using (require 'daph) after 
>>> setting the load-path in another file.
>>>
>>
>> That should be (require 'daph "daph-ideograms"), see `C-h f require':.
>>
>>  require is a built-in function in ‘C source code’.
>>  
>>  (require FEATURE &optional FILENAME NOERROR)
>>  
>>  If feature FEATURE is not loaded, load it from FILENAME.
>>  If FEATURE is not a member of the list ‘features’, then the feature is
>>  not loaded; so load the file FILENAME.
>>  
>>  If FILENAME is omitted, the printname of FEATURE is used as the file
>>  name, and ‘load’ will try to load this name appended with the suffix
>>  ‘.elc’, ‘.el’, or the system-dependent suffix for dynamic module
>>  files, in that order.
>>
>> Steve Berman
>>
>
> Thanks Steve.  One thing that has been difficult to see, is the
> relationship between (provide 'daph) and (require 'daph).  Following
> your suggestion, I need to have (require 'daph "daph-ideograms").  Are
> there any implications for the (provide 'daph) part?

No, that's fine.  As its doc string says, `provide' just "[a]nnounce[s]
that FEATURE is a feature of the current Emacs."  So there's no
requirement that FEATURE be the name of an existing file.  But `require'
loads a feature from an existing file, so it has to find that file,
using the name of the feature as a default.  But if the file providing
that feature has a different name, you have to pass that name (just the
base name without extension) to `require'.

Steve Berman



reply via email to

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