From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher League Newsgroups: gmane.emacs.bugs Subject: bug#49274: [PATCH] lisp/cus-theme: retain documentation string when customizing theme Date: Wed, 30 Jun 2021 11:05:28 -0400 Message-ID: <875yxvl7ev.fsf@contrapunctus.net> References: <87y2ar78bq.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="17195"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49274@debbugs.gnu.org To: Mauro Aranda Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 30 17:06:35 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 1lybnP-0004H2-IX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Jun 2021 17:06:35 +0200 Original-Received: from localhost ([::1]:55444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lybnO-0003Ou-C7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Jun 2021 11:06:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lybmt-0002Yk-AF for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 11:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lybms-00046U-PO for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 11:06:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lybms-0004uY-Fv for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 11:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher League Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jun 2021 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49274-submit@debbugs.gnu.org id=B49274.162506554018849 (code B ref 49274); Wed, 30 Jun 2021 15:06:02 +0000 Original-Received: (at 49274) by debbugs.gnu.org; 30 Jun 2021 15:05:40 +0000 Original-Received: from localhost ([127.0.0.1]:58454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lybmV-0004tx-GF for submit@debbugs.gnu.org; Wed, 30 Jun 2021 11:05:39 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:37391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lybmT-0004tj-U6 for 49274@debbugs.gnu.org; Wed, 30 Jun 2021 11:05:39 -0400 Original-Received: (Authenticated sender: league@contrapunctus.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 905BC6001B; Wed, 30 Jun 2021 15:05:30 +0000 (UTC) In-Reply-To: <87y2ar78bq.fsf@tbb.theblackbeard.org> 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:209204 Archived-At: --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain Mauro Aranda writes: > Did you send the old one by mistake? > > Also, please format the commit message according to the Emacs > conventions: see the file CONTRIBUTE and the "Commit messages" section > in particular. Oops yes, sorry for the noise. Attached patch should be better -- LMK if it needs anything else. Thanks, CL --==-=-= Content-Type: text/html

Mauro Aranda <maurooaranda@gmail.com> writes:

Did you send the old one by mistake? Also, please format the commit message according to the Emacs conventions: see the file CONTRIBUTE and the “Commit messages” section in particular.

Oops yes, sorry for the noise. Attached patch should be better – LMK if it needs anything else. Thanks, CL

--==-=-=-- --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Retain-documentation-string-when-customizing-theme.patch >From f303471a775ab7d622c4d572b40c51a00860f8e8 Mon Sep 17 00:00:00 2001 From: Christopher League Date: Mon, 28 Jun 2021 22:41:07 -0400 Subject: [PATCH] Retain documentation string when customizing theme * lisp/cus-theme.el (customize-create-theme): When editing an existing theme, load its doc string into the description widget, instead of replacing it with a date stamp (Bug#49274). --- lisp/cus-theme.el | 100 +++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index dfa2226403..91e4ea1a1a 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -108,60 +108,16 @@ named *Custom Theme*." (unless (y-or-n-p "Include basic face customizations in this theme? ") (setq custom-theme--listed-faces nil))) - (if (eq theme 'user) - (widget-insert "This buffer contains all the Custom settings you have made. -You can convert them into a new custom theme, and optionally -remove them from your saved Custom file.\n\n")) - - (widget-create 'push-button - :tag " Visit Theme " - :help-echo "Insert the settings of a pre-defined theme." - :action (lambda (_widget &optional _event) - (call-interactively #'custom-theme-visit-theme))) - (widget-insert " ") - (widget-create 'push-button - :tag " Merge Theme " - :help-echo "Merge in the settings of a pre-defined theme." - :action (lambda (_widget &optional _event) - (call-interactively #'custom-theme-merge-theme))) - (widget-insert " ") - (widget-create 'push-button - :tag " Revert " - :help-echo "Revert this buffer to its original state." - :action (lambda (&rest ignored) (revert-buffer))) - - (widget-insert "\n\nTheme name : ") - (setq custom-theme-name - (widget-create 'editable-field - :value (if (and theme (not (eq theme 'user))) - (symbol-name theme) - ""))) - (widget-insert "Description: ") - (setq custom-theme-description - (widget-create 'text - :value (format-time-string "Created %Y-%m-%d."))) - (widget-create 'push-button - :notify #'custom-theme-write - " Save Theme ") - (when (eq theme 'user) - (setq custom-theme--migrate-settings t) - (widget-insert " ") - (widget-create 'checkbox - :value custom-theme--migrate-settings - :action (lambda (widget &optional event) - (when (widget-value widget) - (widget-toggle-action widget event) - (setq custom-theme--migrate-settings - (widget-value widget))))) - (widget-insert (propertize " Remove saved theme settings from Custom save file." - 'face '(variable-pitch (:height 0.9))))) - (let (vars values faces face-specs) ;; Load the theme settings. (when theme - (unless (eq theme 'user) - (load-theme theme nil t)) + (if (eq theme 'user) + (widget-insert "This buffer contains all the Custom settings you have made. +You can convert them into a new custom theme, and optionally +remove them from your saved Custom file.\n\n") + (load-theme theme nil t)) + (dolist (setting (get theme 'theme-settings)) (if (eq (car setting) 'theme-value) (progn (push (nth 1 setting) vars) @@ -169,6 +125,50 @@ remove them from your saved Custom file.\n\n")) (push (nth 1 setting) faces) (push (nth 3 setting) face-specs)))) + (widget-create 'push-button + :tag " Visit Theme " + :help-echo "Insert the settings of a pre-defined theme." + :action (lambda (_widget &optional _event) + (call-interactively #'custom-theme-visit-theme))) + (widget-insert " ") + (widget-create 'push-button + :tag " Merge Theme " + :help-echo "Merge in the settings of a pre-defined theme." + :action (lambda (_widget &optional _event) + (call-interactively #'custom-theme-merge-theme))) + (widget-insert " ") + (widget-create 'push-button + :tag " Revert " + :help-echo "Revert this buffer to its original state." + :action (lambda (&rest ignored) (revert-buffer))) + + (widget-insert "\n\nTheme name : ") + (setq custom-theme-name + (widget-create 'editable-field + :value (if (and theme (not (eq theme 'user))) + (symbol-name theme) + ""))) + (widget-insert "Description: ") + (setq custom-theme-description + (widget-create 'text :format "%v" + :value (or (get theme 'theme-documentation) + (format-time-string "Created %Y-%m-%d.")))) + (widget-create 'push-button + :notify #'custom-theme-write + " Save Theme ") + (when (eq theme 'user) + (setq custom-theme--migrate-settings t) + (widget-insert " ") + (widget-create 'checkbox + :value custom-theme--migrate-settings + :action (lambda (widget &optional event) + (when (widget-value widget) + (widget-toggle-action widget event) + (setq custom-theme--migrate-settings + (widget-value widget))))) + (widget-insert (propertize " Remove saved theme settings from Custom save file." + 'face '(variable-pitch (:height 0.9))))) + ;; If THEME is non-nil, insert all of that theme's faces. ;; Otherwise, insert those in `custom-theme--listed-faces'. (widget-insert "\n\n Theme faces:\n ") -- 2.31.1 --=-=-=--