From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#45068: [PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible) Date: Sun, 28 Feb 2021 08:41:34 -0300 Message-ID: <603b8171.1c69fb81.aa664.7f40@mx.google.com> References: <87im9fgm27.fsf@protesilaos.com> <87zh2ldgtf.fsf@protesilaos.com> <87k0toof83.fsf@mail.linkov.net> <83wnxo1mcr.fsf@gnu.org> <83v9d81khh.fsf@gnu.org> <83mtyk1hq3.fsf@gnu.org> <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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7443"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux) Cc: 45068@debbugs.gnu.org To: Protesilaos Stavrou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 28 12:42:12 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 1lGKSi-0001ph-6k for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Feb 2021 12:42:12 +0100 Original-Received: from localhost ([::1]:40470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGKSh-0003Fl-9O for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Feb 2021 06:42:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGKSY-0003Fd-H5 for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2021 06:42:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGKSY-00031w-9w for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2021 06:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lGKSY-0005RV-8G for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2021 06:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Feb 2021 11:42:02 +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.161451250720897 (code B ref 45068); Sun, 28 Feb 2021 11:42:02 +0000 Original-Received: (at 45068) by debbugs.gnu.org; 28 Feb 2021 11:41:47 +0000 Original-Received: from localhost ([127.0.0.1]:45957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGKSI-0005Qx-Hk for submit@debbugs.gnu.org; Sun, 28 Feb 2021 06:41:46 -0500 Original-Received: from mail-qk1-f175.google.com ([209.85.222.175]:37757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGKSG-0005Ql-FN for 45068@debbugs.gnu.org; Sun, 28 Feb 2021 06:41:44 -0500 Original-Received: by mail-qk1-f175.google.com with SMTP id s7so3713444qkg.4 for <45068@debbugs.gnu.org>; Sun, 28 Feb 2021 03:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:cc:subject:references:date:in-reply-to :user-agent:mime-version; bh=eCClxjki47wNnADjmHd+Y/l0VYTuFFYJLr9RgYpLT1I=; b=NgR/hC8iBfPpaTjP7BY7yKjRt89DZatqsAUf+ToTW6HvaoWe8jTLeBazj8dRHBW9mn vyWkW+Rw6FIaQzzON/IOoVnqztI5dn1zfppB7jqNWIk8F/yMZvkJOfR5dpYLZ9iDsPwt aIEWw/bVUTB84KdD9o8Ie+QJE93DEaux8eZ1cavHmxLNoXbGuB6iVyddw0733okRUJ1w lwdthjk00YOAq/B2Tv3EiYB+/VAQPNUnl5+E6jh8e9ydioGRJ7on82P3K8nrBty87jFA r6BzR5SCDo06aPHB/e2QiQEours9p0x5czd6oE8FivgE96Sv7ciuhTRZLRhuS8aVgK00 PZyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:cc:subject:references:date :in-reply-to:user-agent:mime-version; bh=eCClxjki47wNnADjmHd+Y/l0VYTuFFYJLr9RgYpLT1I=; b=BZVOLwtpdQUeddXSyJGULXS0b/mg3jP/leNS3faMTWekSCzYsj0son0myZy/rPy4dr kFySUNPRr4w22F6AAdIaTG13Yh3FNDyNN+gurCoOQHcYgsKvY3+rOHke4R6dqNgv5jsu Lwpa08bIAGfjwMvMme+4Lb8IIbLo7wnwVfbJOq8S1sZLB1JL4tKgAdpahICfXB+uo+m1 NTJ7oP5whGxlBdw8LEuwikZkg1i+Secf7wVKafdWzky1L71Eo0oAzS9sxrnsI0Qcp/SE eYjvOYaKtq5m1E9h9R4081AHEVlFdaxF9hVmlRqgyfqI52LoXYTrl8Rf2x0TemqfQyZy MnWg== X-Gm-Message-State: AOAM531w/DHcS0HzZnvpMFgO7xC5qv4HVmlJvP+TX4zQdrj+sXXnohXS fDnpqZPCVZw6N+93gOWaYfjN+Hcz1pnOxg== X-Google-Smtp-Source: ABdhPJxeMmRWf6X2vNHtCy8Qyzz9OgeID3dfH8hpDzl6JhDNgOFX74I86/cp3K6w8MrFpGctYtuGgg== X-Received: by 2002:ae9:edc1:: with SMTP id c184mr8625271qkg.453.1614512498361; Sun, 28 Feb 2021 03:41:38 -0800 (PST) Original-Received: from tbb-desktop ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id q15sm9294848qti.9.2021.02.28.03.41.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Feb 2021 03:41:37 -0800 (PST) X-Google-Original-Message-ID: <87tupwh11t.fsf_-_@maurooaranda@gmail.com> In-Reply-To: <874khwn1qf.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Sun, 28 Feb 2021 08:30:16 +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:201014 Archived-At: Hi Protesilaos, Protesilaos Stavrou writes: > (defun require-theme (theme &optional directories) > "Load THEME stored in `custom-theme-load-path'. > > THEME is a symbol or string that corresponds to the file name without > its file type extension. That is assumed to be either '.el' or '.elc'. > > If THEME names a valid theme, load and enable it. Otherwise load the > file, if present. In the latter case, the file is intended to work as > the basis of a theme declared with `deftheme'. > > With optional DIRECTORIES as a list of filesystem paths, search > for THEME file in those locations instead and load it, if present." > (let* ((theme-dirs (custom-theme--load-path)) > (custom-dirs (when (and directories (listp directories)) > directories)) > (theme-name (cond > ((stringp theme) > theme) > ((symbolp theme) > (format "%s" theme)) I think it's better to use `symbol-name' when you're sure it's a symbol. > (cond > ((custom-theme-p theme) > (load-theme theme t)) Some comments about this clause: The docstring says a valid theme, but this checks for a "known" theme. I think the docstring should clarify that. Also, in this clause you don't need all the early work for locating the file. More important: doesn't this make it possible to load a non-safe theme (as controlled by `custom-safe-themes') behind the user's back? > This works in two ways: > > 1. To load a theme's dependency: > > (require-theme 'modus-themes) > > 2. To load and enable a theme: > > (require-theme 'modus-operandi) IIUC, (2) works only after the theme is "known".