From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Etienne Prud'homme Newsgroups: gmane.emacs.bugs Subject: bug#23383: [PATCH] Support completion of color functions in CSS mode Date: Fri, 20 May 2016 15:37:28 -0400 Message-ID: <20160520153728.612ac2bd@thinkpax> References: <20160426184852.391f744d@ThinkPax> <1461784618.2119.2@smtp.gmail.com> <20160427201745.09dd0967@ThinkPax> <1461865897.9211.0@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/TptRt3N6XE4GhSjbKZUX4/V" X-Trace: ger.gmane.org 1463774030 16704 80.91.229.3 (20 May 2016 19:53:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 19:53:50 +0000 (UTC) Cc: 23383@debbugs.gnu.org To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 20 21:53:38 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3qFS-00024s-Qj for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 May 2016 21:38:15 +0200 Original-Received: from localhost ([::1]:56133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3qFR-0000O1-Sr for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 May 2016 15:38:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3qFL-0000Ng-Md for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 15:38:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3qFG-0000ZA-KD for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 15:38:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3qFG-0000Yv-G7 for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 15:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b3qFG-0000YC-BP for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 15:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Etienne Prud'homme Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 May 2016 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23383-submit@debbugs.gnu.org id=B23383.14637730582082 (code B ref 23383); Fri, 20 May 2016 19:38:02 +0000 Original-Received: (at 23383) by debbugs.gnu.org; 20 May 2016 19:37:38 +0000 Original-Received: from localhost ([127.0.0.1]:59349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3qEs-0000XW-83 for submit@debbugs.gnu.org; Fri, 20 May 2016 15:37:38 -0400 Original-Received: from mail-qk0-f174.google.com ([209.85.220.174]:36254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3qEq-0000XJ-IP for 23383@debbugs.gnu.org; Fri, 20 May 2016 15:37:37 -0400 Original-Received: by mail-qk0-f174.google.com with SMTP id x7so72863274qkd.3 for <23383@debbugs.gnu.org>; Fri, 20 May 2016 12:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=DK7spjmjiUJ/OCwAa06poUzeVRxn4U0uLpWlcnyOQas=; b=S0P274ASkWDi0R+SywaMZxPykqFTFaZuKAwsZsvXKaNMVc1XaHgcWJ/GMJa/OLBIAJ gKVB26yudb/tTVVbcPQug6ksfeCDUDo0zwJpib+PFPr4sHwnnwodVm1LmP6CNrYfBe0H IjfsEVQ62SZ47JrFPUWYyqfSC1ZL5FDkzLIBFXshE+fZ2d7B240JM4IyxnGlG74a6MXb th2eGKZyhlD008ZLDaJRoe3Z3Cn6FXI0s2u3xzMvKYSzGYc1661GIYoBNhd8IDOwUuEE oGS3Beid9pbcpfT2526O0zvHcbTUVITxSqjs3HtRUK53ZAh+KGvhoIyGq1n2yPv+dRTn rrfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=DK7spjmjiUJ/OCwAa06poUzeVRxn4U0uLpWlcnyOQas=; b=jtx2T40HOeMm5XH+3hZZ6J/u1NE1Itmks6/idJ0lQoDyeuC2NjJaXbH+4DbGBFtZ8j iCh/1vzlMJoF+YkmuLocZM3haSahIvsjn5KIEBsx2dtitwrkiPnp3q5sMCMLBpxP1fqV mKk4kPes98XfkFPHs2+i9oDA6EiGBG/YskQxPG595WXiyWtwdBYgoiA3fvSdV5xkAZ7h Dp8Z/p5az+waAYBqcIKc3nj1jJMgG2CG3V43Wxp9zvK7hEIvz4dDxscVifk5VYHiSufi 5hDWyprnlGP7fKMid/JxOWn6P67oureHK/b1j+grXKq9UZiHuwyEKRzKj239fvXTAm3J gWWw== X-Gm-Message-State: AOPr4FX+0S5CZhfObZxTujQGkF+dQU4UapZen0vE70uEkU6sBsFsfQ+ZQhLiFS0RWaVFMA== X-Received: by 10.55.82.195 with SMTP id g186mr5486092qkb.47.1463773050990; Fri, 20 May 2016 12:37:30 -0700 (PDT) Original-Received: from thinkpax (modemcable048.82-20-96.mc.videotron.ca. [96.20.82.48]) by smtp.gmail.com with ESMTPSA id a123sm9439922qkc.23.2016.05.20.12.37.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 12:37:30 -0700 (PDT) In-Reply-To: <1461865897.9211.0@smtp.gmail.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118499 Archived-At: --MP_/TptRt3N6XE4GhSjbKZUX4/V Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline I've attached the current patch. > - I think we should stick to the current CSS Color Module Level 3 > recommendation [1]. The functions apart from `rgb()', `rgba()', > `hsl()', and `hsla()' are only present in an Editor's Draft. I find > no other resources about them, so I don't think we should include them > until the new spec becomes at least a Candidate Recommendation. Thanks. I didn't realize the high probability most of them won't be in the recommendation > - I think there's little use in completing `#' since it's only one > character. I was also thinking the same thing. I interpreted: "and so on, then `hex-color'" too literally. > - `namedColor' must be changed to `named-color' to match the name of > the value class. Thanks for pointing that out. > - The new color names need to be double-checked. For instance I see > that `limegreen' has become `limeg een' and `salmon' has become `sa > mon'. I made the list with a macro. I was too tired to double check 140 colors. The current list was generated from Dough Crockford's color list [1] using: | var list = ""; | for(var i=0, len=colors.length; i - The test `css-test-property-values' in > test/lisp/textmodes/css-mode-tests.el needs a small update. I updated the list length to 147 since there's 141 namedColors and 6 values in color. However, I can't make the test execute since my Git repository is broken and the remote doesn't work as of now. Thanks for your patience. [1] http://www.crockford.com/wrrrld/color.html [2] https://en.wikipedia.org/wiki/IIFE Etienne --MP_/TptRt3N6XE4GhSjbKZUX4/V Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Add-completion-of-colors-in-CSS-mode.patch >From 3e000ab30b3c6a4cd8cc1f76bd98c5f7c5aa0c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Etienne=20Prud=E2=80=99homme?= Date: Wed, 27 Apr 2016 19:52:28 -0400 Subject: [PATCH] Add completion of colors in CSS mode * lisp/textmodes/css-mode.el (css-value-class-alist): Add CSS colors candidates from "CSS Color Module Level 4". --- lisp/textmodes/css-mode.el | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index e30fb3e..3b795fd 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -460,10 +460,9 @@ css-value-class-alist (bg-layer bg-image position repeat-style attachment box) (bg-size length percentage "auto" "cover" "contain") (box "border-box" "padding-box" "content-box") - (color - "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" - "navy" "olive" "orange" "purple" "red" "silver" "teal" "white" - "yellow" "transparent") + (color "rgb()" "rgba()" "hsl()" "hsla()" "hwb()" "gray()" "lab()" + "lch()" "device-cmyk()" "color-mod()" "#" namedColor + "transparent" "currentColor") (common-lig-values "common-ligatures" "no-common-ligatures") (contextual-alt-values "contextual" "no-contextual") (counter "counter()" "counters()") @@ -502,6 +501,37 @@ css-value-class-alist (line-width length "thin" "medium" "thick") (linear-gradient "linear-gradient()") (margin-width "auto" length percentage) + (named-color + "aliceblue" "antiquewhite" "aqua" "aquamarine" "azure" "beige" + "bisque" "black" "blanchedalmond" "blue" "blueviolet" "brown" + "burlywood" "cadetblue" "chartreuse" "chocolate" "coral" + "cornflowerblue" "cornsilk" "crimson" "cyan" "darkblue" + "darkcyan" "darkgoldenrod" "darkgray" "darkgreen" "darkgrey" + "darkkhaki" "darkmagenta" "darkolivegreen" "darkorange" + "darkorchid" "darkred" "darksalmon" "darkseagreen" + "darkslateblue" "darkslategray" "darkslategrey" "darkturquoise" + "darkviolet" "deeppink" "deepskyblue" "dimgray" "dimgrey" + "dodgerblue" "firebrick" "floralwhite" "forestgreen" "fuchsia" + "gainsboro" "ghostwhite" "gold" "goldenrod" "gray" "green" + "greenyellow" "grey" "honeydew" "hotpink" "indianred" "indigo" + "ivory" "khaki" "lavender" "lavenderblush" "lawn reen" + "lemonchiffon" "lightblue" "lightcoral" "lightcyan" + "lightgoldenrodyellow" "lightgray" "lightgreen" "lightgrey" + "lightpi k" "lightsalmon" "lightseagreen" "lightskyblue" + "lightslategray" "lightslategrey" "lightsteelblue" "lightyellow" + "lime" "limeg een" "linen" "magenta" "maroon" "mediumaquamarine" + "mediumblue" "mediumorchid" "mediumpurple" "mediumseagreen" + "mediumslateblu " "mediumspringgreen" "mediumturquoise" + "mediumvioletred" "midnightblue" "mintcream" "mistyrose" + "moccasin" "navajowhite" "nav " "oldlace" "olive" "olivedrab" + "orange" "orangered" "orchid" "palegoldenrod" "palegreen" + "paleturquoise" "palevioletred" "pap yawhip" "peachpuff" "peru" + "pink" "plum" "powderblue" "purple" "rebeccapurple" "red" + "rosybrown" "royalblue" "saddlebrown" "sa mon" "sandybrown" + "seagreen" "seashell" "sienna" "silver" "skyblue" "slateblue" + "slategray" "slategrey" "snow" "springgreen" " teelblue" "tan" + "teal" "thistle" "tomato" "turquoise" "violet" "wheat" "white" + "whitesmoke" "yellow" "yellowgreen") (number "calc()") (numeric-figure-values "lining-nums" "oldstyle-nums") (numeric-fraction-values "diagonal-fractions" "stacked-fractions") -- 2.8.1 --MP_/TptRt3N6XE4GhSjbKZUX4/V--