Skip to content

Commit

Permalink
Add PR #102 changes into src/
Browse files Browse the repository at this point in the history
  • Loading branch information
15cm committed Sep 23, 2019
1 parent 690c439 commit 5493751
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
10 changes: 8 additions & 2 deletions emmet-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ NOTE: only \" /\", \"/\" and \"\" are valid."
e. g. without semicolons")
(make-variable-buffer-local 'emmet-use-sass-syntax)


(defvar emmet-css-major-modes
'(css-mode
scss-mode
Expand All @@ -251,6 +250,13 @@ e. g. without semicolons")
'(rjsx-mode
typescript-tsx-mode))

(defvar emmet-fallback-filter '("html")
"Fallback filter for `emmet-default-filter', if none is found.")

(defvar emmet-file-filter nil
"File local filter used by `emmet-default-filter'.")
(make-variable-buffer-local 'emmet-file-filter)

(defun emmet-transform (input)
(if (or (emmet-detect-style-tag-and-attr) emmet-use-css-transform)
(emmet-css-transform input)
Expand Down Expand Up @@ -4129,7 +4135,7 @@ tbl))
(emmet-join-string
(mapcar
#'(lambda (expr)
(let*
(let*
((hash-map (if emmet-use-sass-syntax emmet-sass-snippets emmet-css-snippets))
(basement
(emmet-aif
Expand Down
22 changes: 12 additions & 10 deletions src/html-abbrev.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@

(defun emmet-default-filter ()
"Default filter(s) to be used if none is specified."
(let* ((file-ext (car (emmet-regex ".*\\(\\..*\\)" (or (buffer-file-name) "") 1)))
(defaults '(".html" ("html")
".htm" ("html")
".haml" ("haml")
".clj" ("hic")))
(default-else '("html"))
(selected-default (member file-ext defaults)))
(if selected-default
(cadr selected-default)
default-else)))
(or emmet-file-filter
(let* ((file-ext (car (emmet-regex ".*\\(\\..*\\)" (or (buffer-file-name) "") 1)))
(defaults '(".html" ("html")
".htm" ("html")
".haml" ("haml")
".clj" ("hic")
".cljs" ("hic")))
(default-else emmet-fallback-filter)
(selected-default (member file-ext defaults)))
(if selected-default
(cadr selected-default)
default-else))))

(defun emmet-numbering (input)
(emmet-parse
Expand Down
8 changes: 7 additions & 1 deletion src/mode-def.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ NOTE: only \" /\", \"/\" and \"\" are valid."
e. g. without semicolons")
(make-variable-buffer-local 'emmet-use-sass-syntax)


(defvar emmet-css-major-modes
'(css-mode
scss-mode
Expand All @@ -95,6 +94,13 @@ e. g. without semicolons")
'(rjsx-mode
typescript-tsx-mode))

(defvar emmet-fallback-filter '("html")
"Fallback filter for `emmet-default-filter', if none is found.")

(defvar emmet-file-filter nil
"File local filter used by `emmet-default-filter'.")
(make-variable-buffer-local 'emmet-file-filter)

(defun emmet-transform (input)
(if (or (emmet-detect-style-tag-and-attr) emmet-use-css-transform)
(emmet-css-transform input)
Expand Down

0 comments on commit 5493751

Please sign in to comment.