From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Protesilaos Stavrou <info@protesilaos.com>
Cc: Mauro Aranda <maurooaranda@gmail.com>, 45068@debbugs.gnu.org
Subject: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)
Date: Tue, 02 Mar 2021 10:32:51 +0000 [thread overview]
Message-ID: <878s75x2uk.fsf@tcd.ie> (raw)
In-Reply-To: <87r1kyrtrl.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Tue, 02 Mar 2021 07:47:58 +0200")
Protesilaos Stavrou <info@protesilaos.com> writes:
> On 2021-03-01, 23:34 +0000, "Basil L. Contovounesios" <contovob@tcd.ie> wrote:
>
>> 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?
>
> My idea was that there could be a future scenario where a derivative
> theme requires a basis and the two are both declared as 'deftheme'. So
> they would blend together.
So you mean there is a base-theme.el and derivative-theme.el? In that
case, couldn't derivative-theme.el just call (load-theme 'base) with or
without NO-CONFIRM and NO-ENABLE, depending on its needs? Or did I
misunderstand what you mean?
> Otherwise yes, it would be simpler to keep things separate.
>
>> 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.
>
> In my case (require-theme 'modus-operandi) would not be used. In the
> file modus-operandi-theme.el I now have (require 'modus-themes). The
> modus-themes.el is not a 'deftheme' in itself and 'require' cannot find
> it unless it is in the load-path. Emacs' directory etc/themes is not in
> the load-path, so (require-theme 'modus-themes) is meant to work around
> that constraint.
>
>> 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)))
>
> No the themes do not need that dual behaviour. And yes, your version
> works and I am happy with it: all I need is a 'require' that reads from
> etc/themes.
Thanks, in that case, AFAICS, it might indeed be okay to keep load-theme
and require-theme separate (hopefully I'm not missing something
obvious).
> Perhaps I should attach a preliminary patch with the themes so that you
> can inspect it?
Sure, if you think it will help - my questions were just to help me
understand the "requirements" of require-theme ;).
>> BTW, do we need to warn anywhere that require-theme may unconditionally
>> load files from custom-theme-load-path, or somehow protect against this?
>
> That would be consistent with load-theme.
Right, but I'm wondering whether require-theme ought to be consistent in
this regard.
load-theme is a user-level command, and arbitrary themes are considered
risky Lisp, so it has to (conditionally) display the code and ask the
user if they think it looks okay.
require-theme, OTOH, sounds like it's a behind-the-scenes noninteractive
plumbing function to be used by themes themselves, so wouldn't the user
be prompted twice if a theme called require-theme on an element of
custom-available-themes? IOW, it seems to me like require-theme's
"safety" should already be handled/covered by the theme using it.
>> And does it matter if require-theme loads .elc files, given that its
>> purpose is to load supporting non-theme Lisp files?
>
> For this I am not sure. Whatever you think is appropriate.
load-theme already prefers the .elc file if the theme is considered safe
by default, so if my suggestions for require-theme are acceptable to
everyone then maybe it would make sense for require-theme to behave like
require in this sense as well.
I'll suggest a patch soon to help the discussion.
Thanks for bearing with me,
--
Basil
next prev parent reply other threads:[~2021-03-02 10:32 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 12:23 bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Protesilaos Stavrou
2020-12-08 12:03 ` Basil L. Contovounesios
2020-12-09 21:58 ` Stefan Kangas
2020-12-10 7:57 ` Protesilaos Stavrou
2020-12-10 8:25 ` Stefan Kangas
2020-12-10 11:46 ` Protesilaos Stavrou
2020-12-11 9:37 ` Juri Linkov
2020-12-11 13:21 ` Stefan Kangas
2020-12-11 13:52 ` Eli Zaretskii
2020-12-11 14:16 ` Stefan Kangas
2020-12-11 14:32 ` Eli Zaretskii
2020-12-11 15:15 ` Stefan Kangas
2020-12-11 15:32 ` Eli Zaretskii
2020-12-11 15:42 ` Christopher Dimech
2020-12-11 15:53 ` Protesilaos Stavrou
2020-12-11 18:39 ` Eli Zaretskii
2020-12-11 18:56 ` Christopher Dimech
2020-12-11 20:16 ` Eli Zaretskii
2020-12-11 20:29 ` Christopher Dimech
2020-12-11 19:08 ` Stefan Kangas
2020-12-11 20:05 ` Christopher Dimech
2020-12-11 20:14 ` Eli Zaretskii
2020-12-11 20:21 ` Christopher Dimech
2021-01-25 8:49 ` bug#45068: Patch for Modus themes 1.1.1? (was: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)) Protesilaos Stavrou
2021-01-25 12:51 ` Christopher Dimech
2021-01-25 15:34 ` Eli Zaretskii
2021-02-25 6:09 ` bug#45068: Patch for Modus themes 1.1.1? Protesilaos Stavrou
2021-02-25 14:44 ` Eli Zaretskii
2021-02-27 2:35 ` Protesilaos Stavrou
2021-02-27 8:15 ` Eli Zaretskii
2021-02-27 8:53 ` Protesilaos Stavrou
2021-02-28 6:30 ` Protesilaos Stavrou
2021-02-28 11:41 ` bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Mauro Aranda
2021-02-28 12:45 ` Protesilaos Stavrou
[not found] ` <87lfb8l2wr.fsf@tcd.ie>
2021-02-28 14:13 ` Protesilaos Stavrou
[not found] ` <87a6roxou1.fsf@protesilaos.com>
[not found] ` <87im6cfcex.fsf@tcd.ie>
2021-02-28 15:57 ` Protesilaos Stavrou
[not found] ` <603b9b9d.1c69fb81.f37aa.cb7c@mx.google.com>
2021-02-28 13:56 ` Protesilaos Stavrou
2021-03-01 14:38 ` Eli Zaretskii
2021-03-01 14:52 ` Protesilaos Stavrou
2021-03-01 15:16 ` Mauro Aranda
2021-03-01 15:35 ` Protesilaos Stavrou
2021-03-01 19:58 ` Basil L. Contovounesios
2021-03-01 20:06 ` Mauro Aranda
2021-03-01 20:03 ` Mauro Aranda
2021-03-01 23:34 ` Basil L. Contovounesios
2021-03-02 5:47 ` Protesilaos Stavrou
2021-03-02 5:51 ` Eli Zaretskii
2021-03-02 10:35 ` Basil L. Contovounesios
2021-03-02 10:32 ` Basil L. Contovounesios [this message]
2021-03-02 10:59 ` Protesilaos Stavrou
2021-03-02 11:03 ` Mauro Aranda
2021-03-02 11:38 ` Basil L. Contovounesios
2021-03-02 11:56 ` Mauro Aranda
2021-03-03 16:31 ` Basil L. Contovounesios
2021-03-03 18:06 ` Protesilaos Stavrou
2021-03-04 2:04 ` Basil L. Contovounesios
2021-03-04 4:53 ` Protesilaos Stavrou
2021-03-04 12:32 ` Mauro Aranda
2021-03-04 14:54 ` bug#45068: [PATCH] Modus themes 1.2.0 (was: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)) Protesilaos Stavrou
2021-03-04 16:53 ` bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Mauro Aranda
2021-03-04 18:41 ` bug#45068: [PATCH] Modus themes 1.2.0 Basil L. Contovounesios
2021-03-04 20:57 ` Protesilaos Stavrou
2021-03-04 22:06 ` bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Mauro Aranda
2021-03-05 6:34 ` Protesilaos Stavrou
2021-03-05 17:11 ` Basil L. Contovounesios
2021-03-05 17:34 ` Protesilaos Stavrou
2021-03-04 22:40 ` Mauro Aranda
2021-03-05 6:07 ` Protesilaos Stavrou
2021-03-05 17:11 ` bug#45068: [PATCH] Modus themes 1.2.0 Basil L. Contovounesios
2021-03-05 17:50 ` Protesilaos Stavrou
2021-03-05 22:00 ` Basil L. Contovounesios
2021-03-06 5:13 ` Protesilaos Stavrou
2021-03-06 9:29 ` Basil L. Contovounesios
2021-03-05 21:11 ` Gregory Heytings
2021-03-06 13:24 ` Gregory Heytings
2021-03-06 15:22 ` Protesilaos Stavrou
2021-03-06 18:25 ` Gregory Heytings
2021-03-06 18:43 ` Protesilaos Stavrou
2021-03-04 15:47 ` bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Basil L. Contovounesios
2020-12-11 14:32 ` Christopher Dimech
2020-12-11 16:05 ` Protesilaos Stavrou
2020-12-11 16:31 ` Christopher Dimech
2020-12-11 14:25 ` Christopher Dimech
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878s75x2uk.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=45068@debbugs.gnu.org \
--cc=info@protesilaos.com \
--cc=maurooaranda@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).