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

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

bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompat


From: Basil L. Contovounesios
Subject: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)
Date: Mon, 01 Mar 2021 23:34:46 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Protesilaos Stavrou <info@protesilaos.com> writes:

> +---

I think this function deserves to be documented under
(info "(elisp) Custom Themes"), but...

> +** New function 'require-theme'.
> +This function is used to load a theme or library stored in the
> +'custom-theme-load-path'.  It is intended to work as a substitute for
> +'require' in those cases where that cannot be used.

...after trying for some time, I failed to do so coherently and am now
confused about the function's implementation and purpose (I'm sorry for
not raising these points sooner).

If require-theme is intended as an alternative to require that searches
custom-theme-load-path, then why does it sometimes delegate to
load-theme and prompt the user about unsafe themes?  This mixes
lower-level library functionality with a higher-level user feature, and
the only deciding factor between the two is whether foo-theme.el or
foo.el exists on custom-theme-load-path, which seems a bit opaque.

Wouldn't it be simpler/cleaner if load-theme was used only for the
foo-theme.el use case, and require-theme only for the foo.el use case?

IOW, what is the use case for (require-theme 'modus-operandi)?  Why not
just call (load-theme 'modus-operandi) instead, with the added
flexibility of specifying its optional arguments?  I'm also curious
about the use case for require-theme's optional second argument.

Do the Modus themes require the current dual behaviour of require-theme?
If not, then could require-theme be as simple as the following, or am I
being naive / missing something?

  (defun require-theme (feature &optional noerror)
    (let ((load-path (custom-theme--load-path)))
      (require feature nil noerror)))

BTW, do we need to warn anywhere that require-theme may unconditionally
load files from custom-theme-load-path, or somehow protect against this?
And does it matter if require-theme loads .elc files, given that its
purpose is to load supporting non-theme Lisp files?

Thanks,

-- 
Basil





reply via email to

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