diff options
author | Dave Mayo <dave_mayo@harvard.edu> | 2014-08-08 17:38:20 -0400 |
---|---|---|
committer | Dave Mayo <pobocks@gmail.com> | 2014-08-10 15:58:08 -0400 |
commit | bee781f7e31c2f6591239fbb0271c4a96b48ecd6 (patch) | |
tree | a204fbb599e512711778a764255cdd3c280ba14c /src/html-abbrev.el | |
parent | 09c2f6381bb6313d0472cbc77724964e2b554c24 (diff) | |
download | emmet-mode-bee781f7e31c2f6591239fbb0271c4a96b48ecd6.tar.lz emmet-mode-bee781f7e31c2f6591239fbb0271c4a96b48ecd6.tar.xz emmet-mode-bee781f7e31c2f6591239fbb0271c4a96b48ecd6.zip |
Changes to come closer to Emmet support, to allow for better consistency of behavior.
Major changes include:
* Parser is changed to use Emmet's bracket syntax for properties
* now uses point as the right bound of the expression
* searches for left bound from right bound. This is poorly executed as of now
Diffstat (limited to 'src/html-abbrev.el')
-rw-r--r-- | src/html-abbrev.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/html-abbrev.el b/src/html-abbrev.el index 7dbf842..0c5411c 100644 --- a/src/html-abbrev.el +++ b/src/html-abbrev.el @@ -154,7 +154,7 @@ `(tag (,tagname ,has-body? nil)) input)) (let ((tag-data (cadar it)) (input (cdr it))) (emmet-pif (emmet-run - emmet-props + emmet-properties (let ((props (cdr expr))) `((tag ,(append tag-data (list props))) . ,input)) `((tag ,(append tag-data '(nil))) . ,input)) @@ -233,7 +233,7 @@ (defun emmet-tag-props (tag input) (let ((tag-data (cadr tag))) - (emmet-run emmet-props + (emmet-run emmet-properties (let ((props (cdr expr))) `((tag ,(append tag-data (list props))) . ,input)) `((tag ,(append tag-data '(nil))) . ,input)))) @@ -247,7 +247,7 @@ (defun emmet-prop (input) (emmet-parse - " " 1 "space" + " *" 1 "space" (emmet-run emmet-name (let ((name (cdr expr))) @@ -291,6 +291,12 @@ (let ((txt (emmet-split-numbering-expressions (elt it 1)))) `((text ,txt) . ,input)))) +(defun emmet-properties (input) + "A bracketed emmet property expression." + (emmet-parse "\\[\\(.*?\\)\\]" 2 "properties" + `(,(car (emmet-props (elt it 1))) . ,input))) + + (defun emmet-pexpr (input) "A zen coding expression with parentheses around it." (emmet-parse "(" 1 "(" |