Subject: Re: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)

From: Christopher Dimech <[email-masked]>
Date: Fri, 11 Dec 2020 19:56:43 +0100

> Sent: Friday, December 11, 2020 at 7:39 PM
> From: "Eli Zaretskii" <[email-masked]>
> To: "Protesilaos Stavrou" <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked], [email-masked]
> Subject: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)
>
> > From: Protesilaos Stavrou <[email-masked]>
> > Cc: Stefan Kangas <[email-masked]>,  [email-masked],
> >   [email-masked],  [email-masked]
> > Date: Fri, 11 Dec 2020 17:53:34 +0200
> >
> > >> > What theme-related files need to be byte-compiled, and why?
> > >>
> > >> I believe the issues involved are explained in some detail in the first
> > >> message in this bug report.
> > >
> > > If they are, I'm missing that.  All I see is an assertion that the
> > > files must be byte-compiled:
> > >
> > >> The problem with contributing this new code to Emacs is that it cannot
> > >> work if it is placed in ../etc/themes/.  Instead, the files need to be
> > >> in a path that handles byte-compilation, like ../lisp/modus-themes/.
> > >
> > > I'm probably missing something, and that is what I'm asking to
> > > elaborate on.
> >
> > There now are four *.el files that make up the project:
> >
> > + modus-themes.el contains all defcustom, color palettes as alists,
> >   helper functions, and the face specs.
> >
> > + modus-themes-core.el contains a macro that 'let' binds the
> >   aforementioned alists around 'custom-theme-set-faces' and
> >   'custom-theme-set-variables'.
> >
> > + modus-{operandi-vivendi}-theme.el contain a 'deftheme' and concomitant
> >   'provide-theme' referencing each of them and just expand the macro.
> >
> >   - Each of those files has (require 'modus-themes) and
> >     (eval-when-compile (require 'modus-themes-core)).  Though I also
> >     tried without the eval-when-compile part.
> >
> > When I attempted to place all four files in etc/themes/ and then start a
> > new 'emacs -Q' session, M-x load-theme RET modus-{operandi,vivendi}
> > would throw an error:
> >
> >     Cannot open load file: No such file or directory, modus-themes
>
> So this is not about byte-compiling, it's about being able to load
> some of the files that constitute this group of themes?
>
> If so, I see several possibilities:
>
>   . make a single file with all the functionalities
>   . invent a new function custom-require that would search the custom
>     load-path, and use that instead of 'require'
>   . don't consider this a "theme", but a normal Lisp package (since it
>     basically violates the conventions for writing a theme)

It is still a theme though.  What conventions does it violate, briefly?
Not being a single file?