GNU bug report logs - #45068
[PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <info <at> protesilaos.com>

Date: Sun, 6 Dec 2020 12:25:02 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Mauro Aranda <maurooaranda <at> gmail.com>, 45068 <at> debbugs.gnu.org
Subject: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)
Date: Mon, 01 Mar 2021 23:34:46 +0000
Protesilaos Stavrou <info <at> 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




This bug report was last modified 4 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.