From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Date: Tue, 02 Mar 2021 10:32:51 +0000 Message-ID: <878s75x2uk.fsf@tcd.ie> References: <87im9fgm27.fsf@protesilaos.com> <87czzgbapt.fsf@protesilaos.com> <83lfe4192f.fsf@gnu.org> <83im9814oh.fsf@gnu.org> <87sg6po0yd.fsf_-_@protesilaos.com> <83czxt2fpd.fsf@gnu.org> <87h7m0n0em.fsf@protesilaos.com> <83v9agryuz.fsf@gnu.org> <87tupyw83e.fsf@protesilaos.com> <83zgzqncxx.fsf@gnu.org> <874khwn1qf.fsf@protesilaos.com> <603b8171.1c69fb81.aa664.7f40@mx.google.com> <87mtvoxsvs.fsf@protesilaos.com> <603b9b9d.1c69fb81.f37aa.cb7c@mx.google.com> <83eegz7xcx.fsf@gnu.org> <87o8g3exjv.fsf@protesilaos.com> <603d053a.1c69fb81.f4cb8.fb14@mx.google.com> <87h7luga3p.fsf@protesilaos.com> <87o8g2bg89.fsf@tcd.ie> <87r1kyrtrl.fsf@protesilaos.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37515"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Mauro Aranda , 45068@debbugs.gnu.org To: Protesilaos Stavrou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 02 11:39:21 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH2Qq-0009MP-Lw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Mar 2021 11:39:12 +0100 Original-Received: from localhost ([::1]:55080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH2Qp-0000dl-Kd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Mar 2021 05:39:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH2Lq-0003As-7m for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 05:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH2Lp-0003bX-Sx for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 05:34:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lH2Lp-00021p-QO for bug-gnu-emacs@gnu.org; Tue, 02 Mar 2021 05:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Mar 2021 10:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45068 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 45068-submit@debbugs.gnu.org id=B45068.16146811827721 (code B ref 45068); Tue, 02 Mar 2021 10:34:01 +0000 Original-Received: (at 45068) by debbugs.gnu.org; 2 Mar 2021 10:33:02 +0000 Original-Received: from localhost ([127.0.0.1]:51907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lH2Ks-00020S-2r for submit@debbugs.gnu.org; Tue, 02 Mar 2021 05:33:02 -0500 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:53044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lH2Kp-0001zr-Ql for 45068@debbugs.gnu.org; Tue, 02 Mar 2021 05:33:00 -0500 Original-Received: by mail-wm1-f51.google.com with SMTP id n22so1781595wmc.2 for <45068@debbugs.gnu.org>; Tue, 02 Mar 2021 02:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ftbWNdMiWFJ42V5Pju3izWrXDgKLB6byS9EnMjDyhEc=; b=MSOAkdX2U3ASFBwabErGEfclSDRJegkQePmZ2AYhGyaApubYurRYilVmP8Q0URAoE1 Ky6JhSjK7zLVXCZAcjGRtKuqXmrijxRJO6PigzYBvRnEhJ9zQVgov9q5LacH48nYpZHa ibunTE8r6Emj+z3XV+gqqa5WTX1P2UgdYsUygms3XKtfqJ75CzcZxAEv3ceNpvHSiTcx biCEfsMoe/0jMqOf5ZBo9pLODElvj2aRqnxV53V0KkqkfzXrwlYINZ5gKb3FCrZMVsay SHrC3ejByU2pArHugHMMj6WOQ4bsBbeYYKx8hCAiz1CoCWqwl+2mPBRyDLcP4f9XOdWG p97A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ftbWNdMiWFJ42V5Pju3izWrXDgKLB6byS9EnMjDyhEc=; b=rvdVu8G2QV4u5AkM2hx1Iv0Cv0ADz0rk07EIJvzyM8gRVMPFGD2Fc7yJNmv0IB6EkD yDEh2Ls2oXmoN0Almz+pKSvGhJuX5cpAgaoXpiog2QbdEmCnc77eiaPfrWzE3UJMcXDd 0ldOgVMZ1NeHekM2QokG0HjFBg7tTLWjWeLEixDsbRBsPE/kjmHSc08rOUbWZ/2F7Lk1 3vZZT97yy1Yg+uqU4nc7PBHerq3h2f8/Z6r4QrWCV2NBZGbyjJTL/wRQUSa5KRVWunKJ snfBOJl6G/fDb60utMa3We7jK8OcnYHFTllPq+mfBuV15uLgCSpj8WaXchX/pBF/oaxA oM9Q== X-Gm-Message-State: AOAM5335UKsHXrUordswegXcqU7/v177sG45Mr0iZ2GhDBt5T++rtrGJ ivGfYaXgbNFxVvRM82QOCN5tIw== X-Google-Smtp-Source: ABdhPJwLlVSc3CyBpLNsGIDE4F8PqlGElypIhHHpraTLcnAuft3u7yu4dlg2qZxqfMB1a7/sefQ6bg== X-Received: by 2002:a7b:cc90:: with SMTP id p16mr3449345wma.45.1614681173901; Tue, 02 Mar 2021 02:32:53 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:f410:82e8:3a21:eedf]) by smtp.gmail.com with ESMTPSA id s11sm2237807wme.22.2021.03.02.02.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 02:32:53 -0800 (PST) In-Reply-To: <87r1kyrtrl.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Tue, 02 Mar 2021 07:47:58 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201205 Archived-At: Protesilaos Stavrou writes: > On 2021-03-01, 23:34 +0000, "Basil L. Contovounesios" 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