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

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

bug#45068: Patch for Modus themes 1.1.1?


From: Protesilaos Stavrou
Subject: bug#45068: Patch for Modus themes 1.1.1?
Date: Sat, 27 Feb 2021 10:53:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On 2021-02-27, 10:15 +0200, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Protesilaos Stavrou <info@protesilaos.com>
>> Cc: 45068@debbugs.gnu.org
>> Date: Sat, 27 Feb 2021 04:35:49 +0200
>> 
>> > A simple implementation that checks whether a theme is already loaded,
>> > and if not, looks it up in a suitable list of directories and loads
>> > when found.  The main part is to make sure themes are looked up in the
>> > directories where we expect them to be, as opposed to load-path, which
>> > is where 'require' looks for files to load.  A Lisp implementation
>> > should be fine, I think.
>> >
>> > Let me know if you need further clarifications.
>> 
>> Hello Eli,
>> 
>> This is what I could come up with.  It is not what you stipulated, as it
>> only accounts for the default themes' directory instead of checking the
>> 'custom-theme-load-path'.
>
> Hmm... I'm surprised.  What I had in mind was a simple use of
> locate-file, which already accepts a path argument, so you could pass
> custom-theme-load-path to it, and it would do the job.

Thank you for the feedback (and sorry for putting you through the
trouble)!  I will try again using that approach.

> Maybe I misunderstand or misremember the problem which led us here.
> Wasn't the problem that 'load' and 'require' search along load-path
> instead of custom-theme-load-path?

Yes, that was the problem.  So the "modus-themes.el" dependency could
not be placed in etc/themes/ as (require 'modus-themes) would not find
it.

> IOW, could you show the code you'd use to load the other components of
> the theme if you could use 'load' and 'require'?  My idea was simply
> to replace
>
>   (require 'foo-themes)
>
> with
>
>   (require-theme 'foo-themes)
>
> Would that solve your original problem, assuming that require-theme
> would look for and load foo-themes.el?

Indeed, with the function I provided all I had to change was 'require'
to 'require-theme-base'.

-- 
Protesilaos Stavrou
protesilaos.com





reply via email to

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