From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jan 2021 22:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 45829@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161048964019882 (code B ref -1); Tue, 12 Jan 2021 22:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jan 2021 22:14:00 +0000 Received: from localhost ([127.0.0.1]:33548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzRvM-0005Ac-5l for submit@debbugs.gnu.org; Tue, 12 Jan 2021 17:14:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:39380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzRvK-0005AU-Fc for submit@debbugs.gnu.org; Tue, 12 Jan 2021 17:13:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzRvK-00053I-Av for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 17:13:58 -0500 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:38011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzRvH-0007zE-U4 for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 17:13:58 -0500 Received: by mail-qv1-xf2e.google.com with SMTP id az16so1685330qvb.5 for ; Tue, 12 Jan 2021 14:13:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:subject:date:mime-version; bh=oEFqrPrLt6S7pvVELbjPaai2YsUcNml/Ff5HxhSw23k=; b=PwO9qKlbLMJxFbmZJNZuSAVrufU7RLlz8+ws24gcOgpHCcdfXNVmsnkdC5cPE1/evz tcdVJdFpgIECeCh76Ys+H0jarc/HqE4wxtwxM4TLOwB7vG79ZqJm91SLzF3pAtwvAznD D36wehz8JLehXF07YchkH4qPamQGsWVfdLjwTidM+AGPuXQizxqGZJRC4yKiJlw8Jgtf eUjBR0UnpRuwZEeS1ui/KhI9y/EEAoqdYQIeykAELxyC274bbNm+iCDwAQaZEWJ5l0Go QRroYiJtJoxKLlgL1jYZHRGlaAt69IJZ7sPJfwUSv/TR7ldFyZRXKSeubADrMUJYAt10 KTcw== 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:subject:date:mime-version; bh=oEFqrPrLt6S7pvVELbjPaai2YsUcNml/Ff5HxhSw23k=; b=EJR5t6DqbKcD7BygyiFLRI9NLWTf6ND9UGv+F1Hb9mtcBThIFEjHWQtnzjpu3bTE5c R+HHIGBQ1fDtbV+opEQZRapsUWoRzQ8d3EPyrH+lKAA/IUjHa4ZAHsOhsBXTOA38F6Mq 9NM432G3ckOvugyr0sbmzksytjYt6c8SqBtOMXCjZVK/Q6KKNWUWidfGBnLdFisoaCoB aJGjhKTnWVTz72R6FJpU+JMHEA5Cmw1fHYvat2/oLM2pSDca8cz2gzGdHwkvT7HGDwUF HAWK0n1KZ0ab963cXsIBYxR7wLC4Ed63wE0TYc99pyOmEJjJkYDOhtqc+7Fkvxkto0Ht IQFw== X-Gm-Message-State: AOAM533nfVnWASAQIryV4gktUbJshWt+1J48wX7n/+gtSq9mqPHqwXO8 py2AuojWybSTWN+IvJJ0BWB6HmRA62Y= X-Google-Smtp-Source: ABdhPJw4wFXcBSqO8PTF/Xse+nCkCv1XGWzwCj4Sh9a44iERLsTKMzYhmjoPziAiPIWHDTcowAlRgg== X-Received: by 2002:a0c:f888:: with SMTP id u8mr1419687qvn.47.1610489633849; Tue, 12 Jan 2021 14:13:53 -0800 (PST) Received: from tbb-desktop ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id x20sm127664qkj.18.2021.01.12.14.13.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Jan 2021 14:13:52 -0800 (PST) Message-ID: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> X-Google-Original-Message-ID: <87h7nlx0pt.fsf@maurooaranda@gmail.com> From: Mauro Aranda Date: Tue, 12 Jan 2021 19:13:50 -0300 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=maurooaranda@gmail.com; helo=mail-qv1-xf2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Severity: wishlist Off-list, Drew offered me to take a look at his additions to wid-edit.el, in wid-edit+.el [1], to see if some of it would be useful to add in wid-edit.el itself. I think the changes to the color widget are useful and straightforward to bring to the Widget library (there is a FIXME asking for a :match function for the color widget). So I put the changes into a patch and gave it a commit message, and I'll send it as soon as I get a bug number. [1] https://www.emacswiki.org/emacs/download/wid-edit%2b.el In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2021-01-11 built on tbb-desktop Repository revision: d8936322f43c88bb1cdebe1a50a7cc7eb0efe834 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Ubuntu 18.04.5 LTS Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_MONETARY: es_AR.UTF-8 value of $LC_NUMERIC: es_AR.UTF-8 value of $LC_TIME: es_AR.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: shell-dirtrack-mode: t bug-reference-prog-mode: t global-ede-mode: t ede-minor-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow emacsbug sendmail log-edit magit-utils crm dash slime-tests vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc-annotate files-x grep term shell ehelp ert pcase wid-browse vc-dir ewoc mule-util whitespace ielm add-log log-view pcvs-util cl-print debug backtrace cus-edit misearch multi-isearch semantic/lex-spp ede/emacs semantic/db semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local vc-git bug-reference rx org-element avl-tree ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search ol-docview doc-view image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m smerge-mode diff diff-mode jka-compr shr-color flow-fill mm-archive gnus-fun eieio-opt shortdoc help-fns radix-tree smiley gnus-cite mail-extr qp gnus-async gnus-bcklg gnus-ml disp-table cursor-sensor nndraft nnmh nndoc nnfolder cl-extra help-mode gnutls network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win dired-aux ede/dired edmacro kmacro cus-start cus-load org-capture org-refile solarized-dark-high-contrast-theme solarized-palettes solarized solarized-faces color init-ext init-emms dbus emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit emms-volume emms-volume-mixerctl emms-volume-pulse emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time emms-lyrics emms-url emms-streams emms-show-all emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-exiftool emms-info-tinytag emms-info-metaflac emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-info emms-later-do emms-playlist-mode emms-player-vlc emms-player-mpv emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file locate dired dired-loaddefs emms-setup emms emms-compat init-gnus gnus nnheader gnus-util init-org org-clock org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat advice org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs init-social newsticker newst-treeview tree-widget newst-plainview newst-reader newst-ticker newst-backend iso8601 time-date xml derived init-cedet ede/speedbar ede/files ede ede/detect ede/base ede/auto ede/source eieio-base eieio-speedbar speedbar ezimage dframe eieio-custom wid-edit cedet init-octave init-rmail undigest rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils init-vc vc vc-dispatcher init-cc-mode init-c init-yasnippet init-eshell eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util init-lisp slime compile text-property-search etags fileloop generator xref project arc-mode archive-mode noutline outline easy-mmode pp comint ansi-color ring hyperspec thingatpt init-elisp init-global finder-inf init-package slime-autoloads info package easymenu browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1258345 74841) (symbols 48 43820 3) (strings 32 179469 4671) (string-bytes 1 5243763) (vectors 16 75498) (vector-slots 8 1608981 191897) (floats 8 689 512) (intervals 56 81047 1132) (buffers 984 54)) From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jan 2021 22:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 45829@debbugs.gnu.org Cc: drew.adams@oracle.com Received: via spool by 45829-submit@debbugs.gnu.org id=B45829.161049019728816 (code B ref 45829); Tue, 12 Jan 2021 22:24:02 +0000 Received: (at 45829) by debbugs.gnu.org; 12 Jan 2021 22:23:17 +0000 Received: from localhost ([127.0.0.1]:33575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzS4K-0007Ud-H3 for submit@debbugs.gnu.org; Tue, 12 Jan 2021 17:23:16 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:34947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzS4G-0007UG-SE; Tue, 12 Jan 2021 17:23:14 -0500 Received: by mail-qk1-f172.google.com with SMTP id n142so3455530qkn.2; Tue, 12 Jan 2021 14:23:12 -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=O1WuzZarvD9eR5d3rB9GG123O7Xkw9OXKhl9yMwPki4=; b=NlAcLMFjFFfR/Y8rCEtAS4LcoiV/y8u5WOiQOZnaj8bFIdsoexgpDwndqHBnuDnVj6 Tjdg2dsql2pgusrzf3htT1swMWdpgi2+YB9zxqbyDvugzXHX/YZxWVfmq+uy6ZUesaum tpnpxrKbHF4nPQW5ZY7nit79dG41HvIDlQaNwB9v3lG3fVVD0oDr531KaAlu0CqDJ/cf rilquVLtiMdaLUQAIIfIylGoxds95D3+D2j34LaC/USzsM9Wr77l4cee68JSxpIktlst /9RvdJMo0w1WHgF6ZGYdnBK68qbwakWX3J3xXbbB3kh9gp8X39iNo6RC3+LRJdhXQnGg gEhA== 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=O1WuzZarvD9eR5d3rB9GG123O7Xkw9OXKhl9yMwPki4=; b=uXPsZ/AygpU6pIuBYIHNNYmcX0I1ZLBr6HpZ/d8xZxRFSIvhYRe2+G+QJbeXAplxfw u5izcqSaS71R0csK7AXLXhylVoJD7NvAdiJy0Tf5IyBsR9w9Y0d8LE0jOjKoVtpaT92V eSFh0quZeKjJ3e6WTzgST7CATGNy4/7VqtBxGPq0hiQcMroNJXjiRVgH2IpTobs2fc5w a1MVtHZWsmQoTDVm4a8DJCLEKvuzkScXtqTeb9csmKXPYimWfRnLSn/pw04ItG9re7N0 DGPtoA6sze3zmFEPunlVwyKmw5CrPEEOwEEPahjs1YcY67aeonWyumAOGLugZDq8f9u+ BANQ== X-Gm-Message-State: AOAM531KqITC5lelbaQWdhiel+1aZRPOdA1NYAj0dfO1cdCS1ZVCMcuQ Ux2CpX/mXQb6QcR+TQQRfKmeYP7YDNc= X-Google-Smtp-Source: ABdhPJyXXPOzJ/la72Bm+73bB7wCdNYFf/OQQn5QSZfGJ6EvrFdmM5zBMJEb105DIP4ibEV5n+k8Ew== X-Received: by 2002:a37:642:: with SMTP id 63mr1823237qkg.123.1610490187010; Tue, 12 Jan 2021 14:23:07 -0800 (PST) Received: from tbb-desktop ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id c136sm118695qkg.71.2021.01.12.14.23.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Jan 2021 14:23:05 -0800 (PST) Message-ID: <5ffe2149.1c69fb81.b9bf6.0d1d@mx.google.com> X-Google-Original-Message-ID: <877dohx0ag.fsf@maurooaranda@gmail.com> From: Mauro Aranda References: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> Date: Tue, 12 Jan 2021 19:23:03 -0300 In-Reply-To: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> (Mauro Aranda's message of "Tue, 12 Jan 2021 19:13:50 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain tags 45829 patch quit (CCing Drew) I attach one patch with the changes, and one patch with a test for the new :match function. Opinions? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Tweaks-to-the-color-widget-Bug-45829.patch Content-Description: Patch >From 8a3a2f8b92708175c62a3b4efd7eb00228c5011a Mon Sep 17 00:00:00 2001 From: Drew Adams Date: Tue, 12 Jan 2021 19:14:19 -0300 Subject: [PATCH] Tweaks to the color widget (Bug#45829) * lisp/wid-edit.el (widget-color-match, widget-color-validate): New functions. (color): Use the new functions. Base size on longest defined color name. --- lisp/wid-edit.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 8b10d71dcb..19e58f5345 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -4024,17 +4024,18 @@ widget-boolean-prompt-value ;;; The `color' Widget. -;; Fixme: match (define-widget 'color 'editable-field "Choose a color name (with sample)." :format "%{%t%}: %v (%{sample%})\n" :value-create 'widget-color-value-create - :size 10 + :size (1+ (apply #'max (mapcar #'length (defined-colors)))) :tag "Color" :value "black" :completions (or facemenu-color-alist (defined-colors)) :sample-face-get 'widget-color-sample-face-get :notify 'widget-color-notify + :match #'widget-color-match + :validate #'widget-color-validate :action 'widget-color-action) (defun widget-color-value-create (widget) @@ -4083,6 +4084,19 @@ widget-color-notify (overlay-put (widget-get widget :sample-overlay) 'face (widget-apply widget :sample-face-get)) (widget-default-notify widget child event)) + +(defun widget-color-match (_widget value) + "Non-nil if VALUE is a defined color or a RGB hex string." + (and (stringp value) + (or (color-defined-p value) + (string-match-p "^#\\([[:xdigit:]]\\{3\\}\\)\\{1,4\\}$" value)))) + +(defun widget-color-validate (widget) + "Check that WIDGET's value is a valid color." + (let ((value (widget-value widget))) + (unless (widget-color-match widget value) + (widget-put widget :error (format "Invalid color: %S" value)) + widget))) ;;; The Help Echo -- 2.29.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-test-for-the-widget-color-match-function-Bug-458.patch Content-Description: Test >From 5d6bc24b3b16307361d6411e1b4f1e3735664125 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Tue, 12 Jan 2021 19:19:21 -0300 Subject: [PATCH] Add test for the widget-color-match function (Bug#45829) * test/lisp/wid-edit-tests.el (widget-test-color-match): New test. --- test/lisp/wid-edit-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 17fdfefce8..c410b8e367 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -322,4 +322,15 @@ widget-test-widget-move (widget-backward 1) (should (string= "Second" (widget-value (widget-at)))))) +(ert-deftest widget-test-color-match () + "Test that the :match function for the color widget works." + (let* ((widget (widget-convert 'color))) + (should (widget-apply widget :match "red")) + (should (widget-apply widget :match "#fa3")) + (should (widget-apply widget :match "#ff0000")) + (should (widget-apply widget :match "#111222333")) + (should (widget-apply widget :match "#111122223333")) + (should-not (widget-apply widget :match "someundefinedcolorihope")) + (should-not (widget-apply widget :match "#11223")))) + ;;; wid-edit-tests.el ends here -- 2.29.2 --=-=-=-- From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jan 2021 22:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mauro Aranda Cc: 45829@debbugs.gnu.org Received: via spool by 45829-submit@debbugs.gnu.org id=B45829.16107493697900 (code B ref 45829); Fri, 15 Jan 2021 22:23:02 +0000 Received: (at 45829) by debbugs.gnu.org; 15 Jan 2021 22:22:49 +0000 Received: from localhost ([127.0.0.1]:41925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0XUX-00023M-2E for submit@debbugs.gnu.org; Fri, 15 Jan 2021 17:22:49 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:44530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0XUU-000234-EY for 45829@debbugs.gnu.org; Fri, 15 Jan 2021 17:22:47 -0500 Received: by mail-wr1-f50.google.com with SMTP id w5so10738201wrm.11 for <45829@debbugs.gnu.org>; Fri, 15 Jan 2021 14:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jXjQ7OWuM526GQq0szkmqSKiippTIuWCPezJX/hA3YA=; b=MSo0arkKeFUsXZy4DTlsVHLVOo7jVVViGyWqYYyTTEyGgofWe/KneaPyDDANonNIwr tzm/OWKO6l6OJlwhsT8OpXWh/siyFGAKxyqLeUf9YQ3rBE5uYKGfNXthIhexwPNBJQIr o3Hm7PfdOMxvEn3qzBlHhhEo2MFYd/u6sFlGVQYKQNbk3FpDDjg5jH4ELK+hwsjG76fl LRuoxD348DXGHPaMMTo+Tg+GLgqniLq98SaqAi0UboM4zjsX8EfYpr+HdLLAfg3GreCV SDKirpdDgcdsKByyehBrEsU5X5y6lsOCiRbvP1iH2XYhE9LRn9OzpU1R3TgBWY4MDvFZ 454Q== 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=jXjQ7OWuM526GQq0szkmqSKiippTIuWCPezJX/hA3YA=; b=W8WRehjWEtDrhptAKuy2/0XdbZGTqB5IVj5plQCm546VLzqaSS0SRZ0V/A+JYv9TzU oPCUxQOGAMmJGSmRhjydrGRMsF1MqPbHRe9TajrA+5jndrlB1ngL90k4fBUrzh1YOoOP 9a37+kJX8G7dLHbnfe1LHsw72ZN+iELQEeOIySOZdcJ2AJHbJBUWQc1Fef8/c4fV4Yv6 Kaqzd9u22ZLoUPIwkkhglKY/h7kslPHiB5har5AEbVKVw7GPeJuVZtjtDUbLMcUUMrTN TS4+0auJJ/U/bTr++5juFVAl51GjZC7zaAqGF7WBhn/haEFQwHfJYCBqx35OzfMX7raC F7Sw== X-Gm-Message-State: AOAM531UBGB5IEG4oC2PutWXCXpAkznCTnob7uMuEFwHowkG6wrhk+aR y0CgkEldoI2aPw99tm03rLBHwA== X-Google-Smtp-Source: ABdhPJwiUlRm0vlt2lvHeTs0h0BOZXBphdl7ElPBDcd7UweDw6BkpbRuK7f22QL4bXOAGuffVvQU7Q== X-Received: by 2002:a5d:65c4:: with SMTP id e4mr15816879wrw.115.1610749360547; Fri, 15 Jan 2021 14:22:40 -0800 (PST) Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id m17sm17653770wrn.0.2021.01.15.14.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:22:39 -0800 (PST) From: "Basil L. Contovounesios" References: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> <5ffe2149.1c69fb81.b9bf6.0d1d@mx.google.com> Date: Fri, 15 Jan 2021 22:22:38 +0000 In-Reply-To: <5ffe2149.1c69fb81.b9bf6.0d1d@mx.google.com> (Mauro Aranda's message of "Tue, 12 Jan 2021 19:23:03 -0300") Message-ID: <87v9bxg7rl.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mauro Aranda writes: > Opinions? Just some minor nits from me. > -;; Fixme: match > (define-widget 'color 'editable-field > "Choose a color name (with sample)." > :format "%{%t%}: %v (%{sample%})\n" > :value-create 'widget-color-value-create > - :size 10 > + :size (1+ (apply #'max (mapcar #'length (defined-colors)))) Is defined-colors guaranteed to return non-nil? If not, you need (apply #'max 0 ...). > +(defun widget-color-match (_widget value) > + "Non-nil if VALUE is a defined color or a RGB hex string." > + (and (stringp value) > + (or (color-defined-p value) > + (string-match-p "^#\\([[:xdigit:]]\\{3\\}\\)\\{1,4\\}$" value)))) Shouldn't that be "\\`#[[:xdigit:]]\\{3\\}\\{1,4\\}\\'" or at least "\\`#\\(?:[[:xdigit:]]\\{3\\}\\)\\{1,4\\}\\'" (if you want to be explicit)? > +(ert-deftest widget-test-color-match () > + "Test that the :match function for the color widget works." > + (let* ((widget (widget-convert 'color))) Nit: could also be let. > + (should (widget-apply widget :match "red")) > + (should (widget-apply widget :match "#fa3")) > + (should (widget-apply widget :match "#ff0000")) > + (should (widget-apply widget :match "#111222333")) > + (should (widget-apply widget :match "#111122223333")) > + (should-not (widget-apply widget :match "someundefinedcolorihope")) > + (should-not (widget-apply widget :match "#11223")))) Thanks, -- Basil From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jan 2021 07:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: maurooaranda@gmail.com, 45829@debbugs.gnu.org Received: via spool by 45829-submit@debbugs.gnu.org id=B45829.161078097124324 (code B ref 45829); Sat, 16 Jan 2021 07:10:02 +0000 Received: (at 45829) by debbugs.gnu.org; 16 Jan 2021 07:09:31 +0000 Received: from localhost ([127.0.0.1]:42315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0fiF-0006KG-0s for submit@debbugs.gnu.org; Sat, 16 Jan 2021 02:09:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0fiD-0006K4-Jv for 45829@debbugs.gnu.org; Sat, 16 Jan 2021 02:09:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50332) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0fi8-0004IX-29; Sat, 16 Jan 2021 02:09:24 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2837 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l0fi7-00009h-Dm; Sat, 16 Jan 2021 02:09:23 -0500 Date: Sat, 16 Jan 2021 09:09:25 +0200 Message-Id: <83eeil9x3u.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87v9bxg7rl.fsf@tcd.ie> (contovob@tcd.ie) References: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> <5ffe2149.1c69fb81.b9bf6.0d1d@mx.google.com> <87v9bxg7rl.fsf@tcd.ie> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Basil L. Contovounesios" > Date: Fri, 15 Jan 2021 22:22:38 +0000 > Cc: 45829@debbugs.gnu.org > > > (define-widget 'color 'editable-field > > "Choose a color name (with sample)." > > :format "%{%t%}: %v (%{sample%})\n" > > :value-create 'widget-color-value-create > > - :size 10 > > + :size (1+ (apply #'max (mapcar #'length (defined-colors)))) > > Is defined-colors guaranteed to return non-nil? Not according to its doc string. From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jan 2021 12:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: 45829@debbugs.gnu.org Received: via spool by 45829-submit@debbugs.gnu.org id=B45829.16107990484467 (code B ref 45829); Sat, 16 Jan 2021 12:11:01 +0000 Received: (at 45829) by debbugs.gnu.org; 16 Jan 2021 12:10:48 +0000 Received: from localhost ([127.0.0.1]:42529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0kPn-00019z-SO for submit@debbugs.gnu.org; Sat, 16 Jan 2021 07:10:48 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:41507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0kPl-00019g-5y for 45829@debbugs.gnu.org; Sat, 16 Jan 2021 07:10:47 -0500 Received: by mail-qk1-f180.google.com with SMTP id 19so14409890qkm.8 for <45829@debbugs.gnu.org>; Sat, 16 Jan 2021 04:10:45 -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=spLFes6WxsdFNIJqKNxZI7E2lPYmaFqUZ4QfhRif25I=; b=baSfy7nX+4SbFeuG49aXSQdlckgxMOvxS2CDpSejRA5rh7idRpPYOrSTN6v0bLDd9q 9sbabRRwFRC9TYhrSLDDphfUIDXYAVnI0xxqHGgg3cTOOPMD4Qg18CMS3vDD/GSMPheg CATVTFsPHiGLVcEbYE1Yvswlzst4y124FQszILNB2k5L5h4wLLPesAGbpZtQnKf+YDXH tTTTzC+BOP+ZRCTX9SkRwOW6g89dNSgOJigwFFnCQlzt9yiIN/R/QSr4jmz0991RXzae rfs4vfeKwXMG29c5CYccuA42sp3lebm28g0ioR68EJ9vX9UFe7355G22quyNbdBNPvWs CVhQ== 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=spLFes6WxsdFNIJqKNxZI7E2lPYmaFqUZ4QfhRif25I=; b=QUtbc1+tmANHkkOVdpNBSqoaVjQClv+nUY644G53SAa6i5a07j3aGaB7yeoR5gadpU aDyPZS9nczdjMz+hZC2POagNeUD+U9MS5ChW+OIVl5IpQfjkUWdWw9bWDu/mtCxjwoEB G/BtgAStfz+b3Y2JmYGwHc4TxmFW0ax93gtiSE3T5M35p/ZoNqYPQHUv8Q+y6mimn0Q3 hk9VPSaT+CGmUc60wNDFu1852ASCWc8t2bOZ4Mn6bqN845jkZdP9oIJORGw6TcFJHTe2 Ter0DZ2FldYJoh+bKtFEi1F2jhhv6/S1Dt1bRMGwAQ5dg3hzcrcYwT2tUB/KZbXgOzl3 KnIw== X-Gm-Message-State: AOAM530RbKHnUebOnUboZp4BEBXPVlAdahAt/Rz9JNJREP74pGcH181y ljXFQzRji8JHbNig6ECtdvrXEsQED94= X-Google-Smtp-Source: ABdhPJyEi72N7YS6woCPtSGumIvFa/CUwR1Fpsdh7vW8IPFmtQgPG93u4YYYPxTcUxe1Q6VJAiS51w== X-Received: by 2002:a05:620a:22a5:: with SMTP id p5mr16665352qkh.69.1610799039375; Sat, 16 Jan 2021 04:10:39 -0800 (PST) Received: from tbb-desktop ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id o29sm6585500qtl.7.2021.01.16.04.10.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Jan 2021 04:10:38 -0800 (PST) Message-ID: <6002d7be.1c69fb81.a7260.b538@mx.google.com> X-Google-Original-Message-ID: <87k0sdqdz8.fsf@maurooaranda@gmail.com> From: Mauro Aranda References: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> <5ffe2149.1c69fb81.b9bf6.0d1d@mx.google.com> <87v9bxg7rl.fsf@tcd.ie> Date: Sat, 16 Jan 2021 09:10:35 -0300 In-Reply-To: <87v9bxg7rl.fsf@tcd.ie> (Basil L. Contovounesios's message of "Fri, 15 Jan 2021 22:22:38 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > Mauro Aranda writes: > >> Opinions? > > Just some minor nits from me. Hi Basil, thanks for taking a look. >> -;; Fixme: match >> (define-widget 'color 'editable-field >> "Choose a color name (with sample)." >> :format "%{%t%}: %v (%{sample%})\n" >> :value-create 'widget-color-value-create >> - :size 10 >> + :size (1+ (apply #'max (mapcar #'length (defined-colors)))) > > Is defined-colors guaranteed to return non-nil? > If not, you need (apply #'max 0 ...). Thanks for catching this one. I modified it so as to default to 13, which would be the longest hex string. >> +(defun widget-color-match (_widget value) >> + "Non-nil if VALUE is a defined color or a RGB hex string." >> + (and (stringp value) >> + (or (color-defined-p value) >> + (string-match-p "^#\\([[:xdigit:]]\\{3\\}\\)\\{1,4\\}$" value)))) > > Shouldn't that be "\\`#[[:xdigit:]]\\{3\\}\\{1,4\\}\\'" > or at least "\\`#\\(?:[[:xdigit:]]\\{3\\}\\)\\{1,4\\}\\'" > (if you want to be explicit)? I prefer the latter. I kept the ^ and $, though. >> +(ert-deftest widget-test-color-match () >> + "Test that the :match function for the color widget works." >> + (let* ((widget (widget-convert 'color))) > > Nit: could also be let. Ah yes, the let* was just a leftover. >> + (should (widget-apply widget :match "red")) >> + (should (widget-apply widget :match "#fa3")) >> + (should (widget-apply widget :match "#ff0000")) >> + (should (widget-apply widget :match "#111222333")) >> + (should (widget-apply widget :match "#111122223333")) >> + (should-not (widget-apply widget :match "someundefinedcolorihope")) >> + (should-not (widget-apply widget :match "#11223")))) > > Thanks, New patch attached, thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Tweaks-to-the-color-widget-Bug-45829.patch Content-Description: Patch >From be6b966173a9d0d455df884d28efcd6aaa0d54f7 Mon Sep 17 00:00:00 2001 From: Drew Adams Date: Sat, 16 Jan 2021 08:56:55 -0300 Subject: [PATCH] Tweaks to the color widget (Bug#45829) * lisp/wid-edit.el (widget-color-match, widget-color-validate): New functions. (color): Use the new functions. Base size on longest defined color name, defaulting to the longest RGB hex string. --- lisp/wid-edit.el | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 7dda04eda2..68a0d3d235 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -4026,17 +4026,19 @@ widget-boolean-prompt-value ;;; The `color' Widget. -;; Fixme: match (define-widget 'color 'editable-field "Choose a color name (with sample)." :format "%{%t%}: %v (%{sample%})\n" :value-create 'widget-color-value-create - :size 10 + :size (1+ (apply #'max 13 ; Longest RGB hex string. + (mapcar #'length (defined-colors)))) :tag "Color" :value "black" :completions (or facemenu-color-alist (defined-colors)) :sample-face-get 'widget-color-sample-face-get :notify 'widget-color-notify + :match #'widget-color-match + :validate #'widget-color-validate :action 'widget-color-action) (defun widget-color-value-create (widget) @@ -4085,6 +4087,19 @@ widget-color-notify (overlay-put (widget-get widget :sample-overlay) 'face (widget-apply widget :sample-face-get)) (widget-default-notify widget child event)) + +(defun widget-color-match (_widget value) + "Non-nil if VALUE is a defined color or a RGB hex string." + (and (stringp value) + (or (color-defined-p value) + (string-match-p "^#\\(?:[[:xdigit:]]\\{3\\}\\)\\{1,4\\}$" value)))) + +(defun widget-color-validate (widget) + "Check that WIDGET's value is a valid color." + (let ((value (widget-value widget))) + (unless (widget-color-match widget value) + (widget-put widget :error (format "Invalid color: %S" value)) + widget))) ;;; The Help Echo -- 2.29.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-test-for-the-widget-color-match-function-Bug-458.patch Content-Description: Patch2 >From 19efd50021fd5e415305bd367d7fbf6a001db987 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Tue, 12 Jan 2021 19:19:21 -0300 Subject: [PATCH] Add test for the widget-color-match function (Bug#45829) * test/lisp/wid-edit-tests.el (widget-test-color-match): New test. --- test/lisp/wid-edit-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 17fdfefce8..f843649784 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -322,4 +322,15 @@ widget-test-widget-move (widget-backward 1) (should (string= "Second" (widget-value (widget-at)))))) +(ert-deftest widget-test-color-match () + "Test that the :match function for the color widget works." + (let ((widget (widget-convert 'color))) + (should (widget-apply widget :match "red")) + (should (widget-apply widget :match "#fa3")) + (should (widget-apply widget :match "#ff0000")) + (should (widget-apply widget :match "#111222333")) + (should (widget-apply widget :match "#111122223333")) + (should-not (widget-apply widget :match "someundefinedcolorihope")) + (should-not (widget-apply widget :match "#11223")))) + ;;; wid-edit-tests.el ends here -- 2.29.2 --=-=-=-- From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jan 2021 06:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mauro Aranda Cc: "Basil L. Contovounesios" , 45829@debbugs.gnu.org Received: via spool by 45829-submit@debbugs.gnu.org id=B45829.161103863224255 (code B ref 45829); Tue, 19 Jan 2021 06:44:02 +0000 Received: (at 45829) by debbugs.gnu.org; 19 Jan 2021 06:43:52 +0000 Received: from localhost ([127.0.0.1]:49224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1kk4-0006J9-E7 for submit@debbugs.gnu.org; Tue, 19 Jan 2021 01:43:52 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1kk1-0006Is-WE for 45829@debbugs.gnu.org; Tue, 19 Jan 2021 01:43:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ip4z9FvSeVvBXciDCD7bnnJ3zDrPR1DGgwgOE+cOcfk=; b=uYAQj41vobNDy4/4p36c593rcN c8Mah0WgLJFHuD1Vu7SUBRWIzTrfsK1FDti+IZDaa2NZS2kv+6/H6RdWOLu5tAWEDB5Rnjoe3evfF p8AxxZB8nXZjWQdbNJp00SB4Ndxfvs5tC4tyyeRJ2zYUQ3/c3vmU1BA62Bb/GRWkJqm8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1kjt-0004YB-A5; Tue, 19 Jan 2021 07:43:43 +0100 From: Lars Ingebrigtsen References: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> <5ffe2149.1c69fb81.b9bf6.0d1d@mx.google.com> <87v9bxg7rl.fsf@tcd.ie> <6002d7be.1c69fb81.a7260.b538@mx.google.com> X-Now-Playing: Bobbie Gentry's _The Girl From Chickasaw County (2): The Delta Sweete_: "Big Boss Man" Date: Tue, 19 Jan 2021 07:43:39 +0100 In-Reply-To: <6002d7be.1c69fb81.a7260.b538@mx.google.com> (Mauro Aranda's message of "Sat, 16 Jan 2021 09:10:35 -0300") Message-ID: <87bldlmnok.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Mauro Aranda writes: > * lisp/wid-edit.el (widget-color-match, widget-color-validate): New > functions. > (color): Use the new functions. Base size on longest defined color > name, defaulting to the longest RGB hex string [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mauro Aranda writes: > * lisp/wid-edit.el (widget-color-match, widget-color-validate): New > functions. > (color): Use the new functions. Base size on longest defined color > name, defaulting to the longest RGB hex string. Looks good to me (without actually testing the code). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 15 08:49:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45829: 28.0.50; Some tweaks to the color widget, from wid-edit+.el References: <5ffe1f20.1c69fb81.77469.0e30@mx.google.com> Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jan 2021 12:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: contovob@tcd.ie, 45829@debbugs.gnu.org Received: via spool by 45829-submit@debbugs.gnu.org id=B45829.161105894525032 (code B ref 45829); Tue, 19 Jan 2021 12:23:01 +0000 Received: (at 45829) by debbugs.gnu.org; 19 Jan 2021 12:22:25 +0000 Received: from localhost ([127.0.0.1]:49618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1q1g-0006Vb-HD for submit@debbugs.gnu.org; Tue, 19 Jan 2021 07:22:24 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:44431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1q1d-0006VG-Rx; Tue, 19 Jan 2021 07:22:23 -0500 Received: by mail-qk1-f171.google.com with SMTP id v126so21519282qkd.11; Tue, 19 Jan 2021 04:22:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:to:cc:subject:in-reply-to:date:mime-version; bh=ptoyY1eQSlO8yUWNiTEHHw3ORVlEuOovqrxg78vKA0U=; b=j97Ht8s7LKbKMIuh02Uw3rHyT1McEpzLnfCCVUFK2fG4zwAMfYLZW6pnUvRVlk/JFL hR+qs6vfKfsgwpQo6wANqIkRMFM9ErGEiGjAGQVSfR+fjKs7fzyEdis+JdSfdHUKCQy2 N8hSWg8z6/4c4aqrXtSlxlIF9rS/Cq9XiHa9q2tRqu7tKXoKPhWmpDNZOE2UqvWKXk2V rdMuxQVtHC95GVRtkDx3qPVc/wNGyxY7NkteVMuictpM2Wf1fi/axn1/Hh8cf6+dZQ90 NWnRxwTVS4c5z7+rh5G1YNDaroQAUzHfydGoASDQ8mZNbr5Fm9rPeLEmJi73s2DCRVCo l1Mw== 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:in-reply-to:date :mime-version; bh=ptoyY1eQSlO8yUWNiTEHHw3ORVlEuOovqrxg78vKA0U=; b=ZRTBoUYQ0+PaBx/YMUGn5qoClSA1PMKYZP4BgsLE3mH89xizLYYnhGKO8AsGIOV/tI DtsmIx/codOLfQaV0ahKf2keoBElEeQl05aGaVE+xO3uFr+LYz5qOlBPoS0pjzKZHbCM gNEFC7l5Ose4rJeWiqXgOly47L4Ad8vlWvCxlqG3ZJcWbk7QVpOb3nWWQmjt0BQt5ent dBoJc7vzrXBICYF5J5jxW9ZC1i0YSxy0Taxxu6qon2EZxeRk+PmPO7n3KISIOXaydwo+ hVYqVr2eOAkPDjT+6Bjqx032J5jUvHTEYfEfCDSFgkYRVgIVNLgkju3TNYoLNY9bkf1e JNWQ== X-Gm-Message-State: AOAM532QO6SPDg/Zz4KuOyFrcGBrjgbebuHgLgfhA4O7N8oaxQed4xMJ Xrq5+iE6zMy3xRE28xjB1WFYQWJ04M3gbA== X-Google-Smtp-Source: ABdhPJy4W+K7Ass/B5S2KpT0xzCWVNbhFaFsztIo1TeCNcZlGQANyZ1yiI3FhV8nzMTLFbO0kaAoYA== X-Received: by 2002:a37:64c4:: with SMTP id y187mr3894227qkb.371.1611058935944; Tue, 19 Jan 2021 04:22:15 -0800 (PST) Received: from tbb-desktop ([201.213.132.172]) by smtp.gmail.com with ESMTPSA id 9sm12953500qke.123.2021.01.19.04.22.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jan 2021 04:22:15 -0800 (PST) Message-ID: <6006cef7.1c69fb81.80558.10dc@mx.google.com> X-Google-Original-Message-ID: <87a6t5f764.fsf@maurooaranda@gmail.com> From: Mauro Aranda In-Reply-To: <87bldlmnok.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 19 Jan 2021 07:43:39 +0100) Date: Tue, 19 Jan 2021 09:22:11 -0300 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 45829 fixed close 45829 quit Lars Ingebrigtsen writes:> Mauro Aranda writes: > >> * lisp/wid-edit.el (widget-color-match, widget-color-validate): New >> functions. >> (color): Use the new functions. Base size on longest defined color >> name, defaulting to the longest RGB hex string. > > Looks good to me (without actually testing the code). Thanks; pushed and closing.