From e47b30a56de5fee21a029c5e9d168be744949d92 Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Sun, 10 Aug 2014 18:18:51 -0400 Subject: Uses backward-char and less selective stop-words. Seems to basically work in all cases I have managed to test. --- src/mode-def.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mode-def.el b/src/mode-def.el index cef6151..6d7aebc 100644 --- a/src/mode-def.el +++ b/src/mode-def.el @@ -20,11 +20,14 @@ (save-excursion (save-match-data (let ((char (char-before))) (while char - (cond ((member char '(?\} ?\] ?\))) (backward-sexp) (setq char (char-before))) - ((member char '(?\/ ?\<)) (search-forward ">") (setq char nil)) - ((not (string-match-p "[[:space:]\"';\n]" (string char))) - (backward-word) (setq char (char-before))) - (t (setq char nil)))) + (cond ((member char '(?\} ?\] ?\))) + (backward-sexp) (setq char (char-before))) + ((member char '(?\<)) + (search-forward ">") (setq char nil)) + ((not (string-match-p "[[:space:]\n]" (string char))) + (backward-char) (setq char (char-before))) + (t + (setq char nil)))) (point))))) (defcustom emmet-indentation 4 @@ -89,7 +92,7 @@ For more information see `emmet-mode'." (+ (- p (length output-markup)) (emmet-html-next-insert-point output-markup))))))))))))) -(defvar emmet-mode-keymap +(defvar emmet-mode-keymap (let ((map (make-sparse-keymap))) (define-key map (kbd "C-j") 'emmet-expand-line) @@ -376,7 +379,7 @@ accept it or skip it." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun emmet-go-to-edit-point (count) - (let + (let ((buf (buffer-string)) (point (point)) (edit-point "\\(\\(><\\)\\|\\(^[[:blank:]]+$\\)\\|\\(=\\(\"\\|'\\)\\{2\\}\\)\\)")) @@ -394,8 +397,8 @@ accept it or skip it." (backward-char)))) (progn (backward-char) - (let - ((search-result (re-search-backward edit-point nil t (- count)))) + (let + ((search-result (re-search-backward edit-point nil t (- count)))) (if search-result (progn (cond -- cgit v1.2.3