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#65468: 29.1; describe-theme fails to describe some themes not loaded Date: Wed, 23 Aug 2023 06:53:03 -0300 Message-ID: References: <87lee29m1c.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38781"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: 65468@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 23 11:54:16 2023 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 1qYkZ6-0009xs-3f for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Aug 2023 11:54:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYkYr-0005BF-0U; Wed, 23 Aug 2023 05:54:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYkYp-0005B0-AS for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 05:53:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYkYo-0003B3-Tt for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 05:53:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYkYr-0003J7-Pz for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 05:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Aug 2023 09:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65468 X-GNU-PR-Package: emacs Original-Received: via spool by 65468-submit@debbugs.gnu.org id=B65468.169278439812658 (code B ref 65468); Wed, 23 Aug 2023 09:54:01 +0000 Original-Received: (at 65468) by debbugs.gnu.org; 23 Aug 2023 09:53:18 +0000 Original-Received: from localhost ([127.0.0.1]:32852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYkYA-0003I6-7P for submit@debbugs.gnu.org; Wed, 23 Aug 2023 05:53:18 -0400 Original-Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]:54652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYkY7-0003Hr-LZ for 65468@debbugs.gnu.org; Wed, 23 Aug 2023 05:53:16 -0400 Original-Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-1cc61f514baso2208625fac.1 for <65468@debbugs.gnu.org>; Wed, 23 Aug 2023 02:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692784386; x=1693389186; h=content-transfer-encoding:in-reply-to:from:cc:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=2Bur8fHmPdyshtvd2/Pl8iJaQy9wWjcXpQfdyC4Z9QQ=; b=AvAkvfe1wlmizih30CezWiHhgNn0og18Bc50W36Z5eB4LICz7sj322+VHIf4D/1gC0 YicFhKd8SZElBbLbY2oBbLsMIbceQYbJYwW8Ni8ULscgf+GbXRwDIsNINBmg7hpCU+TO CCwUlP0qn6dunq2fTbw8Y9kd7d29bm6UN5UvV+2O6qAmURewoCdPhPiuCB6VBZ486a/Z pVZ3iOlyrFGO/3nlAzEyiyJfOKvlAXF9G4FWCdQphwcjy9lZurEJ4MKoyG8Fi6O8S1yx 4Ro34s9yIVqevTBMXUnTb4WpAqRMYCvlVnEXU62ILUkQwfN9RR20csLEP8Qa/IHnqeGU jSkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692784386; x=1693389186; h=content-transfer-encoding:in-reply-to:from:cc:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2Bur8fHmPdyshtvd2/Pl8iJaQy9wWjcXpQfdyC4Z9QQ=; b=X2qbz9jNlvZlYQgNHG/mlTqaB2NDnBSFmd9YLz79dpv6FhfYsFajHtywT4JiqjppPR PixZFO63FQtup5lUpyAL3kDP7T+n0ULPnQgBpWHZGkiHz+AXq4hB3IGPMIFdI+ess7cn RCoFglXuJpO1slJxGRQvOSbzMJ1DxT3TgOugQDJW1NBjIvXCgeIKV5qF4U2XND3T6ouS Ix3UVYKxkBJRc2qtsYW6fzeMsmJMN6ljGxrJTd6EVQu2pm9hoO8XME1ib4653NSPY0rr eu+zlleZmSc41C+x2bVQVWZ+L36ru4qCm/JQJw/rllWiwaijI4auv3RFP0JDj8EEQm+m KLfg== X-Gm-Message-State: AOJu0Ywrp18tBSi+1uYlnPX7OEi7WPldfgevAEU0UG/VPw/p6zjwN1c+ xa1YnWdFDsDGVmrCDKM9/lG0v4sMIe0= X-Google-Smtp-Source: AGHT+IFFor5ibokg5yr7RpbPoejcWc/8wTPdUTEVwK9NqzMWvM/dEOj4rzkMn38Ountp3fhoCBL7uA== X-Received: by 2002:a05:6870:700d:b0:1ad:4a74:9d63 with SMTP id u13-20020a056870700d00b001ad4a749d63mr12551538oae.53.1692784386125; Wed, 23 Aug 2023 02:53:06 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id p127-20020a4a4885000000b00569c5eadf15sm6122633ooa.26.2023.08.23.02.53.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Aug 2023 02:53:05 -0700 (PDT) Content-Language: en-US In-Reply-To: <87lee29m1c.fsf@posteo.net> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268217 Archived-At: Thierry Volpiatto writes: > This because `describe-theme-1` is not looping in buffer to find > `deftheme` definition. It is a convention that the first form should be a call to deftheme. But it seems built-in themes have deviated from that convention. And other themes might as well, I don't know. > > Try (describe-theme 'leuven) to reproduce (if not already loaded of course). > At least for the leuven themes, it should be easy to make them follow the convention. > This patch fixes it: > > diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el > index 5d3f2585976..3640d1ec329 100644 > --- a/lisp/cus-theme.el > +++ b/lisp/cus-theme.el > @@ -513,13 +513,15 @@ It includes all faces in list FACES." > ;; Attempt to grab the theme documentation > (when fn > (with-temp-buffer > - (insert-file-contents fn) > - (let ((sexp (let ((read-circle nil)) > - (condition-case nil > - (read (current-buffer)) > - (end-of-file nil))))) > - (and (eq (car-safe sexp) 'deftheme) > - (setq doc (nth 2 sexp))))))) > + (insert-file-contents fn) > + (catch 'found > + (let (sexp) > + (while (setq sexp (let ((read-circle nil)) > + (condition-case nil > + (read (current-buffer)) > + (end-of-file nil)))) > + (when (eq (car-safe sexp) 'deftheme) > + (throw 'found (setq doc (nth 2 sexp)))))))))) > (princ "\n\nDocumentation:\n") > (princ (if (stringp doc) > (substitute-command-keys doc) > > However for the modus themes it will fail as well because deftheme is > nested inside a eval-when-compile. I feel like if there are more themes that suffer from this problem, they could solve it by following the convention. And for other themes, it seems like either way we have to give it more thought, because AFAICS following the convention is more difficult and the patch doesn't solve it either. > And while I am at it, the docstring of Leuven-dark is wrong (guess it has > been copy/pasted from Leuven without modifications). This has been fixed already, thanks.