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#48351: 28.0.50; custom-theme-summary doesn't find theme summary line reliably Date: Tue, 11 May 2021 11:26:54 -0300 Message-ID: <87lf8luz0x.fsf@tbb.theblackbeard.org> References: <87o8dhuz8h.fsf@tbb.theblackbeard.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5734"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 48351@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 11 16:34:44 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 1lgTT9-0001LE-Un for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 16:34:43 +0200 Original-Received: from localhost ([::1]:42016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgTT8-0002Rw-TB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 10:34:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgTLi-0007nv-VA for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 10:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgTLi-00031y-Lr for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 10:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgTLi-0006cv-He for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 May 2021 14:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48351 X-GNU-PR-Package: emacs Original-Received: via spool by 48351-submit@debbugs.gnu.org id=B48351.162074320425445 (code B ref 48351); Tue, 11 May 2021 14:27:02 +0000 Original-Received: (at 48351) by debbugs.gnu.org; 11 May 2021 14:26:44 +0000 Original-Received: from localhost ([127.0.0.1]:37049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgTLQ-0006cG-9l for submit@debbugs.gnu.org; Tue, 11 May 2021 10:26:44 -0400 Original-Received: from mail-qk1-f170.google.com ([209.85.222.170]:41704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgTLO-0006bw-K6; Tue, 11 May 2021 10:26:42 -0400 Original-Received: by mail-qk1-f170.google.com with SMTP id l129so18859104qke.8; Tue, 11 May 2021 07:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=3tm7FiUhGmi86nCjnKcacLmbfaIq6Xq6ef++nSTRxvw=; b=OvqRob2Q3BexNvkq7dIobKU1jADa4MIk3VuEFtCNlG347Iu4RPgsEylLNAvtGVmScV SXd25RyHI4X91OsYhymKELQyYmMCuZkkQmVOwWn+rYgrfcM02yf4MCNWWSVZ5XeG90Ws 1CyKeG7koekjA1uK4hRd00zxZVrOeA/wjLxKMuiWn4lCccpORWTfDUjiLlAVjytWHsK5 hLAcPWq6XUt1H3JaQ4qGNZNcGpDoSVuPVJEXgJf0iTFLJKRTHewzLnHENDRyxWCdBw+6 5LYZcjpqudgnX++LKF2o90aGl+r1SUtTID38VzQzPSdtGFRZtC0BffUhOGx6SN/NYtlA MsBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=3tm7FiUhGmi86nCjnKcacLmbfaIq6Xq6ef++nSTRxvw=; b=oCZowAHHqpjOjmxTPsTBeSc/jrzE2lWb78QJmrsy+o3+gnPwVcMItadOrdUTpPFEaU 1ukIJ5KruP+308TeQ5n05xA1BrBPZUkojd+n4hYXWHaojuHMytCpjJkDT7q8tJqUCkYF xfBb80H9uRuVCbfn/4QS5HJLNWSbTl350Ghxl21qCT6e35ZQfw8JewF1NoAcJCoZH2hC M8Poi7i4v/lbZdEbhxqVHmtfTp43L3SaaW+Pd2fXzGWF9Szx1tiZdEd5aEPVljMn4Ffr OEt7l7ItE0lMyHnWK+0n4et5KnTlWv2gDzM19UvtsR8O+XSFrm/7pdPdTGeV57k8MU2r gXBQ== X-Gm-Message-State: AOAM532y7qcIJ7utLWwUTiru/JfeMQIbW/JvrQdD60ZrVAF0TztHYSvj 3TwfZLF4Y1Pm76XFv/cn8pbTK8ugvBNS5g== X-Google-Smtp-Source: ABdhPJxvOeryouGBQwnklYnjQt3LWwSL4QSO9NbJ9tk1jen5XCNQn9B9tb2Mz8GsCTqTVMA2qX5ZvA== X-Received: by 2002:ae9:f504:: with SMTP id o4mr12958177qkg.246.1620743196622; Tue, 11 May 2021 07:26:36 -0700 (PDT) Original-Received: from tbb.theblackbeard.org ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id p1sm13522749qtq.12.2021.05.11.07.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 07:26:35 -0700 (PDT) In-Reply-To: <87o8dhuz8h.fsf@tbb.theblackbeard.org> (Mauro Aranda's message of "Tue, 11 May 2021 11:22:22 -0300") 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:206249 Archived-At: --=-=-= Content-Type: text/plain tags 48351 patch quit Mauro Aranda writes: > IMO, the restriction imposed by `custom-theme-summary' is too strict: > the function currently requires that the deftheme form is the very first > one in the file. Here's a patch. Any comments? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Lift-restriction-for-finding-theme-summary-line.patch Content-Description: patch >From dd65d7bf57e1cffc64af0f86282b0634b9216b20 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Tue, 11 May 2021 09:14:57 -0300 Subject: [PATCH] Lift restriction for finding theme summary line * lisp/cus-theme.el (custom-theme-summary): Don't limit the file to having the deftheme form as the very first form, rather look for the deftheme form explicitly. --- lisp/cus-theme.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 13fb9f34fa..dfa2226403 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -657,10 +657,12 @@ custom-theme-summary (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)))))))) + (progn + (re-search-forward "^(deftheme") + (beginning-of-line) + (read (current-buffer))) + (error nil))))) + (setq doc (nth 2 sexp))))))) (cond ((null doc) "(no documentation available)") ((string-match ".*" doc) -- 2.31.1 --=-=-=--