From bee781f7e31c2f6591239fbb0271c4a96b48ecd6 Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Fri, 8 Aug 2014 17:38:20 -0400 Subject: 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 --- src/html-abbrev.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/html-abbrev.el') 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 "(" -- cgit v1.2.3