Commit graph

82 commits

Author SHA1 Message Date
Simen Heggestøyl
4478cf0ac8 Add will change module to CSS property list
* lisp/textmodes/css-mode.el (css-property-alist)
(css-value-class-alist): Add new property and value class from CSS
Will Change Module.
2016-11-26 11:11:28 +01:00
Simen Heggestøyl
6ddcb0f10f Support completion of classes and IDs in CSS mode
* lisp/textmodes/css-mode.el (css-class-list-function): New variable
holding the function to call for retrieving completions of class
names.
(css-id-list-function): New variable holding the function to call for
retrieving completions of IDs.
(css--foreign-completions): New function for retrieving completions
from other buffers.
(css--complete-selector): Support completing HTML class names and IDs
from other buffers in addition to completing HTML tags.

* lisp/textmodes/sgml-mode.el (html--buffer-classes-cache): New
variable holding a cache for `html-current-buffer-classes'.
(html--buffer-ids-cache): New variable holding a cache for
`html-current-buffer-ids'.
(html-current-buffer-classes): New function returning a list of class
names used in the current buffer.
(html-current-buffer-ids): New function returning a list of IDs used
in the current buffer.
(html-mode): Set `css-class-list-function' and `css-id-list-function'
to `html-current-buffer-classes' and `html-current-buffer-ids'
respectively.
2016-09-24 13:55:36 +02:00
Simen Heggestøyl
09428ffc63 Add "supports" to list of CSS at-rules
* lisp/textmodes/css-mode.el (css-at-ids): Add "supports" at-rule.
2016-08-26 19:16:47 +02:00
Simen Heggestøyl
c0a5ae906d Complete "initial" and "unset" in CSS mode
* lisp/textmodes/css-mode.el (css--complete-property-value): Make
"initial" and "unset" completion candidates for all CSS properties,
just like "inherit".

* test/lisp/textmodes/css-mode-tests.el
(css-test-complete-property-value): Update test to reflect the above
change.
2016-07-06 19:25:10 +02:00
Etienne Prud’homme
162bc021a1 Add completion of colors in CSS mode
* lisp/textmodes/css-mode.el (css-value-class-alist): Add CSS colors
from "CSS Color Module Level 3".

* test/lisp/textmodes/css-mode-tests.el (css-test-property-values):
Update test.
2016-05-22 12:54:02 +02:00
Simen Heggestøyl
d546ed13b0 Support completion of HTML tags in CSS selectors
* lisp/textmodes/css-mode.el (css--html-tags): New variable holding a
list of HTML tags for completion.
(css--nested-selectors-allowed): New variable for determining whether
nested selectors are allowed in the current mode.
(css--complete-selector): New function for completing part of a CSS
selector.
(css-completion-at-point): Support completion of selectors.
(scss-mode): Allow nested selectors.
2016-05-05 21:22:36 +02:00
Simen Heggestøyl
07d729130e Add completion of `calc()' in CSS mode
* lisp/textmodes/css-mode.el (css-value-class-alist): Add `calc()' as
a completion candidate for several value classes.
(css--value-class-lookup): Return only unique results.

* test/lisp/textmodes/css-mode-tests.el
(css-test-property-values-no-duplicates)
(css-test-value-class-lookup): Update to reflect the above changes.
2016-04-26 20:41:04 +02:00
Simen Heggestøyl
e6d6a99455 Don't let `css--property-values' return duplicates
* lisp/textmodes/css-mode.el (css--property-values): Don't return
duplicate values.

* test/lisp/textmodes/css-mode-tests.el (css-test-property-values):
Take the above into account.
(css-test-property-values-no-duplicates): Test that duplicates aren't
returned by `css--property-values'.
2016-04-24 19:58:36 +02:00
Simen Heggestøyl
8e2e252932 Cache results of `css--property-values'
* lisp/textmodes/css-mode.el (css--property-values): Cache computed
values.

* test/lisp/textmodes/css-mode-tests.el (css-test-property-value-cache):
New regression test for the above.
2016-04-24 15:02:05 +02:00
Simen Heggestøyl
0c9f35a9b0 Add "keyframes" to list of CSS at-rules
* lisp/textmodes/css-mode.el (css-at-ids): Add "keyframes" at-rule.
2016-04-20 20:08:56 +02:00
Etienne Prud'homme
728b1c7f13 Support completion of at-rules in SCSS mode
lisp/textmodes/css-mode.el (scss-at-ids): New defconst holding
SCSS-specific at-rules.
(css--at-ids): New buffer-local variable holding the list of at-rules
for the current mode.
(css--complete-at-rule): Retrieve at-rules from `css--at-ids`.
(scss-mode): Set `css--at-ids'.

Copyright-paperwork-exempt: yes
2016-04-05 23:12:11 +02:00
Simen Heggestøyl
750e1e1942 Support completion of bang-rules in CSS mode
lisp/textmodes/css-mode.el (css--bang-ids): New buffer-local variable
holding the list of bang-rules for the current mode.
(css--font-lock-keywords): Retrieve bang-rules from `css--bang-ids'
instead of computing them.
(css--complete-bang-rule): New function for completing a bang-rule.
(css-completion-at-point): Add support for completing bang-rules.
(scss-font-lock-keywords): Change from a variable to a function in
order to recompute `css--font-lock-keywords' when `css--bang-ids' has
changed.
(scss-mode): Set `css--bang-ids' and recompute font-lock keywords.
2016-03-31 21:21:34 +02:00
Simen Heggestøyl
269d5631ab Support completion of attribute values in CSS mode
* lisp/textmodes/css-mode.el (css-property-alist): New defconst
holding CSS identifiers and the values they can have.
(css-property-ids): Compute dynamically from `css-property-alist'.
(css-value-class-alist): New defconst holding property value classes
and their values.
(css--property-value-cache): New variable providing a cache for
`css--property-values'.
(css--value-class-lookup): New function for computing a list of values
in a value class.
(css--property-values): New function for computing a list of possible
values for a CSS property.
(css--complete-property-value): New function for completing a property
value.
(css-completion-at-point): Add support for completing property values.
* test/lisp/textmodes/css-mode-tests.el: New file.
2016-03-23 19:03:47 +01:00
Simen Heggestøyl
fb0959e713 Declare $ as an expression prefix in SCSS
* lisp/textmodes/css-mode.el (scss-mode-syntax-table): Declare $ as an
expression prefix (bug#22841).
2016-02-29 17:06:26 +11:00
Lars Ingebrigtsen
3e2883c4ce Revert "Declare $ as an expression prefix in SCSS"
This reverts commit ffb33264f2.

Revering to fix author name.
2016-02-29 17:05:14 +11:00
Simen
ffb33264f2 Declare $ as an expression prefix in SCSS
* lisp/textmodes/css-mode.el (scss-mode-syntax-table): Declare $ as an
expression prefix (bug#22841).
2016-02-29 17:03:39 +11:00
Simen Heggestøyl
5a0472e8ea Add column layout module to CSS property list
* lisp/textmodes/css-mode.el (css-property-ids): Add properties from
CSS Multi-column Layout Module.
2016-02-16 21:52:59 +01:00
Simen Heggestøyl
ab7583a2b0 Add fragmentation module to CSS property list
* lisp/textmodes/css-mode.el (css-property-ids): Add properties from
CSS Fragmentation Module Level 3.
2016-02-14 20:31:46 +01:00
Simen Heggestøyl
1d07dcd720 Highlight two additional SCSS keywords
* lisp/textmodes/css-mode.el (css-bang-ids): New defconst holding CSS
identifiers on the form !foo.
(scss-bang-ids): New defconst holding SCSS identifiers on the form
!foo.
(css--font-lock-keywords): Highlight the new SCSS bang identifiers in
`font-lock-builtin-face'.

* test/indent/css-mode.css: Add bang rule test case.

* test/indent/scss-mode.css: Add test cases for the introduced bang
rules.
2016-02-01 21:38:25 +01:00
Simen Heggestøyl
2df0e04296 Highlight CSS variables with variable name face
* lisp/textmodes/css-mode.el (css-nmstart-re): Don't match variables.
(css--font-lock-keywords): Highlight variables in
`font-lock-variable-name-face'.
2016-01-30 20:47:18 +01:00
Simen Heggestøyl
dadb841a06 Disallow parenthesis in non-pseudo CSS selectors
* lisp/textmodes/css-mode.el (css--font-lock-keywords): Disallow
parenthesis in selectors except for in the function notation that
might appear right after a pseudo-class.
* test/indent/scss-mode.scss: Add a test for it.
2016-01-14 19:24:03 +01:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Tom Tromey
2ed9de442c set :safe on css-indent-offset
* lisp/textmodes/css-mode.el (css-indent-offset): Add :safe 'integerp.
2015-12-28 13:13:00 -07:00
Simen Heggestøyl
3cd29a5d15 Highlight CSS variable definitions
* lisp/textmodes/css-mode.el (css-nmstart-re): Tweak regexp to accept
CSS variables.  (Bug#21638)
2015-10-07 19:19:42 +02:00
Simen Heggestøyl
d9d2e37658 Add overflow module to CSS property list
* lisp/textmodes/css-mode.el (css-property-ids): Add properties from CSS
Overflow Module Level 3.
2015-09-19 16:25:40 +02:00
Paul Eggert
284c470ef7 Backslash cleanup in Elisp source files
This patch should not change behavior.  It typically omits backslashes
where they are redundant (e.g., in the string literal "^\$").
In a few places, insert backslashes where they make regular
expressions clearer: e.g., replace "^\*" (equivalent to "^*") with
"^\\*", which has the same effect as a regular expression.
Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs,
and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with
RCS IDs, as that makes it clearer that the backslash is intended.
2015-09-17 16:09:39 -07:00
Simen Heggestøyl
c6af816aff Fix indentation rule in css-mode
* lisp/textmodes/css-mode.el (css-smie-rules): Fix indentation of
brackets in presence of pseudo-selectors.  (Bug#21328)
2015-08-28 19:36:10 +02:00
Simen Heggestøyl
7372c1ab06 Handle comments inside unquoted URIs in css-mode
* lisp/textmodes/css-mode.el (css--uri-re): New defconst.
(css-syntax-propertize-function): New defconst.
(css--font-lock-keywords): Handle parens around unquoted URIs.
(css-mode): Set `syntax-propertize-function'.
2015-08-22 19:13:10 +02:00
Simen Heggestøyl
1dee790fc1 css-mode.el: Support multi-line comment filling
Fixes: debbugs:20256

* lisp/textmodes/css-mode.el (css-fill-paragraph): Support multi-line
comment filling.
(css-adaptive-fill): New function.
(css-mode): Set `adaptive-fill-function'.
(scss-mode): Set `comment-continue'.
2015-04-18 20:25:40 +02:00
Simen Heggestøyl
e597344849 css-mode.el: Add "not" pseudo-class
Fixes: debbugs:20267

* textmodes/css-mode.el (css-pseudo-class-ids): Add "not" to list
of CSS pseudo-classes.
2015-04-09 21:01:02 +02:00
Stefan Monnier
6083965958 css-mode.el (css-smie-rules): Fix indentation after complex selectors
Fixes: debbugs:20282

* lisp/textmodes/css-mode.el (css-smie-rules): Don't get confused by
inner structure of selectors.
2015-04-09 10:51:23 -04:00
Simen Heggestøyl
f21d9b6e44 Derive css-mode' from prog-mode'
* textmodes/css-mode.el (css-mode): Derive from `prog-mode'.
2015-03-31 19:55:52 +02:00
Paul Eggert
f9e354ebea Spelling and wording fixes 2015-03-17 17:11:14 -07:00
Simen Heggestøyl
7ec63a3afa Update CSS property list
* textmodes/css-mode.el (css-extract-keyword-list): Remove function in
favor of manual extraction.
(css-extract-parse-val-grammar): Remove function in favor of
manual extraction.
(css-extract-props-and-vals): Remove function in favor of manual
extraction.
(css-at-ids): Update list of CSS at-rule ids.
(css-property-ids): Update list of CSS properties.
2015-03-17 23:11:55 +01:00
Simen Heggestøyl
62fde9ee0f Add support for completion in `css-mode'
* textmodes/css-mode.el (css--complete-property): New function for
completing CSS properties.
(css--complete-pseudo-element-or-class): New function for
completing CSS pseudo-elements and pseudo-classes.
(css--complete-at-rule): New function for completing CSS at-rules.
(css-completion-at-point): New function providing completion for
`css-mode'.
(css-mode): Add support for completion.
2015-03-17 22:58:13 +01:00
Simen Heggestøyl
64db0c26fa Discriminate between pseudo-classes and -elements
* textmodes/css-mode.el (css--font-lock-keywords): Discriminate
between pseudo-classes and pseudo-elements.
(css-pseudo-ids): Remove.
(css-pseudo-class-ids): New variable.
(css-pseudo-element-ids): New variable.
2015-03-17 22:50:10 +01:00
Simen Heggestøyl
42c99697b6 Fixes: debbugs:19815
* lisp/textmodes/css-mode.el (css-smie-rules): Fix paren indent.
2015-02-09 12:26:14 -05:00
Simen Heggestøyl
6b1d71150b * lisp/textmodes/css-mode.el: Handle hyphenated vars
Fixes: debbugs:19263

* lisp/textmodes/css-mode.el (scss-smie--not-interpolation-p): Vars can be
hyphenated.
2015-02-05 15:35:36 -05:00
Simen Heggestøyl
8c80eb4817 * lisp/textmodes/css-mode.el: Handle variable interpolation
Fixes: debbugs:19751

* lisp/textmodes/css-mode.el (css-fill-paragraph): Fix filling in presence
of variable interpolation.
2015-02-05 15:29:54 -05:00
Simen Heggestøyl
935fa6151b * lisp/textmodes/css-mode.el (scss-mode): Fix typo.
Fixes: debbugs:19446
2015-01-01 11:19:02 -05:00
Stefan Monnier
bc0e9e47b6 * lisp/textmodes/css-mode.el (scss-mode): New major-mode.
(css-mode-syntax-table): Use d style comment, to ease the scss case.
(css-ident-re): Allow things like @-moz-keyframes.
(scss--hash-re): New const.
(css--font-lock-keywords): New function, extracted from
css-font-lock-keywords.
(css-font-lock-keywords): Use it.
(scss-mode-syntax-table, scss-font-lock-keywords): New vars.
(scss-smie--not-interpolation-p): New function.
(css-smie--forward-token, css-smie--backward-token): Use it.
(css-mode): Remove left-over code.
* test/indent/scss-mode.scss: New file.
* test/indent/css-mode.css: Add a few uneventful examples.
2014-10-20 12:36:34 -04:00
Juanma Barranquero
d939cbea79 lisp/textmodes/css-mode.el: Fix typo in comment. 2014-03-16 04:48:56 +01:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Stefan Monnier
bdc6b4c8f6 * lisp/textmodes/css-mode.el (css-smie-rules): Fix indentation.
(css-mode): Use electric-indent-chars.

Fixes: debbugs:15467
2013-10-07 11:40:24 -04:00
Stefan Monnier
a27c1b72c5 * lisp/textmodes/css-mode.el (css-smie-rules): Toplevel's a list.
* test/automated/completion-tests.el:
* test/indent/css-mode.css: New files.

Fixes: debbugs:15467
2013-10-04 17:45:37 -04:00
Stefan Monnier
112798c18d * lisp/textmodes/css-mode.el: Use SMIE.
(css-smie-grammar): New var.
(css-smie--forward-token, css-smie--backward-token)
(css-smie-rules): New functions.
(css-mode): Use them.
(css-navigation-syntax-table): Remove var.
(css-backward-sexp, css-forward-sexp, css-indent-calculate-virtual)
(css-indent-calculate, css-indent-line): Remove functions.
2013-08-29 17:00:18 -04:00
Paul Eggert
0877d0dc24 Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca 2013-01-02 08:13:04 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Jari Aalto
f38cd76e55 Add `add-log-current-defun-function's for CSS and HTML mode.
* textmodes/css-mode.el (css-current-defun-name): New function.
(css-mode): Use it.

* textmodes/sgml-mode.el (html-current-defun-name): New function.
(html-mode): Use it.
2012-12-01 13:51:33 +08:00
Chong Yidong
92eadba57f Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00