all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Declaring functions after provide
@ 2024-08-09 21:03 Heime
  2024-08-09 21:46 ` [External] : " Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Heime @ 2024-08-09 21:03 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I have a file that contains (provide 'tema) at the end.  What will
happen if I add more function after the aforementioned clause ?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [External] : Declaring functions after provide
  2024-08-09 21:03 Declaring functions after provide Heime
@ 2024-08-09 21:46 ` Drew Adams
  2024-08-09 21:56   ` Heime
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2024-08-09 21:46 UTC (permalink / raw)
  To: Heime, Heime via Users list for the GNU Emacs text editor

> I have a file that contains (provide 'tema) at the end.  What will
> happen if I add more function after the aforementioned clause ?

Nothing.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [External] : Declaring functions after provide
  2024-08-09 21:46 ` [External] : " Drew Adams
@ 2024-08-09 21:56   ` Heime
  2024-08-09 22:15     ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Heime @ 2024-08-09 21:56 UTC (permalink / raw)
  To: Drew Adams; +Cc: Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Saturday, August 10th, 2024 at 9:46 AM, Drew Adams <drew.adams@oracle.com> wrote:

> > I have a file that contains (provide 'tema) at the end. What will
> > happen if I add more function after the aforementioned clause ?
> 
> 
> Nothing.

Provided I do not use autoloads and the provide statement is not at the end, right ?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [External] : Declaring functions after provide
  2024-08-09 21:56   ` Heime
@ 2024-08-09 22:15     ` Drew Adams
  2024-08-09 22:24       ` Heime
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2024-08-09 22:15 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

> > > I have a file that contains (provide 'tema) at the end. What will
> > > happen if I add more function after the aforementioned clause ?
> >
> > Nothing.
> 
> Provided I do not use autoloads and the provide statement is not at the
> end, right ?

Irrelevant.  When code `require's the feature,
the library with the `provide' is loaded.
Period.
___

The only connection with autoload is this, from
(elisp) `Named Features':

  When a file is loaded to satisfy an autoload, and it stops due
  to an error in the evaluation of its contents, any function
  definitions or ‘provide’ calls that occurred during the load
  are undone.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [External] : Declaring functions after provide
  2024-08-09 22:15     ` Drew Adams
@ 2024-08-09 22:24       ` Heime
  2024-08-09 22:37         ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Heime @ 2024-08-09 22:24 UTC (permalink / raw)
  To: Drew Adams; +Cc: Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Saturday, August 10th, 2024 at 10:15 AM, Drew Adams <drew.adams@oracle.com> wrote:

> > > > I have a file that contains (provide 'tema) at the end. What will
> > > > happen if I add more function after the aforementioned clause ?
> > > 
> > > Nothing.
> > 
> > Provided I do not use autoloads and the provide statement is not at the
> > end, right ?
> 
> 
> Irrelevant. When code `require's the feature, the library with the` provide' is loaded.
> Period.
> ___
> 
> The only connection with autoload is this, from
> (elisp) `Named Features':
> 
> When a file is loaded to satisfy an autoload, and it stops due
> to an error in the evaluation of its contents, any function
> definitions or ‘provide’ calls that occurred during the load
> are undone.

Had thought that they won't be recognized as part of the feature 
until the entire file is loaded.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [External] : Declaring functions after provide
  2024-08-09 22:24       ` Heime
@ 2024-08-09 22:37         ` Drew Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2024-08-09 22:37 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

> > > > > I have a file that contains (provide 'tema) at the end. What
> will
> > > > > happen if I add more function after the aforementioned clause ?
> > > >
> > > > Nothing.
> > >
> > > Provided I do not use autoloads and the provide statement is not at
> the
> > > end, right ?
> >
> > Irrelevant. When code `require's the feature, the library with the`
> provide' is loaded.
> > Period.
> > ___
> >
> > The only connection with autoload is this, from
> > (elisp) `Named Features':
> >
> > When a file is loaded to satisfy an autoload, and it stops due
> > to an error in the evaluation of its contents, any function
> > definitions or ‘provide’ calls that occurred during the load
> > are undone.
> 
> Had thought that they won't be recognized as part of the feature
> until the entire file is loaded.

That's correct.  `require' loads the entire library/file.
If the load doesn't raise an error then everything in
the file is loaded.  If it does raise an error then
nothing in the file is loaded.

The granularity of a feature (or a subfeature) is a file,
nothing smaller, because the granularity of loading is a
file, nothing smaller. (Loading can load multiple files,
of course.)

Read the doc I pointed you to, if you haven't already.
The first sentence tells you that "`provide' and
`require' are for loading files".


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-09 22:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 21:03 Declaring functions after provide Heime
2024-08-09 21:46 ` [External] : " Drew Adams
2024-08-09 21:56   ` Heime
2024-08-09 22:15     ` Drew Adams
2024-08-09 22:24       ` Heime
2024-08-09 22:37         ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.