unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Implement subfeatures in packages
@ 2024-08-04 12:09 Heime
  2024-08-04 13:20 ` Heime
  0 siblings, 1 reply; 8+ messages in thread
From: Heime @ 2024-08-04 12:09 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

Reading the documentation string, one can use subfeatures.  I would like to have
some code examples to help me implement subfeatures in my own packages.

(provide FEATURE &optional SUBFEATURES)

Announce that FEATURE is a feature of the current Emacs.
The optional argument SUBFEATURES should be a list of symbols listing
particular subfeatures supported in this version of FEATURE.




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

* Re: Implement subfeatures in packages
  2024-08-04 12:09 Implement subfeatures in packages Heime
@ 2024-08-04 13:20 ` Heime
  2024-08-04 16:33   ` [External] : " Drew Adams
  2024-08-05 19:39   ` Heime
  0 siblings, 2 replies; 8+ messages in thread
From: Heime @ 2024-08-04 13:20 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

On Monday, August 5th, 2024 at 12:09 AM, Heime <heimeborgia@protonmail.com> wrote:

> Reading the documentation string, one can use subfeatures. I would like to have
> some code examples to help me implement subfeatures in my own packages.
> 
> (provide FEATURE &optional SUBFEATURES)
> 
> Announce that FEATURE is a feature of the current Emacs.
> The optional argument SUBFEATURES should be a list of symbols listing
> particular subfeatures supported in this version of FEATURE.

I want a package "tema" to provide subfeatures "lumi" and "mast"

(provide 'tema '(lumi mast))

And set up files "lumi.el" and "mast.el" for the subfeatures.
Each of the two will include a "provide" clause at the end.

What would the provide clause look like ?





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

* RE: [External] : Re: Implement subfeatures in packages
  2024-08-04 13:20 ` Heime
@ 2024-08-04 16:33   ` Drew Adams
  2024-08-04 18:53     ` Heime
  2024-08-05 19:39   ` Heime
  1 sibling, 1 reply; 8+ messages in thread
From: Drew Adams @ 2024-08-04 16:33 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

> I want a package "tema" to provide subfeatures "lumi" and "mast"
> (provide 'tema '(lumi mast))
> And set up files "lumi.el" and "mast.el" for the subfeatures.
> Each of the two will include a "provide" clause at the end.
> 
> What would the provide clause look like ?

In lumi.el:
(provide 'tema '(lumi)) 

In tema.el:
(provide 'tema '(mast))

Elsewhere:
(require 'tema)

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

* RE: [External] : Re: Implement subfeatures in packages
  2024-08-04 16:33   ` [External] : " Drew Adams
@ 2024-08-04 18:53     ` Heime
  2024-08-04 20:44       ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Heime @ 2024-08-04 18:53 UTC (permalink / raw)
  To: Drew Adams; +Cc: Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Monday, August 5th, 2024 at 4:33 AM, Drew Adams <drew.adams@oracle.com> wrote:

> > I want a package "tema" to provide subfeatures "lumi" and "mast"
> > (provide 'tema '(lumi mast))
> > And set up files "lumi.el" and "mast.el" for the subfeatures.
> > Each of the two will include a "provide" clause at the end.
> > 
> > What would the provide clause look like ?
> 
> 
> In lumi.el:
> (provide 'tema '(lumi))
> 
> In tema.el:
> (provide 'tema '(mast))
> 
> Elsewhere:
> (require 'tema)

Would it be correct for "tema.el" to end with the clause

(provide 'tema '(lumi mast))



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

* RE: [External] : Re: Implement subfeatures in packages
  2024-08-04 18:53     ` Heime
@ 2024-08-04 20:44       ` Drew Adams
  2024-08-05  9:50         ` Heime
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2024-08-04 20:44 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

> > > I want a package "tema" to provide subfeatures "lumi" and "mast"
> > > (provide 'tema '(lumi mast))
> > > And set up files "lumi.el" and "mast.el" for the subfeatures.
> > > Each of the two will include a "provide" clause at the end.
> > >
> > > What would the provide clause look like ?
> >
> >
> > In lumi.el:
> > (provide 'tema '(lumi))
> >
> > In tema.el:
> > (provide 'tema '(mast))
> >
> > Elsewhere:
> > (require 'tema)
> 
> Would it be correct for "tema.el" to end with the clause
> (provide 'tema '(lumi mast))

Correct?  You can do anything you want to.

Using that says that the file it's in provides
feature tema and subfeatures lumi and mast.
If that's what you want to convey, then do it.

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

* [External] : Re: Implement subfeatures in packages
  2024-08-04 20:44       ` Drew Adams
@ 2024-08-05  9:50         ` Heime
  2024-08-05 11:09           ` Heime
  0 siblings, 1 reply; 8+ messages in thread
From: Heime @ 2024-08-05  9:50 UTC (permalink / raw)
  To: Drew Adams; +Cc: Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Monday, August 5th, 2024 at 8:44 AM, Drew Adams <drew.adams@oracle.com> wrote:

> > > > I want a package "tema" to provide subfeatures "lumi" and "mast"
> > > > (provide 'tema '(lumi mast))
> > > > And set up files "lumi.el" and "mast.el" for the subfeatures.
> > > > Each of the two will include a "provide" clause at the end.
> > > > 
> > > > What would the provide clause look like ?
> > > 
> > > In lumi.el:
> > > (provide 'tema '(lumi))
> > > 
> > > In tema.el:
> > > (provide 'tema '(mast))
> > > 
> > > Elsewhere:
> > > (require 'tema)
> > 
> > Would it be correct for "tema.el" to end with the clause
> > (provide 'tema '(lumi mast))
> 
> 
> Correct? You can do anything you want to.
> 
> Using that says that the file it's in provides
> feature tema and subfeatures lumi and mast.
> If that's what you want to convey, then do it.

Yes, I want to provide feature "tema" and subfeatures "lumi" and "mast".
I want to know the way to include the subfeatures in "lumi" and "mast".
in "tema.el".  Does one use the "include" clause, and how should it look
like?

Currently I have

;; code of tema.el
(provide 'tema '(lumi mast))

;; code of lumi.el
(provide 'tema '(lumi))

;; code of mast.el
(provide 'tema '(mast))



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

* Re: [External] : Re: Implement subfeatures in packages
  2024-08-05  9:50         ` Heime
@ 2024-08-05 11:09           ` Heime
  0 siblings, 0 replies; 8+ messages in thread
From: Heime @ 2024-08-05 11:09 UTC (permalink / raw)
  To: Heime; +Cc: Drew Adams, Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Monday, August 5th, 2024 at 9:50 PM, Heime <heimeborgia@protonmail.com> wrote:

> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> 
> On Monday, August 5th, 2024 at 8:44 AM, Drew Adams drew.adams@oracle.com wrote:
> 
> > > > > I want a package "tema" to provide subfeatures "lumi" and "mast"
> > > > > (provide 'tema '(lumi mast))
> > > > > And set up files "lumi.el" and "mast.el" for the subfeatures.
> > > > > Each of the two will include a "provide" clause at the end.
> > > > > 
> > > > > What would the provide clause look like ?
> > > > 
> > > > In lumi.el:
> > > > (provide 'tema '(lumi))
> > > > 
> > > > In tema.el:
> > > > (provide 'tema '(mast))
> > > > 
> > > > Elsewhere:
> > > > (require 'tema)
> > > 
> > > Would it be correct for "tema.el" to end with the clause
> > > (provide 'tema '(lumi mast))
> > 
> > Correct? You can do anything you want to.
> > 
> > Using that says that the file it's in provides
> > feature tema and subfeatures lumi and mast.
> > If that's what you want to convey, then do it.
> 
> Yes, I want to provide feature "tema" and subfeatures "lumi" and "mast".
> I want to know the way to include the subfeatures in "lumi" and "mast".
> in "tema.el". Does one use the "include" clause, and how should it look
> like?

A problem that occurs is the error when using (require 'mast) in "tema.el".
I would need a different command to include the code in "mast.el" into
"tema.el".
 
> Currently I have
> 
> ;; code of tema.el
> (provide 'tema '(lumi mast))
> 
> ;; code of lumi.el
> (provide 'tema '(lumi))
> 
> ;; code of mast.el
> (provide 'tema '(mast))



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

* Implement subfeatures in packages
  2024-08-04 13:20 ` Heime
  2024-08-04 16:33   ` [External] : " Drew Adams
@ 2024-08-05 19:39   ` Heime
  1 sibling, 0 replies; 8+ messages in thread
From: Heime @ 2024-08-05 19:39 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Monday, August 5th, 2024 at 1:20 AM, Heime <heimeborgia@protonmail.com> wrote:

> On Monday, August 5th, 2024 at 12:09 AM, Heime heimeborgia@protonmail.com wrote:
> 
> > Reading the documentation string, one can use subfeatures. I would like to have
> > some code examples to help me implement subfeatures in my own packages.
> > 
> > (provide FEATURE &optional SUBFEATURES)
> > 
> > Announce that FEATURE is a feature of the current Emacs.
> > The optional argument SUBFEATURES should be a list of symbols listing
> > particular subfeatures supported in this version of FEATURE.
> 
> 
> I want a package "tema" to provide subfeatures "lumi" and "mast"
> 
> (provide 'tema '(lumi mast))
> 
> And set up files "lumi.el" and "mast.el" for the subfeatures.
> Each of the two will include a "provide" clause at the end.
> 
> What would the provide clause look like ?

Currently I have

;; file lumi.el
;; code here
(provide 'tema '(lumi))
;; end of file lumi.el

;; ---------

;; file mast.el
;; code here
(provide 'tema '(mast))
;; end of file mast.el

;; ---------

How can the contents of lumi.el and mast.el be included in the
package defined in tema.el ?  Just using the canonical (require 'lumi)
and (require 'mast) gives (error "Loading file lumi.el

;; file tema.el
;; code here
(require 'lumi)  ;
(require 'mast)  ;

(provide 'tema '(lumi mast))
;; end of file mast.el



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

end of thread, other threads:[~2024-08-05 19:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-04 12:09 Implement subfeatures in packages Heime
2024-08-04 13:20 ` Heime
2024-08-04 16:33   ` [External] : " Drew Adams
2024-08-04 18:53     ` Heime
2024-08-04 20:44       ` Drew Adams
2024-08-05  9:50         ` Heime
2024-08-05 11:09           ` Heime
2024-08-05 19:39   ` Heime

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).