bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22923: [PATCH] Support completion of attribute values in CSS mode


From: Simen Heggestøyl
Subject: bug#22923: [PATCH] Support completion of attribute values in CSS mode
Date: Sun, 06 Mar 2016 14:53:52 +0100

Hello!

I've finally gotten around to implement property value completion in
CSS mode. I've been using the attached patch privately for some weeks
now, and it seems to me that it works well.

The code has taken much inspiration from company-css.el, but there are
some differences:

- Completion lists for many new properties have been added, and a few
  have been removed (most of them from the obsoleted marquee
  module [1]).

- I've manually updated all completion lists according to the CSS spec
  and fixed some bugs in the existing lists along the way. In general
  I've tried to stay as close as possible to the grammar described in
  the CSS spec wrt. names and order of the values and classes.

- The new `css--property-values' function is very similar to
  `company-css-property-values', but it has been updated to support
  following completion candidates further from the value class
  completion lists.

- Completion a function name will no longer put commas between the
  parenthesis. My reason for this is that many CSS functions take a
  variable number of arguments. For instance, the `translate' function
  is completed by company-css to `translate(,)', but `translate' can
  take only one argument too, so the completion is misleading. Also,
  there are functions that support an arbitrary number of
  arguments. Instead of trying to support this, I've made every
  function name complete to just `function()'. I think having ElDoc
  support for CSS functions would be good for making it easier to
  remember which arguments functions take.

- `inherit' has been added as a completion candidate for every
  property.

Please have a look at the patch and tell me what you think!

-- Simen


[1] https://www.w3.org/TR/css3-marquee/

Attachment: 0001-Support-completion-of-attribute-values-in-CSS-mode.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]