diff --git a/elpa/ac-html-20151005.731/ac-haml.el b/elpa/ac-html-20151005.731/ac-haml.el deleted file mode 100644 index d5385a4..0000000 --- a/elpa/ac-html-20151005.731/ac-haml.el +++ /dev/null @@ -1,103 +0,0 @@ -;;; ac-haml.el --- auto complete source for html tag and attributes - -;; Copyright (C) 2014 - 2015 Zhang Kai Yu - -;; Author: Zhang Kai Yu -;; Keywords: html, auto-complete, rails, ruby - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration: - -;; - -;;; Code: - -(require 'ac-html-core) -(require 'ac-slim) ;; haml and slim share some common things - -(defun ac-haml-attr-prefix () - (if (or (ac-slim-inside-ruby-code) - (ac-slim-inside-non-slim-block)) - nil - (save-restriction - (save-excursion - (narrow-to-region - (line-beginning-position) (line-end-position)) - (let ((origin (point)) (right nil) (left nil) (thing nil)) - ;; Go to next whitespace or line end - (re-search-forward "\\( \\|$\\)" nil t) - (if (equal (char-before) ? ) - (backward-char)) - (setq right (point)) - (goto-char origin) - ;; Go to previous whitespace or line beginning - (re-search-backward "\\( \\|^\\)" nil t) - (if (equal (char-after) ? ) - (forward-char)) - (setq left (point)) - ;; Figure out what at point - (setq thing (buffer-substring-no-properties left right)) - (if (string= (substring thing 0 1) ":") - (1+ left) - nil)))))) - -(defun ac-haml-attrv-prefix () - (if (re-search-backward "\\w+ *=[>]? *[\"]\\([^\"]+[ ]\\|\\)\\(.*\\)" nil t) - (match-beginning 2))) - -(defun ac-haml-class-prefix () - (ac-slim-class-prefix)) - -(defun ac-haml-id-prefix () - (ac-slim-id-prefix)) - -(defun ac-haml-current-tag () - "Return current haml tag user is typing on." - (save-excursion - (save-match-data - (re-search-backward "^[\t ]*%\\(\\w+\\)" nil t) - (match-string 1)))) - -(defun ac-haml-current-tag () - "Return current haml tag user is typing on." - (let* ((line (buffer-substring-no-properties (line-beginning-position) - (line-end-position))) - (match-result (s-match "^[\t ]*%\\(\\w+\\)" line))) - (if match-result - (nth 1 match-result) - "div"))) - -(defun ac-haml-current-attr () - "Return current html tag's attribute user is typing on." - (save-excursion (re-search-backward "[^a-z-]\\([a-z-]+\\) *=" nil t)) - (match-string 1)) - -(defun ac-haml-attrv-prefix () - (if (re-search-backward "\\w+ *=[>]? *[\"]\\([^\"]+[ ]\\|\\)\\(.*\\)" nil t) - (match-beginning 2))) - -(ac-html-define-ac-source "haml" - :tag-prefix "^[ \t]*%\\(.*\\)" - :attr-prefix ac-haml-attr-prefix - :attrv-prefix ac-haml-attrv-prefix - :class-prefix ac-haml-class-prefix - :id-prefix ac-haml-id-prefix - :current-tag-func ac-haml-current-tag - :current-attr-func ac-haml-current-attr) - -(provide 'ac-haml) -;;; ac-haml.el ends here diff --git a/elpa/ac-html-20151005.731/ac-haml.elc b/elpa/ac-html-20151005.731/ac-haml.elc deleted file mode 100644 index 4c37545..0000000 Binary files a/elpa/ac-html-20151005.731/ac-haml.elc and /dev/null differ diff --git a/elpa/ac-html-20151005.731/ac-html-autoloads.el b/elpa/ac-html-20151005.731/ac-html-autoloads.el deleted file mode 100644 index 78fc1a2..0000000 --- a/elpa/ac-html-20151005.731/ac-html-autoloads.el +++ /dev/null @@ -1,90 +0,0 @@ -;;; ac-html-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - - -;;;### (autoloads nil "ac-haml" "ac-haml.el" (0 0 0 0)) -;;; Generated autoloads from ac-haml.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-haml" '("ac-haml-"))) - -;;;*** - -;;;### (autoloads nil "ac-html" "ac-html.el" (0 0 0 0)) -;;; Generated autoloads from ac-html.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-html" '("ac-html-"))) - -;;;*** - -;;;### (autoloads nil "ac-html-core" "ac-html-core.el" (0 0 0 0)) -;;; Generated autoloads from ac-html-core.el - -(autoload 'ac-html-define-data-provider "ac-html-core" "\ -Define ac-html data provider with this macro. -This macro is buggy and cannot be used now. - -\(fn PROVIDER &rest PAIRS)" nil t) - -(function-put 'ac-html-define-data-provider 'lisp-indent-function '1) - -(autoload 'ac-html-enable-data-provider "ac-html-core" "\ -Enable data provider PROVIDER. - -\(fn PROVIDER)" nil nil) - -(autoload 'ac-html-define-ac-source "ac-html-core" "\ -Define ac-html lang with this macro. - -\(fn LANG &rest PAIRS)" nil t) - -(function-put 'ac-html-define-ac-source 'lisp-indent-function '1) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-html-core" '("ac-html-"))) - -;;;*** - -;;;### (autoloads nil "ac-html-default-data-provider" "ac-html-default-data-provider.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from ac-html-default-data-provider.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-html-default-data-provider" '("ac-html-" "web-completion-data-"))) - -;;;*** - -;;;### (autoloads nil "ac-html-testing-data-provider" "ac-html-testing-data-provider.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from ac-html-testing-data-provider.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-html-testing-data-provider" '("ac-html-testing-"))) - -;;;*** - -;;;### (autoloads nil "ac-jade" "ac-jade.el" (0 0 0 0)) -;;; Generated autoloads from ac-jade.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-jade" '("ac-jade-"))) - -;;;*** - -;;;### (autoloads nil "ac-slim" "ac-slim.el" (0 0 0 0)) -;;; Generated autoloads from ac-slim.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ac-slim" '("ac-slim-"))) - -;;;*** - -;;;### (autoloads nil nil ("ac-html-pkg.el") (0 0 0 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; ac-html-autoloads.el ends here diff --git a/elpa/ac-html-20151005.731/ac-html-core.el b/elpa/ac-html-20151005.731/ac-html-core.el deleted file mode 100644 index 275a3b6..0000000 --- a/elpa/ac-html-20151005.731/ac-html-core.el +++ /dev/null @@ -1,263 +0,0 @@ -;;; ac-html-core.el --- auto complete html core -*- lexical-binding: t; -*- - -;; Copyright (C) 2015 Zhang Kai Yu - -;; Author: Zhang Kai Yu - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; - -;;; Code: - -(require 'auto-complete) -(require 'cl-lib) -(require 'dash) - -;;; Customization - -(defgroup auto-complete-html nil - "HTML Auto Complete." - :group 'auto-complete - :prefix "ac-html-") - -;;; Variables - -(defvar ac-html-data-providers nil "Completion data providers.") - -(defvar-local ac-html-enabled-data-providers nil - "The enabled data providers of current buffer.") - -(defvar-local ac-html-current-tag-function nil - "The function to find current tag.") - -(defvar-local ac-html-current-attr-function nil - "The function to find current attr.") - -;;; Provider - -;;;###autoload -(defmacro ac-html-define-data-provider (provider &rest pairs) - "Define ac-html data provider with this macro. -This macro is buggy and cannot be used now." - (declare (indent 1) (debug t)) - (let (tag-func attr-func attrv-func id-func class-func tag-doc-func - attr-doc-func attrv-doc-func id-doc-func class-doc-func) - (let (label value) - (while (not (= 0 (length pairs))) - (setq label (pop pairs)) - (setq value (pop pairs)) - (and (equal :tag-func label) (setq tag-func value)) - (and (equal :attr-func label) (setq attr-func value)) - (and (equal :attrv-func label) (setq attrv-func value)) - (and (equal :id-func label) (setq id-func value)) - (and (equal :class-func label) (setq class-func value)) - (and (equal :tag-doc-func label) (setq tag-doc-func value)) - (and (equal :attr-doc-func label) (setq attr-doc-func value)) - (and (equal :attrv-doc-func label) (setq attrv-doc-func value)) - (and (equal :id-doc-func label) (setq id-doc-func value)) - (and (equal :class-doc-func label) (setq class-doc-func value)))) - `(progn - (add-to-list 'ac-html-data-providers ,provider) - (put ,provider :tag-func ,tag-func) - (put ,provider :attr-func ,attr-func) - (put ,provider :attrv-func ,attrv-func) - (put ,provider :id-func ,id-func) - (put ,provider :class-func ,class-func) - (put ,provider :tag-doc-func ,tag-doc-func) - (put ,provider :attr-doc-func ,attr-doc-func) - (put ,provider :attrv-doc-func ,attrv-doc-func) - (put ,provider :id-doc-func ,id-doc-func) - (put ,provider :class-doc-func ,class-doc-func)))) - -;;;###autoload -(defun ac-html-enable-data-provider (provider) - "Enable data provider PROVIDER." - (add-to-list 'ac-html-enabled-data-providers provider)) - -(defun ac-html-query-data-provider (provider key) - (get provider key)) - -;;; Language (Adaptor) - -;;;###autoload -(defmacro ac-html-define-ac-source (lang &rest pairs) - "Define ac-html lang with this macro." - (declare (indent 1) (debug t)) - (let (tag-prefix attr-prefix attrv-prefix id-prefix class-prefix - current-tag-func current-attr-func) - (let (label value) - (while (not (= 0 (length pairs))) - (setq label (pop pairs)) - (setq value (pop pairs)) - (and (equal :tag-prefix label) (setq tag-prefix value)) - (and (equal :attr-prefix label) (setq attr-prefix value)) - (and (equal :attrv-prefix label) (setq attrv-prefix value)) - (and (equal :id-prefix label) (setq id-prefix value)) - (and (equal :class-prefix label) (setq class-prefix value)) - (and (equal :current-tag-func label) (setq current-tag-func value)) - (and (equal :current-attr-func label) (setq current-attr-func value)))) - - `(progn - (defun ,(intern (format "ac-%s-setup" lang)) () - ,(format "Setup for ac-html to provide completion for %s language." lang) - (setq ac-html-current-tag-function (quote ,current-tag-func)) - (setq ac-html-current-attr-function (quote ,current-attr-func))) - ,(if tag-prefix - `(ac-define-source ,(format "%s-%s" lang "tag") - '((candidates . ac-html-all-tag-candidates) - (prefix . ,tag-prefix) - (document . ac-html-tag-documentation) - (symbol . "t")))) - ,(if attr-prefix - `(ac-define-source ,(format "%s-%s" lang "attr") - '((candidates . ac-html-all-attr-candidates) - (prefix . ,attr-prefix) - (document . ac-html-attr-documentation) - (symbol . "a")))) - ,(if attrv-prefix - `(ac-define-source ,(format "%s-%s" lang "attrv") - '((candidates . ac-html-all-attrv-candidates) - (prefix . ,attrv-prefix) - (document . ac-html-attrv-documentation) - (symbol . "v")))) - ,(if id-prefix - `(ac-define-source ,(format "%s-%s" lang "id") - '((candidates . ac-html-all-id-candidates) - (prefix . ,id-prefix) - (document . ac-html-id-documentation) - (symbol . "i")))) - ,(if class-prefix - `(ac-define-source ,(format "%s-%s" lang "class") - '((candidates . ac-html-all-class-candidates) - (prefix . ,class-prefix) - (document . ac-html-class-documentation) - (symbol . "c")))) - ))) - -;;; Data - -(defun ac-html-all-tag-candidates () - "All tag candidates get from data providers." - (let (list func) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :tag-func)) - (if func (setq list (-concat list (funcall func))))) - list)) - -(defun ac-html-all-attr-candidates () - "All attr candidates get from data providers." - (let (list func tag) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :attr-func)) - (setq tag (funcall ac-html-current-tag-function)) - (if func (setq list (-concat list (funcall func tag))))) - list)) - -(defun ac-html-all-attrv-candidates () - "All attrv candidates get from data providers." - (let (list func tag attr) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :attrv-func)) - (setq tag (funcall ac-html-current-tag-function)) - (setq attr (funcall ac-html-current-attr-function)) - (if func (setq list (-concat list (funcall func tag attr))))) - (if (string= attr "class") - (setq list (-concat list (ac-html-all-class-candidates)))) - (if (string= attr "id") - (setq list (-concat list (ac-html-all-id-candidates)))) - list)) - -(defun ac-html-all-id-candidates () - "" - (let (list func) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :id-func)) - (if func (setq list (-concat list (funcall func))))) - list)) - -(defun ac-html-all-class-candidates () - "" - (let (list func) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :class-func)) - (if func (setq list (-concat list (funcall func))))) - list)) - -(defun ac-html-tag-documentation (tag) - "Not documented yet." - (catch 'return-val - (let (doc func) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :tag-doc-func)) - (if func - (progn - (setq doc (funcall func tag)) - (if doc (throw 'return-val doc)))))))) - -(defun ac-html-attr-documentation (attr) - "Not documented yet." - (catch 'return-val - (let (doc func tag) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :attr-doc-func)) - (if func - (progn - (setq tag (funcall ac-html-current-tag-function)) - (setq doc (funcall func tag attr)) - (if doc (throw 'return-val doc)))))))) - -(defun ac-html-attrv-documentation (attrv) - "Not documented yet." - (catch 'return-val - (let (doc func tag attr) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :attrv-doc-func)) - (if func - (progn - (setq tag (funcall ac-html-current-tag-function)) - (setq attr (funcall ac-html-current-attr-function)) - (setq doc (funcall func tag attr attrv)) - (if doc (throw 'return-val doc))))) - (if (string= attr "class") - (throw 'return-val (ac-html-class-documentation attrv))) - (if (string= attr "id") - (throw 'return-val (ac-html-id-documentation attrv)))))) - -(defun ac-html-id-documentation (id) - "" - (catch 'return-val - (let (doc func) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :id-doc-func)) - (if func - (progn - (setq doc (funcall func id)) - (if doc (throw 'return-val doc)))))))) - -(defun ac-html-class-documentation (class) - "" - (catch 'return-val - (let (doc func) - (dolist (provider ac-html-enabled-data-providers) - (setq func (ac-html-query-data-provider provider :class-doc-func)) - (if func - (progn - (setq doc (funcall func class)) - (if doc (throw 'return-val doc)))))))) - -(provide 'ac-html-core) -;;; ac-html-core.el ends here diff --git a/elpa/ac-html-20151005.731/ac-html-core.elc b/elpa/ac-html-20151005.731/ac-html-core.elc deleted file mode 100644 index 254a7a3..0000000 Binary files a/elpa/ac-html-20151005.731/ac-html-core.elc and /dev/null differ diff --git a/elpa/ac-html-20151005.731/ac-html-default-data-provider.el b/elpa/ac-html-20151005.731/ac-html-default-data-provider.el deleted file mode 100644 index 2a8ed7a..0000000 --- a/elpa/ac-html-20151005.731/ac-html-default-data-provider.el +++ /dev/null @@ -1,139 +0,0 @@ -(require 'ac-html-core) -(require 'f) - -;;; web-completion-data helpers - -(defconst web-completion-data-package-dir - (file-name-directory (or load-file-name (buffer-file-name))) - "The directory where `web-completion-data' package exists.") - -(defconst web-completion-data-html-source-dir - (expand-file-name "completion-data" web-completion-data-package-dir) - "The directory where basic completion source of `web-completion-data' - exists.") - -(defconst web-completion-data-tag-list-file - (f-expand "html-tag-list" web-completion-data-html-source-dir)) - -(defconst web-completion-data-tag-doc-dir - (f-expand "html-tag-short-docs" web-completion-data-html-source-dir)) - -(defun web-completion-data-tag-doc-file (tag) - (f-expand tag web-completion-data-tag-doc-dir)) - -(defconst web-completion-data-attr-list-dir - (f-expand "html-attributes-list" web-completion-data-html-source-dir)) - -(defconst web-completion-data-attr-global-list-file - (f-expand "global" web-completion-data-attr-list-dir)) - -(defun web-completion-data-attr-list-file (tag) - (f-expand tag web-completion-data-attr-list-dir)) - -(defconst web-completion-data-attr-doc-dir - (f-expand "html-attributes-short-docs" web-completion-data-html-source-dir)) - -(defun web-completion-data-attr-global-doc-file (attr) - (f-expand (format "global-%s" attr) web-completion-data-attr-doc-dir)) - -(defun web-completion-data-attr-doc-file (tag attr) - (f-expand (format "%s-%s" tag attr) web-completion-data-attr-doc-dir)) - -(defconst web-completion-data-attrv-list-dir - (f-expand "html-attrv-list" web-completion-data-html-source-dir)) - -(defun web-completion-data-attrv-list-file (tag attr) - (f-expand (format "%s-%s" tag attr) web-completion-data-attrv-list-dir)) - -(defun web-completion-data-attrv-global-list-file (attr) - (f-expand (format "global-%s" attr) web-completion-data-attrv-list-dir)) - -(defconst web-completion-data-attrv-doc-dir - (f-expand "html-attrv-docs" web-completion-data-html-source-dir)) - -(defun web-completion-data-attrv-global-doc-file (attr attrv) - (f-expand (format "global-%s-%s" attr (url-hexify-string attrv)) - web-completion-data-attrv-doc-dir)) - -(defun web-completion-data-attrv-doc-file (tag attr attrv) - (f-expand (format "%s-%s-%s" tag attr (url-hexify-string attrv)) - web-completion-data-attrv-doc-dir)) - -;;; cached data - -(defvar ac-html--tags-list nil "The list of tags.") -(defvar ac-html--global-attributes nil "The list of global attrs.") -(defvar ac-html--cached-attributes-alist nil) - -;;; helper functions - -(defun ac-html--load-list-from-file (filepath) - "Return a list separated by \\n from FILEPATH." - (if (file-exists-p filepath) - (with-current-buffer (find-file-noselect filepath) - (unwind-protect - (split-string - (save-restriction - (widen) - (buffer-substring-no-properties (point-min) (point-max))) - "\n" t) - (kill-buffer))) - nil)) - -(defun ac-html--read-file (file) - "If file exist, return string of contents, otherwise return nil." - (if (file-exists-p file) - (with-temp-buffer - (insert-file-contents file) - (buffer-string)) - nil)) - -;;; functions - -(defun ac-html-default-tags () - (if ac-html--tags-list - ac-html--tags-list - (setq ac-html--tags-list - (ac-html--load-list-from-file web-completion-data-tag-list-file)))) - -(defun ac-html-default-attrs (tag) - (unless ac-html--global-attributes - (setq ac-html--global-attributes - (ac-html--load-list-from-file - web-completion-data-attr-global-list-file))) - (let (list attr-file) - (setq attr-file (web-completion-data-attr-list-file tag)) - (if (file-exists-p attr-file) - (setq list (ac-html--load-list-from-file - attr-file))) - (append list ac-html--global-attributes))) - -(defun ac-html-default-attrvs (tag attr) - (append - (ac-html--load-list-from-file - (web-completion-data-attrv-list-file tag attr)) - (ac-html--load-list-from-file - (web-completion-data-attrv-global-list-file attr)))) - -(defun ac-html-default-tag-doc (tag) - (ac-html--read-file (web-completion-data-tag-doc-file tag))) - -(defun ac-html-default-attr-doc (tag attr) - (or (ac-html--read-file (web-completion-data-attr-doc-file tag attr)) - (ac-html--read-file (web-completion-data-attr-global-doc-file attr)))) - -(defun ac-html-default-attrv-doc (tag attr attrv) - (or (ac-html--read-file (web-completion-data-attrv-doc-file tag attr attrv)) - (ac-html--read-file - (web-completion-data-attrv-global-doc-file attr attrv)))) - -(ac-html-define-data-provider 'ac-html-default-data-provider - :tag-func 'ac-html-default-tags - :attr-func 'ac-html-default-attrs - :attrv-func 'ac-html-default-attrvs - :tag-doc-func 'ac-html-default-tag-doc - :attr-doc-func 'ac-html-default-attr-doc - :attrv-doc-func 'ac-html-default-attrv-doc) - -(provide 'ac-html-default-data-provider) -;;; ac-html-default-data-provider.el ends here diff --git a/elpa/ac-html-20151005.731/ac-html-default-data-provider.elc b/elpa/ac-html-20151005.731/ac-html-default-data-provider.elc deleted file mode 100644 index 2163cf0..0000000 Binary files a/elpa/ac-html-20151005.731/ac-html-default-data-provider.elc and /dev/null differ diff --git a/elpa/ac-html-20151005.731/ac-html-pkg.el b/elpa/ac-html-20151005.731/ac-html-pkg.el deleted file mode 100644 index cc74141..0000000 --- a/elpa/ac-html-20151005.731/ac-html-pkg.el +++ /dev/null @@ -1,15 +0,0 @@ -(define-package "ac-html" "20151005.731" "auto complete source for html tags and attributes" - '((auto-complete "1.4") - (s "1.9") - (f "0.17") - (dash "2.10")) - :commit "668154cba123c321d1b07c2dc8b26d14092253b8" :keywords - '("html" "auto-complete" "slim" "haml" "jade") - :authors - '(("Zhang Kai Yu" . "yeannylam@gmail.com")) - :maintainer - '("Zhang Kai Yu" . "yeannylam@gmail.com") - :url "https://github.com/cheunghy/ac-html") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/ac-html-20151005.731/ac-html-testing-data-provider.el b/elpa/ac-html-20151005.731/ac-html-testing-data-provider.el deleted file mode 100644 index 43299e0..0000000 --- a/elpa/ac-html-20151005.731/ac-html-testing-data-provider.el +++ /dev/null @@ -1,17 +0,0 @@ -(require 'ac-html-core) - -(defun ac-html-testing-tags () - '("tag1" "tag2" "tag3")) - -(defun ac-html-testing-classes () - '("class1" "class2")) - -(defun ac-html-testing-ids () - '("id1" "id2" "id3")) - -(ac-html-define-data-provider 'ac-html-testing-data-provider - :tag-func 'ac-html-testing-tags - :class-func 'ac-html-testing-classes - :id-func 'ac-html-testing-ids) - -(provide 'ac-html-testing-data-provider) diff --git a/elpa/ac-html-20151005.731/ac-html-testing-data-provider.elc b/elpa/ac-html-20151005.731/ac-html-testing-data-provider.elc deleted file mode 100644 index 41762dc..0000000 Binary files a/elpa/ac-html-20151005.731/ac-html-testing-data-provider.elc and /dev/null differ diff --git a/elpa/ac-html-20151005.731/ac-html.el b/elpa/ac-html-20151005.731/ac-html.el deleted file mode 100644 index efebf94..0000000 --- a/elpa/ac-html-20151005.731/ac-html.el +++ /dev/null @@ -1,89 +0,0 @@ -;;; ac-html.el --- auto complete source for html tags and attributes - -;; Copyright (C) 2014 - 2015 Zhang Kai Yu - -;; Author: Zhang Kai Yu -;; Version: 0.4.alpha -;; Keywords: html, auto-complete, slim, haml, jade -;; Package-Requires: ((auto-complete "1.4") (s "1.9") (f "0.17") (dash "2.10")) -;; URL: https://github.com/cheunghy/ac-html - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; - -;;; Code: - -(require 'ac-html-core) - -(defun ac-html--inside-attrv () - "Return t if cursor inside attrv aka string. -Has bug for quoted quote." - (save-match-data - (save-excursion - (re-search-backward "\\w+[\n\t ]*=[\n\t ]*[\"']\\([^\"']*\\)" nil t)) - (equal (match-end 1) (point)))) - -(defun ac-html--inside-comment () - "Return t if cursor inside comment. -Not implemented yet.") - -;;; auto complete HTML for html-mode and web-mode - -(defun ac-html-tag-prefix () - (if (ac-html--inside-attrv) - nil - (save-match-data - (save-excursion - (re-search-backward "<\\([^\n\t >'\"]*\\)" nil t)) - (match-beginning 1)))) - -(defun ac-html-attr-prefix () - (if (ac-html--inside-attrv) - nil - (save-match-data - (save-excursion - (re-search-backward "<\\w[^>]*[[:space:]]+\\(.*\\)" nil t)) - (match-beginning 1)))) - -(defun ac-html-value-prefix () - (if (re-search-backward "\\w=[\"]\\([^\"]+[ ]\\|\\)\\(.*\\)" nil t) - (match-beginning 2))) - -(defun ac-html-current-tag () - "Return current html tag user is typing on. -There is a bug if attrv contains string like this -;; Keywords: html, auto-complete, jade, node - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration: -;; - -;;; Code: - -(require 'ac-html-core) - -(defun ac-jade-current-tag () - "Return current jade tag user is typing on." - (save-excursion (re-search-backward "^[\t ]*\\(\\w+\\)" nil t)) - (match-string 1)) - -(defun ac-jade-current-attr () - "Return current html tag's attribute user is typing on." - (save-excursion (re-search-backward "[^a-z-]\\([a-z-]+\\) *=" nil t)) - (match-string 1)) - -(defun ac-jade-attrv-prefix () - (if (re-search-backward "\\w *= *[\"]\\([^\"]+[ ]\\|\\)\\(.*\\)" nil t) - (match-beginning 2))) - -(ac-html-define-ac-source "jade" - :tag-prefix "^[\t ]*\\(.*\\)" - :attr-prefix "\\(?:,\\|(\\)[ ]*\\(.*\\)" - :attrv-prefix ac-jade-attrv-prefix - :current-tag-func ac-jade-current-tag - :current-attr-func ac-jade-current-attr) - -(provide 'ac-jade) -;;; ac-jade.el ends here diff --git a/elpa/ac-html-20151005.731/ac-jade.elc b/elpa/ac-html-20151005.731/ac-jade.elc deleted file mode 100644 index bc3b87a..0000000 Binary files a/elpa/ac-html-20151005.731/ac-jade.elc and /dev/null differ diff --git a/elpa/ac-html-20151005.731/ac-slim.el b/elpa/ac-html-20151005.731/ac-slim.el deleted file mode 100644 index a1d27c1..0000000 --- a/elpa/ac-html-20151005.731/ac-slim.el +++ /dev/null @@ -1,154 +0,0 @@ -;;; ac-slim.el --- auto complete source for html tag and attributes - -;; Copyright (C) 2015 Zhang Kai Yu - -;; Author: Zhang Kai Yu -;; Keywords: html, auto-complete, slim, ruby - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration: -;; - -;;; Code: - -(require 'ac-html-core) - -(require 's) - -(defun ac-slim-inside-ruby-code () - "Return t if inside ruby code." - (let ((line (buffer-substring-no-properties (line-beginning-position) - (line-end-position)))) - (numberp (string-match-p "^[\t ]*[-=]" line)))) - -(defun ac-slim--line-leading-spaces () - "Return leading space of current line." - (let ((saved-point (point)) (number-of-spaces 0) (cur-point nil)) - (goto-char (line-beginning-position)) - (setq cur-point (point)) - (while (-contains-p '(? ?\t) (char-after cur-point)) - (setq number-of-spaces (1+ number-of-spaces)) - (setq cur-point (1+ cur-point)) - (goto-char cur-point)) - (goto-char saved-point) - number-of-spaces)) - -(defun ac-slim--line-is-block-indicator () - "Return t if line indicate a non slim block." - (let ((content-of-line (buffer-substring-no-properties - (line-beginning-position) (line-end-position)))) - (numberp (string-match-p - "[ \t]*\\(ruby\\|javascript\\|coffee\\):[ \t]*" - content-of-line)))) - -(defun ac-slim--line-is-empty () - "Return t if line is empty." - (s-matches-p "^[ \t]*$" (buffer-substring-no-properties - (line-beginning-position) - (line-end-position)))) - -(defun ac-slim-inside-non-slim-block () - "Return t if inside ruby block, coffee block." - (catch 'blk - (save-excursion - (let ((min-number-of-leading-spaces (ac-slim--line-leading-spaces))) - (if (ac-slim--line-is-block-indicator) - (throw 'blk t)) - (while (not (or (= min-number-of-leading-spaces 0) - (= 1 (line-number-at-pos)))) - (forward-line -1) - (if (ac-slim--line-is-empty) - nil - (if (< (ac-slim--line-leading-spaces) min-number-of-leading-spaces) - (progn - (setq min-number-of-leading-spaces (ac-slim--line-leading-spaces)) - (if (ac-slim--line-is-block-indicator) - (throw 'blk t)))))))))) - -(defun ac-slim-tag-prefix () - (and (not (ac-slim-inside-ruby-code)) - (not (ac-slim-inside-non-slim-block)) - (save-match-data - (save-excursion - (re-search-backward "\\(^[\t ]*\\|:[\t ]*\\)\\([a-zA-Z]*\\)" nil t) - (match-beginning 2))))) - -(defun ac-slim-attr-prefix () - (and (not (ac-slim-inside-ruby-code)) - (not (ac-slim-inside-non-slim-block)) - (not (ac-slim-attrv-prefix)) - (save-match-data - (save-excursion - (re-search-backward " \\(.*\\)" nil t) - (match-beginning 1))))) - -(defun ac-slim-attrv-prefix () - (and (not (ac-slim-inside-ruby-code)) - (not (ac-slim-inside-non-slim-block)) - (let (mb2 me2) - (save-excursion - (save-match-data - (if (re-search-backward - "\\w *= *[\"']\\([^\"']+[ ]\\|\\)\\([^\"']*\\)" - (line-beginning-position) t) - (progn - (setq mb2 (match-beginning 2)) - (setq me2 (match-end 2)))))) - (if (and mb2 (>= me2 (point))) - mb2)))) - -(defun ac-slim-class-prefix () - (and (not (ac-slim-inside-ruby-code)) - (not (ac-slim-inside-non-slim-block)) - (save-match-data - (save-excursion - (re-search-backward "\\(^[\t ]*\\|:[\t ]*\\)\\([a-zA-Z0-9#.]*\\.\\)\\([a-zA-Z0-9]\\)" nil t) - (match-beginning 3))))) - -(defun ac-slim-id-prefix () - (and (not (ac-slim-inside-ruby-code)) - (not (ac-slim-inside-non-slim-block)) - (save-match-data - (save-excursion - (re-search-backward "\\(^[\t ]*\\|:[\t ]*\\)\\([a-zA-Z0-9.]*#\\)\\([a-zA-Z0-9]\\)" nil t) - (match-beginning 3))))) - -(defun ac-slim-current-tag () - "Return current slim tag user is typing on." - (let* ((line (buffer-substring-no-properties (line-beginning-position) - (line-end-position))) - (match-result (s-match "\\(^[\t ]*\\|:[\t ]*\\)\\(\\w+\\)" line))) - (if match-result - (nth 2 match-result) - "div"))) - -(defun ac-slim-current-attr () - "Return current html tag's attribute user is typing on." - (save-excursion (re-search-backward "[^a-z-]\\([a-z-]+\\) *=" nil t)) - (match-string 1)) - -(ac-html-define-ac-source "slim" - :tag-prefix ac-slim-tag-prefix - :attr-prefix ac-slim-attr-prefix - :attrv-prefix ac-slim-attrv-prefix - :class-prefix ac-slim-class-prefix - :id-prefix ac-slim-id-prefix - :current-tag-func ac-slim-current-tag - :current-attr-func ac-slim-current-attr) - -(provide 'ac-slim) -;;; ac-slim.el ends here diff --git a/elpa/ac-html-20151005.731/ac-slim.elc b/elpa/ac-html-20151005.731/ac-slim.elc deleted file mode 100644 index 500ad2b..0000000 Binary files a/elpa/ac-html-20151005.731/ac-slim.elc and /dev/null differ diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-doc-url/global b/elpa/ac-html-20151005.731/completion-data/html-attributes-doc-url/global deleted file mode 100644 index 8677b40..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-doc-url/global +++ /dev/null @@ -1 +0,0 @@ -https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/a b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/a deleted file mode 100644 index d992335..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/a +++ /dev/null @@ -1,15 +0,0 @@ -download -href -media -ping -rel -target -datafld -datasrc -hreflang -methods -name -rev -shape -type -urn \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/abbr b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/abbr deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/acronym b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/acronym deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/address b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/address deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/applet b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/applet deleted file mode 100644 index 9f74833..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/applet +++ /dev/null @@ -1,15 +0,0 @@ -align -alt -archive -code -codebase -datafld -datasrc -height -hspace -mayscript -name -object -src -vspace -width \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/area b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/area deleted file mode 100644 index 724822e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/area +++ /dev/null @@ -1,10 +0,0 @@ -alt -coords -download -href -hreflang -media -rel -shape -target -type \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/article b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/article deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/aside b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/aside deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/audio b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/audio deleted file mode 100644 index d8d4e24..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/audio +++ /dev/null @@ -1,11 +0,0 @@ -autoplay -autobuffer -buffered -controls -loop -mosCurrentSampleOffset -muted -played -preload -src -volume \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/b b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/b deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/base b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/base deleted file mode 100644 index d6a3ceb..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/base +++ /dev/null @@ -1,2 +0,0 @@ -href -target \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/basefont b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/basefont deleted file mode 100644 index b036ef5..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/basefont +++ /dev/null @@ -1,3 +0,0 @@ -color -face -size \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/bdo b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/bdo deleted file mode 100644 index 8724519..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/bdo +++ /dev/null @@ -1 +0,0 @@ -dir \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/bgsound b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/bgsound deleted file mode 100644 index 97cc7b8..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/bgsound +++ /dev/null @@ -1,4 +0,0 @@ -balance -loop -src -volume \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/blockquote b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/blockquote deleted file mode 100644 index ec594fe..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/blockquote +++ /dev/null @@ -1 +0,0 @@ -cite \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/body b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/body deleted file mode 100644 index c021190..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/body +++ /dev/null @@ -1,18 +0,0 @@ -onafterprint -onbeforeprint -onbeforeunload -onblur -onerror -onfocus -onhashchange -onlanguagechange -onload -onmessage -onoffline -ononline -onpopstate -onredo -onresize -onstorage -onundo -onunload diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/br b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/br deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/button b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/button deleted file mode 100644 index 6c320f6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/button +++ /dev/null @@ -1,12 +0,0 @@ -autofocus -autocomplete -disabled -form -formaction -formenctype -formmethod -formnovalidate -formtarget -name -type -value \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/canvas b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/canvas deleted file mode 100644 index 5601eac..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/canvas +++ /dev/null @@ -1,3 +0,0 @@ -height -moz-opaque -width \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/caption b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/caption deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/col b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/col deleted file mode 100644 index 18371e2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/col +++ /dev/null @@ -1,2 +0,0 @@ -bgcolor -span \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/colgroup b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/colgroup deleted file mode 100644 index 18371e2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/colgroup +++ /dev/null @@ -1,2 +0,0 @@ -bgcolor -span \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/data b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/data deleted file mode 100644 index 2890eea..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/data +++ /dev/null @@ -1 +0,0 @@ -value \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dd b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dd deleted file mode 100644 index 76277f2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dd +++ /dev/null @@ -1 +0,0 @@ -nowrap \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/del b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/del deleted file mode 100644 index cd4dae1..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/del +++ /dev/null @@ -1,2 +0,0 @@ -cite -datetime \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/details b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/details deleted file mode 100644 index ce4a72b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/details +++ /dev/null @@ -1 +0,0 @@ -open \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dialog b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dialog deleted file mode 100644 index ce4a72b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dialog +++ /dev/null @@ -1 +0,0 @@ -open \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dl b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dl deleted file mode 100644 index b68dd04..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/dl +++ /dev/null @@ -1 +0,0 @@ -compact \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/element b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/element deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/embed b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/embed deleted file mode 100644 index 6d6aed9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/embed +++ /dev/null @@ -1,4 +0,0 @@ -height -src -type -width \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/fieldset b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/fieldset deleted file mode 100644 index 36cfeb9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/fieldset +++ /dev/null @@ -1,3 +0,0 @@ -disabled -form -name \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/form b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/form deleted file mode 100644 index 36444c6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/form +++ /dev/null @@ -1,9 +0,0 @@ -accept-charset -action -autocapitalize -autocomplete -enctype -method -name -novalidate -target \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/frame b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/frame deleted file mode 100644 index 84732f0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/frame +++ /dev/null @@ -1,7 +0,0 @@ -src -name -noresize -scrolling -marginheight -marginwidth -frameborder \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/frameset b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/frameset deleted file mode 100644 index 802b24e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/frameset +++ /dev/null @@ -1,2 +0,0 @@ -cols -rows \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/global b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/global deleted file mode 100644 index a10cda0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/global +++ /dev/null @@ -1,20 +0,0 @@ -accesskey -class -contenteditable -contextmenu -data- -dir -draggable -dropzone -hidden -id -itemid -itemprop -itemref -itemscope -itemtype -lang -spellcheck -style -tabindex -title \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/hr b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/hr deleted file mode 100644 index 9430a5a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/hr +++ /dev/null @@ -1 +0,0 @@ -color \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/html b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/html deleted file mode 100644 index ec3cf88..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/html +++ /dev/null @@ -1 +0,0 @@ -manifest \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/iframe b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/iframe deleted file mode 100644 index 1fe048b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/iframe +++ /dev/null @@ -1,8 +0,0 @@ -allowfullscreen -height -name -sandbox -seamless -src -srcdoc -width \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/img b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/img deleted file mode 100644 index 207b07f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/img +++ /dev/null @@ -1,9 +0,0 @@ -alt -crossorigin -height -ismap -src -sizes -srcset -width -usemap \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/input b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/input deleted file mode 100644 index 2f9b493..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/input +++ /dev/null @@ -1,38 +0,0 @@ -type -accept -autocapitalize -mozactionhint -autocomplete -autocorrect -autofocus -autosave -checked -disabled -form -formaction -formenctype -formmethod -formnovalidate -formtarget -height -incremental -inputmode -list -max -maxlength -min -minlength -multiple -name -pattern -placeholder -readonly -required -selectionDirection -size -spellcheck -src -step -value -width -x-moz-errormessage \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/ins b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/ins deleted file mode 100644 index cd4dae1..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/ins +++ /dev/null @@ -1,2 +0,0 @@ -cite -datetime \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/isindex b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/isindex deleted file mode 100644 index 5cd6b6f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/isindex +++ /dev/null @@ -1,2 +0,0 @@ -prompt -action \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/keygen b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/keygen deleted file mode 100644 index ab6f40c..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/keygen +++ /dev/null @@ -1,6 +0,0 @@ -autofocus -challenge -disabled -form -keytype -name \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/label b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/label deleted file mode 100644 index 69c1b54..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/label +++ /dev/null @@ -1,3 +0,0 @@ -accesskey -for -form \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/li b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/li deleted file mode 100644 index 2890eea..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/li +++ /dev/null @@ -1 +0,0 @@ -value \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/link b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/link deleted file mode 100644 index b8e808e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/link +++ /dev/null @@ -1,11 +0,0 @@ -crossorigin -use-credentials -disabled -href -hreflang -media -methods -rel -sizes -target -type \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/map b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/map deleted file mode 100644 index 934edc8..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/map +++ /dev/null @@ -1 +0,0 @@ -name \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/marquee b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/marquee deleted file mode 100644 index 619bd27..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/marquee +++ /dev/null @@ -1,16 +0,0 @@ -behavior -bgcolor -direction -height -hspace -loop -scrollamount -scrolldelay -truespeed -vspace -width -onbounce -onfinish -onstart -start -stop \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/menu b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/menu deleted file mode 100644 index b594625..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/menu +++ /dev/null @@ -1,2 +0,0 @@ -label -type \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/menuitem b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/menuitem deleted file mode 100644 index a959c36..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/menuitem +++ /dev/null @@ -1,8 +0,0 @@ -checked -command -default -disabled -icon -label -radiogroup -type \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/meta b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/meta deleted file mode 100644 index 4ce8964..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/meta +++ /dev/null @@ -1,5 +0,0 @@ -name -charset -itemprop -http-equiv -content \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/meter b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/meter deleted file mode 100644 index 0f2efd9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/meter +++ /dev/null @@ -1,7 +0,0 @@ -value -min -max -low -high -optimum -form \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/object b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/object deleted file mode 100644 index 8bf3ecb..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/object +++ /dev/null @@ -1,8 +0,0 @@ -data -form -height -name -type -typemustmatch -usemap -width \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/ol b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/ol deleted file mode 100644 index dd8feb5..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/ol +++ /dev/null @@ -1,4 +0,0 @@ -compact -reversed -start -type \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/optgroup b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/optgroup deleted file mode 100644 index 1dd87b6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/optgroup +++ /dev/null @@ -1,2 +0,0 @@ -disabled -label \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/option b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/option deleted file mode 100644 index 82f55f7..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/option +++ /dev/null @@ -1,4 +0,0 @@ -disabled -label -selected -value \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/output b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/output deleted file mode 100644 index f7d4a39..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/output +++ /dev/null @@ -1,3 +0,0 @@ -for -form -name \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/param b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/param deleted file mode 100644 index 934edc8..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/param +++ /dev/null @@ -1 +0,0 @@ -name \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/progress b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/progress deleted file mode 100644 index e1574ed..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/progress +++ /dev/null @@ -1,2 +0,0 @@ -max -value \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/q b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/q deleted file mode 100644 index ec594fe..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/q +++ /dev/null @@ -1 +0,0 @@ -cite \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/script b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/script deleted file mode 100644 index f67ec4c..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/script +++ /dev/null @@ -1,5 +0,0 @@ -async -src -type -defer -crossorigin \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/select b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/select deleted file mode 100644 index 858e621..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/select +++ /dev/null @@ -1,7 +0,0 @@ -autofocus -disabled -form -multiple -name -required -size \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/source b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/source deleted file mode 100644 index be6f7c8..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/source +++ /dev/null @@ -1,5 +0,0 @@ -sizes -src -srcset -type -media \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/spacer b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/spacer deleted file mode 100644 index af6a9d4..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/spacer +++ /dev/null @@ -1,5 +0,0 @@ -type -size -width -height -align \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/style b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/style deleted file mode 100644 index dfb969d..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/style +++ /dev/null @@ -1,5 +0,0 @@ -type -media -scoped -title -disabled \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/table b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/table deleted file mode 100644 index e69de29..0000000 diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/td b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/td deleted file mode 100644 index c85b318..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/td +++ /dev/null @@ -1,3 +0,0 @@ -colspan -headers -rowspan \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/textarea b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/textarea deleted file mode 100644 index e262b12..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/textarea +++ /dev/null @@ -1,18 +0,0 @@ -autocapitalize -autocomplete -autofocus -cols -disabled -form -maxlength -minlength -name -placeholder -readonly -required -rows -selectionDirection -selectionEnd -selectionStart -spellcheck -wrap \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/th b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/th deleted file mode 100644 index 7876ad2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/th +++ /dev/null @@ -1,4 +0,0 @@ -colspan -headers -rowspan -scope \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/time b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/time deleted file mode 100644 index 53e773a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/time +++ /dev/null @@ -1 +0,0 @@ -datetime \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/track b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/track deleted file mode 100644 index c628b8e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/track +++ /dev/null @@ -1,5 +0,0 @@ -default -kind -label -src -srclang \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/video b/elpa/ac-html-20151005.731/completion-data/html-attributes-list/video deleted file mode 100644 index 8eeac7e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-list/video +++ /dev/null @@ -1,12 +0,0 @@ -autoplay -buffered -controls -crossorigin -height -loop -muted -played -preload -poster -src -width \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-charset b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-charset deleted file mode 100644 index c4da746..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-charset +++ /dev/null @@ -1,7 +0,0 @@ -charset [Obsolete since HTML5] - -This attribute defines the character encoding of the linked resource. The value is a space- and/or comma-delimited list of character sets as defined in RFC 2045. The default value is ISO-8859-1. - -Usage note: - -This attribute is obsolete in HTML5 and should not be used by authors. To achieve its effect, use the HTTP Content-Type header on the linked resource. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-coords b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-coords deleted file mode 100644 index abb49e4..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-coords +++ /dev/null @@ -1,3 +0,0 @@ -coords [HTML4 only] [Obsolete since HTML5] - -For use with object shapes, this attribute uses a comma-separated list of numbers to define the coordinates of the object on the page. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-download b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-download deleted file mode 100644 index e832e13..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-download +++ /dev/null @@ -1,10 +0,0 @@ -download [HTML5] - -This attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource so that when the user clicks on the link they will be prompted to save it as a local file. If the attribute has a value, the value will be used as the pre-filled file name in the Save prompt that opens when the user clicks on the link (the user can change the name before actually saving the file of course). There are no restrictions on allowed values (though / and \ will be converted to underscores, preventing specific path hints), but you should consider that most file systems have limitations with regard to what punctuation is supported in file names, and browsers are likely to adjust file names accordingly. - -Note: - -Can be used with blob: URLs and data: URLs, to make it easy for users to download content that is generated programmatically using JavaScript (e.g. a picture created using an online drawing Web app). -If the HTTP header Content-Disposition: is present and gives a different filename than this attribute, the HTTP header has priority over this attribute. -If this attribute is present and Content-Disposition: is set to inline, Firefox gives priority to Content-Disposition, like for the filename case, while Chrome gives priority to the download attribute. -In Firefox 20 this attribute is only honored for links to resources with the same-origin. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-href b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-href deleted file mode 100644 index 09bdb8e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-href +++ /dev/null @@ -1,5 +0,0 @@ -This was the single required attribute for anchors defining a hypertext source link, but is no longer required in HTML5. Omitting this attribute creates a placeholder link. The href attribute indicates the link target, either a URL or a URL fragment. A URL fragment is a name preceded by a hash mark (#), which specifies an internal target location (an ID) within the current document. URLs are not restricted to Web (HTTP)-based documents. URLs might use any protocol supported by the browser. For example, file, ftp, and mailto work in most user agents. - -Note: - -You can use the special fragment "top" to create a link back to the top of the page; for example Return to top. This behavior is specified by HTML5. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-hreflang b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-hreflang deleted file mode 100644 index 3fc152a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-hreflang +++ /dev/null @@ -1,3 +0,0 @@ -hreflang - -This attribute indicates the language of the linked resource. It is purely advisory. Allowed values are determined by BCP47 for HTML5 and by RFC1766 for HTML4. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-media b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-media deleted file mode 100644 index 6e2f85b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-media +++ /dev/null @@ -1,8 +0,0 @@ -media [html5] - -This attribute specifies the media which the linked resource applies to. Its value must be a media query. This attribute is mainly useful when linking to external stylesheets by allowing the user agent to pick the best adapted one for the device it runs on. - -Usage note: - -In HTML 4, only simple white-space-separated list of media description literals, i.e. media types and groups, where defined and allowed as values for this attribute, like print, screen, aural, braille, ... HTML 5 extended this to any kind of media queries, which are a superset of the allowed values of HTML 4. -Browsers not supporting the CSS3 Media Queries won't necessarily recognize the adequate link; do not forget to set fallback links, the restricted set of media queries defined in HTML 4. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-methods b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-methods deleted file mode 100644 index 91ee786..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-methods +++ /dev/null @@ -1,3 +0,0 @@ -methods [!] - -The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the title attribute) be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This attribute is not well understood nor supported, even by the defining browser, Internet Explorer 4. Methods Property (MSDN) \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-name b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-name deleted file mode 100644 index 1953320..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-name +++ /dev/null @@ -1,7 +0,0 @@ -name [HTML4 only] [Obsolete since HTML5] - -This attribute is required in an anchor defining a target location within a page. A value for name is similar to a value for the id core attribute and should be an alphanumeric identifier unique to the document. Under the HTML 4.01 specification, id and name both can be used with the element as long as they have identical values. - -Usage note: - -This attribute is obsolete in HTML5, use global attribute id instead. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-ping b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-ping deleted file mode 100644 index afa7e86..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-ping +++ /dev/null @@ -1,3 +0,0 @@ -ping [html5] - -The 'ping' attribute, if present, sends the URLs of the resources a notification/ping if the user follows the hyperlink. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-rel b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-rel deleted file mode 100644 index 290401b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-rel +++ /dev/null @@ -1,3 +0,0 @@ -rel - -For anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. The value is a comma-separated list of link types values. The values and their semantics will be registered by some authority that might have meaning to the document author. The default relationship, if no other is given, is void. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-rev b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-rev deleted file mode 100644 index 0372b43..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-rev +++ /dev/null @@ -1,3 +0,0 @@ -rev [HTML4 only] [Obsolete since HTML5] - -This attribute specifies a reverse link, the inverse relationship of the rel attribute. It is useful for indicating where an object came from, such as the author of a document. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-shape b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-shape deleted file mode 100644 index c1970d2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-shape +++ /dev/null @@ -1,6 +0,0 @@ -shape [HTML4 only] [Obsolete since HTML5] - -This attribute is used to define a selectable region for hypertext source links associated with a figure to create an image map. The values for the attribute are circle, default, polygon, and rect. The format of the coords attribute depends on the value of shape. For circle, the value is x,y,r where x and y are the pixel coordinates for the center of the circle and r is the radius value in pixels. For rect, the coords attribute should be x,y,w,h. The x,y values define the upper-left-hand corner of the rectangle, while w and h define the width and height respectively. A value of polygon for shape requires x1,y1,x2,y2,... values for coords. Each of the x,y pairs defines a point in the polygon, with successive points being joined by straight lines and the last point joined to the first. The value default for shape requires that the entire enclosed area, typically an image, be used. - -Note: -It is advisable to use the usemap attribute for the element and the associated element to define hotspots instead of the shape attribute. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-target b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-target deleted file mode 100644 index 8ca553a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-target +++ /dev/null @@ -1,9 +0,0 @@ -target - -This attribute specifies where to display the linked resource. In HTML4, this is the name of, or a keyword for, a frame. In HTML5, it is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). The following keywords have special meanings: - _self: Load the response into the same HTML4 frame (or HTML5 browsing context) as the current one. This value is the default if the attribute is not specified. - _blank: Load the response into a new unnamed HTML4 window or HTML5 browsing context. - _parent: Load the response into the HTML4 frameset parent of the current frame or HTML5 parent browsing context of the current one. If there is no parent, this option behaves the same way as _self. - _top: In HTML4: Load the response into the full, original window, canceling all other frames. In HTML5: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self. - -Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-type b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-type deleted file mode 100644 index cbf73b2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-type +++ /dev/null @@ -1,3 +0,0 @@ -type - -This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see http://www.w3.org/TR/html4/references.html#ref-MIMETYPES. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-urn b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-urn deleted file mode 100644 index 65f07eb..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/a-urn +++ /dev/null @@ -1,3 +0,0 @@ -urn [!] - -This supposedly Microsoft-supported attribute relates a uniform resource name (URN) with the link. While it is based on standards work years back, the meaning of URNs is still not well defined, so this attribute is meaningless. urn Property (MSDN) \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/abbr-title b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/abbr-title deleted file mode 100644 index 58b4380..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/abbr-title +++ /dev/null @@ -1,28 +0,0 @@ -title - -Use the title attribute to define the full description of the abbreviation. Many user agents present this as a tooltip. - -[global attribute] - -Text to be displayed in a tooltip when hovering over the element. - -This attribute contains a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. Here are some typical uses of this attribute: - -Link: the title or a description of the linked document -Media element like an image: a description or associated credits -Paragraph: a footnote or a commentary about it -Quotation: some information about the author, and so on. - -If this attribute is omitted, it means that the title of the nearest ancestor of this element is still relevant for it (and can legitimately be used as the tooltip for that element. If this attribute is set to the empty string, it explicitly means that its nearest ancestor's title is not relevant for this element (and shouldn't be used in the tooltip for that element). - -Additional semantics are attached to the title attributes of the , , and elements. - -Usage note: -The title attribute may contains several lines. Each U+000A LINE FEED (LF) inserted represents such a newline. Some caution must be taken though, as that means that: - -Newlines in title should be taken into account,like this example. - -defines a two-line title. - -Support for multi-line titles was added to Gecko in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-alt b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-alt deleted file mode 100644 index 7217d16..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-alt +++ /dev/null @@ -1,3 +0,0 @@ -alt - -A text string alternative to display on browsers that do not display images. The text should be phrased so that it presents the user with the same kind of choice as the image would offer when displayed without the alternative text. In HTML4, this attribute is required, but may be the empty string (""). In HTML5, this attribute is required only if the href attribute is used. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-coords b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-coords deleted file mode 100644 index 366eaa3..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-coords +++ /dev/null @@ -1,3 +0,0 @@ -coords - -A set of values specifying the coordinates of the hot-spot region. The number and meaning of the values depend upon the value specified for the shape attribute. For a rect or rectangle shape, the coords value is two x,y pairs: left, top, right, and bottom. For a circle shape, the value is x,y,r where x,y is a pair specifying the center of the circle and r is a value for the radius. For a poly or polygon< shape, the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on. In HTML4, the values are numbers of pixels or percentages, if a percent sign (%) is appended; in HTML5, the values are numbers of CSS pixels. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-download b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-download deleted file mode 100644 index b358dc6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-download +++ /dev/null @@ -1,3 +0,0 @@ -download [HTML5] - -This attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. See for a full description of the download attribute. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-href b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-href deleted file mode 100644 index bcd259a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-href +++ /dev/null @@ -1,3 +0,0 @@ -href - -The hyperlink target for the area. Its value is a valid URL. In HTML4, either this attribute or the nohref attribute must be present in the element. In HTML5, this attribute may be omitted; if so, the area element does not represent a hyperlink. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-hreflang b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-hreflang deleted file mode 100644 index 4886a83..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-hreflang +++ /dev/null @@ -1,3 +0,0 @@ -hreflang [HTML5] - -Indicates the language of the linked resource. Allowed values are determined by BCP47. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-media b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-media deleted file mode 100644 index 3b5267f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-media +++ /dev/null @@ -1,3 +0,0 @@ -media [HTML5] - -A hint of the media for which the linked resource was designed, for example print and screen. If omitted, it defaults to all. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-name b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-name deleted file mode 100644 index 1eb3ed0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-name +++ /dev/null @@ -1,3 +0,0 @@ -name [HTML4 only] [Obsolete since Gecko 5.0] - -Define a names for the clickable area so that it can be scripted by older browsers. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-nohref b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-nohref deleted file mode 100644 index 6c7fb85..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-nohref +++ /dev/null @@ -1,6 +0,0 @@ -nohref [HTML4 only] [Obsolete since Gecko 5.0] - -Indicates that no hyperlink exists for the associated area. Either this attribute or the href attribute must be present in the element. - -Usage note: -This attribute is obsolete in HTML5, instead omitting the href attribute is sufficient. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-ref b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-ref deleted file mode 100644 index b4f8778..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-ref +++ /dev/null @@ -1,3 +0,0 @@ -rel [HTML5] - -For anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. The value is a comma-separated list of link types values. The values and their semantics will be registered by some authority that might have meaning to the document author. The default relationship, if no other is given, is void. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-shape b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-shape deleted file mode 100644 index 0f81a15..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-shape +++ /dev/null @@ -1,3 +0,0 @@ -shape - -The shape of the associated hot spot. The specifications for HTML 5 and HTML 4 define the values rect, which defines a rectangular region; circle, which defines a circular region; poly, which defines a polygon; and default, which indicates the entire region beyond any defined shapes. Many browsers, notably Internet Explorer 4 and higher, support circ, polygon, and rectangle as valid values for shape; these values are [!]. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-tabindex b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-tabindex deleted file mode 100644 index cc33a2a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-tabindex +++ /dev/null @@ -1,3 +0,0 @@ -tabindex [HTML4 only] [Obsolete since Gecko 5.0] - -A numeric value specifying the position of the defined area in the browser tabbing order. This attribute is global in HTML5. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-target b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-target deleted file mode 100644 index 3b5d940..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-target +++ /dev/null @@ -1,9 +0,0 @@ -target - -This attribute specifies where to display the linked resource. In HTML4, this is the name of, or a keyword for, a frame. In HTML5, it is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). The following keywords have special meanings: - _self: Load the response into the same HTML4 frame (or HTML5 browsing context) as the current one. This value is the default if the attribute is not specified. - _blank: Load the response into a new unnamed HTML4 window or HTML5 browsing context. - _parent: Load the response into the HMTL4 frameset parent of the current frame or HTML5 parent browsing context of the current one. If there is no parent, this option behaves the same way as _self. - _top: In HTML4: Load the response into the full, original window, canceling all other frames. In HTML5: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self. - -Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-type b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-type deleted file mode 100644 index cbf73b2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/area-type +++ /dev/null @@ -1,3 +0,0 @@ -type - -This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see http://www.w3.org/TR/html4/references.html#ref-MIMETYPES. Use this attribute only if the href attribute is present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-autobuffer b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-autobuffer deleted file mode 100644 index 0589c6e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-autobuffer +++ /dev/null @@ -1,3 +0,0 @@ -autobuffer [Obsolete since Gecko 2.0] - -A Boolean attribute; if specified, the audio will automatically begin being downloaded, even if not set to automatically play. This continues until the media cache is full, or the entire audio file has been downloaded, whichever comes first. This should only be used when it is expected that the user will choose to play the audio; for example, if the user has navigated to a page using a "Play this audio" link. This attribute was removed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) in favor of the preload attribute. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-autoplay b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-autoplay deleted file mode 100644 index b9ce010..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-autoplay +++ /dev/null @@ -1,3 +0,0 @@ -autoplay - -A Boolean attribute; if specified (even if the value is "false"!), the audio will automatically begin to play back as soon as it can do so without stopping to finish loading the data. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-buffered b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-buffered deleted file mode 100644 index 8c02140..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-buffered +++ /dev/null @@ -1 +0,0 @@ -An attribute you can read to determine which time ranges of the media have been buffered. This attribute contains a TimeRanges object. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-controls b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-controls deleted file mode 100644 index f434a23..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-controls +++ /dev/null @@ -1,3 +0,0 @@ -controls - -If this attribute is present, the browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-loop b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-loop deleted file mode 100644 index 0c31f7a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-loop +++ /dev/null @@ -1,3 +0,0 @@ -loop - -A Boolean attribute; if specified, we will, upon reaching the end of the audio, automatically seek back to the start. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-mozCurrentSampleOffset b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-mozCurrentSampleOffset deleted file mode 100644 index 28b507b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-mozCurrentSampleOffset +++ /dev/null @@ -1,3 +0,0 @@ -mozCurrentSampleOffset - -The offset, specified as the number of samples since the beginning of the audio stream, at which the audio is currently playing. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-muted b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-muted deleted file mode 100644 index 26446d1..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-muted +++ /dev/null @@ -1 +0,0 @@ -A Boolean attribute which indicates whether the audio will be initially silenced. Its default value is false, meaning that the audio will be played. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-played b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-played deleted file mode 100644 index 18579a9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-played +++ /dev/null @@ -1 +0,0 @@ -A TimeRanges object indicating all the ranges of the audio that have been played. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-preload b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-preload deleted file mode 100644 index 5187790..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-preload +++ /dev/null @@ -1,14 +0,0 @@ -preload - -This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. It may have one of the following values: - none: hints that either the author thinks that the user won't need to consult that audio or that the server wants to minimize its traffic; in others terms this hint indicates that the audio should not be cached; - metadata: hints that though the author thinks that the user won't need to consult that audio, fetching the metadata (e.g. length) is reasonable; - auto: hints that the user needs have priority; in others terms this hint indicated that, if needed, the whole audio could be downloaded, even if the user is not expected to use it; - the empty string: which is a synonym of the auto value. - -If not set, its default value is browser-defined (i.e. each browser can choose its own default value), though the spec advises it to be set to metadata. - -Usage notes: - -The autoplay attribute has precedence over this one as if one wants to automatically play a audio, the browser will obviously need to download it. Setting both the autoplay and the preload attributes is allowed by the specification. -The browser is not forced by the specification to follow the value of this attribute; it is a mere hint. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-src b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-src deleted file mode 100644 index 26afb18..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-src +++ /dev/null @@ -1,3 +0,0 @@ -src - -The URL of the audio to embed. This is subject to HTTP access controls. This is optional; you may instead use the element within the audio block to specify the audio to embed. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-volume b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-volume deleted file mode 100644 index 1d6f33d..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/audio-volume +++ /dev/null @@ -1,3 +0,0 @@ -volume - -The playback volume of any audio portions, in the range 0.0 (silent) to 1.0 (loudest). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/base-href b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/base-href deleted file mode 100644 index 2a272e9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/base-href +++ /dev/null @@ -1,4 +0,0 @@ -href - -The base URL to be used throughout the document for relative URL addresses. If this attribute is specified, this element must come before any other elements with attributes whose values are URLs. -Absolute and relative URIs are allowed (but see note section below). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/base-target b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/base-target deleted file mode 100644 index 2cda7b9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/base-target +++ /dev/null @@ -1,7 +0,0 @@ -target - -A name or keyword indicating the default location to display the result when hyperlinks or forms cause navigation, for elements that do not have an explicit target reference. In HTML4, this is the name of, or a keyword for, a frame. In HTML5, it is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). The following keywords have special meanings: - _self: Load the result into the same HTML4 frame (or HTML5 browsing context) as the current one. This value is the default if the attribute is not specified. - _blank: Load the result into a new unnamed HTML4 window or HTML5 browsing context. - _parent: Load the result into the HTML4 frameset parent of the current frame or HTML5 parent browsing context of the current one. If there is no parent, this option behaves the same way as _self. - _top: In HTML4: Load the result into the full, original window, canceling all other frames. In HTML5: Load the result into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/bdi-dir b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/bdi-dir deleted file mode 100644 index 1467dc0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/bdi-dir +++ /dev/null @@ -1,20 +0,0 @@ -dir - -Like all other HTML elements, this element has the global attributes, with a slight semantic difference: the dir attribute is not inherited. If not set, its default value is the auto which let the browser decide the direction based on the element's content. - -[global attribute] - -Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) - -This enumerated attribute indicates the directionality of the element's text. It can have the following values: - -ltr, which means left to right and is to be used for languages that are written from the left to the right (like English); -rtl, which means right to left and is to be used for languages that are written from the right to the left (like Arabic); -auto, which let the user agent decides. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then apply that directionality to the whole element. - -Usage notes: -This attribute is mandatory for the element where it has a different semantic meaning. -This attribute is not inherited by the element. If not set, its value is auto. -This attribute can be overridden by the CSS properties direction and unicode-bidi, if a CSS page is active and the element supports these properties. -As the directionality of the text is semantically related to its content and not to its presentation, it is recommended that web developers use this attribute instead of the related CSS properties when possible. That way, the text will display correctly even on a browser that doesn't support CSS or has the CSS deactivated. -The auto value should be used for data with an unknown directionality, like data coming from user input, eventually stored in a database. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/bdo-dir b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/bdo-dir deleted file mode 100644 index 759901a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/bdo-dir +++ /dev/null @@ -1,6 +0,0 @@ -dir - -Text direction in this element. Possible values are: - ltr: Indicates that the text should go in a left-to-right direction. - rtl: Indicates that the text should go in a right-to-left direction. - auto: The browser decides which direction based on the element's content. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/blockquote-cite b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/blockquote-cite deleted file mode 100644 index 568cccf..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/blockquote-cite +++ /dev/null @@ -1,3 +0,0 @@ -cite - -A URL that designates a source document or message for the information quoted. This attribute is intended to point to information explaining the context or the reference for the quote. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onafterprint b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onafterprint deleted file mode 100644 index 350866a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onafterprint +++ /dev/null @@ -1,3 +0,0 @@ -onafterprint [HTML5] - -Function to call after the user has printed the document. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onbeforeprint b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onbeforeprint deleted file mode 100644 index 7c315b2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onbeforeprint +++ /dev/null @@ -1,3 +0,0 @@ -onbeforeprint [HTML5] - -Function to call when the user requests printing of the document. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onbeforeunload b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onbeforeunload deleted file mode 100644 index e31bd18..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onbeforeunload +++ /dev/null @@ -1,3 +0,0 @@ -onbeforeunload [HTML5] - -Function to call when the document is about to be unloaded. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onblur b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onblur deleted file mode 100644 index 5406f5d..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onblur +++ /dev/null @@ -1,3 +0,0 @@ -onblur [HTML5] - -Function to call when the document loses focus. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onerror b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onerror deleted file mode 100644 index 88712e6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onerror +++ /dev/null @@ -1,3 +0,0 @@ -onerror [HTML5] - -Function to call when the document fails to load properly. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onfocus b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onfocus deleted file mode 100644 index b273af8..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onfocus +++ /dev/null @@ -1,3 +0,0 @@ -onfocus [HTML5] - -Function to call when the document receives focus. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onhashchange b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onhashchange deleted file mode 100644 index 0e297e7..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onhashchange +++ /dev/null @@ -1,3 +0,0 @@ -onhashchange [HTML5] - -Function to call when the fragment identifier part (starting with the hash ('#') character) of the document's current address has changed. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onlanguagechange b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onlanguagechange deleted file mode 100644 index 863448f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onlanguagechange +++ /dev/null @@ -1,3 +0,0 @@ -onlanguagechange [experimental] - -Function to call when the preferred languages changed. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onload b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onload deleted file mode 100644 index 04d8832..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onload +++ /dev/null @@ -1,3 +0,0 @@ -onload [HTML5] - -Function to call when the document has finished loading. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onmessage b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onmessage deleted file mode 100644 index c7c7f30..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onmessage +++ /dev/null @@ -1,3 +0,0 @@ -onmessage [HTML5] - -Function to call when the document has received a message. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onoffline b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onoffline deleted file mode 100644 index 487677f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onoffline +++ /dev/null @@ -1,3 +0,0 @@ -onoffline [HTML5] - -Function to call when network communication has failed. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-ononline b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-ononline deleted file mode 100644 index 87a97be..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-ononline +++ /dev/null @@ -1,3 +0,0 @@ -ononline [HTML5] - -Function to call when network communication has been restored. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onpopstate b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onpopstate deleted file mode 100644 index 24933dc..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onpopstate +++ /dev/null @@ -1,3 +0,0 @@ -onpopstate [HTML5] - -Function to call when the user has navigated session history. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onredo b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onredo deleted file mode 100644 index 5b6a73a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onredo +++ /dev/null @@ -1,3 +0,0 @@ -onredo [HTML5] - -Function to call when the user has moved forward in undo transaction history. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onresize b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onresize deleted file mode 100644 index ebc7ef0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onresize +++ /dev/null @@ -1,3 +0,0 @@ -onresize [HTML5] - -Function to call when the document has been resized. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onstorage b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onstorage deleted file mode 100644 index 844d46c..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onstorage +++ /dev/null @@ -1,3 +0,0 @@ -onstorage [HTML5] - -Function to call when the storage area has changed. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onundo b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onundo deleted file mode 100644 index ef76ebc..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onundo +++ /dev/null @@ -1,3 +0,0 @@ -onundo [HTML5] - -Function to call when the user has moved backward in undo transaction history. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onunload b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onunload deleted file mode 100644 index f463dfd..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/body-onunload +++ /dev/null @@ -1,3 +0,0 @@ -onunload [HTML5] - -Function to call when the document is going away. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/br-clear b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/br-clear deleted file mode 100644 index 626e841..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/br-clear +++ /dev/null @@ -1,6 +0,0 @@ -clear [Deprecated since HTML4.01] [Obsolete since HTML5] - -Indicates where to begin the next line after the break. - -Usage note: -This attribute is obsolete in HTML5 and should not be used by authors. Use the CSS clear property instead. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-autocomplete b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-autocomplete deleted file mode 100644 index 42e1837..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-autocomplete +++ /dev/null @@ -1,3 +0,0 @@ -autocomplete [!] - -The use of this attribute on a is nonstandard and Firefox-specific. By default, unlike other browsers, Firefox persists the dynamic disabled state of a across page loads. Setting the value of this attribute to off (i.e. autocomplete="off") disables this feature. See bug 654072. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-autofocus b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-autofocus deleted file mode 100644 index 6a6844e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-autofocus +++ /dev/null @@ -1,3 +0,0 @@ -autofocus [HTML5] - -This Boolean attribute lets you specify that the button should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-disable b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-disable deleted file mode 100644 index 5537ff0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-disable +++ /dev/null @@ -1,5 +0,0 @@ -disabled - -This Boolean attribute indicates that the user cannot interact with the button. If this attribute is not specified, the button inherits its setting from the containing element, for example ; if there is no containing element with the disabled attribute set, then the button is enabled. - -Firefox will, unlike other browsers, by default, persist the dynamic disabled state of a across page loads. Use the autocomplete attribute to control this feature. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-form b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-form deleted file mode 100644 index 472d2d7..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-form +++ /dev/null @@ -1,3 +0,0 @@ -form [HTML5] - -The form element that the button is associated with (its form owner). The value of the attribute must be the id attribute of a element in the same document. If this attribute is not specified, the element must be a descendant of a form element. This attribute enables you to place elements anywhere within a document, not just as descendants of their elements. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formaction b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formaction deleted file mode 100644 index e94ed4f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formaction +++ /dev/null @@ -1,3 +0,0 @@ -formaction [HTML5] - -The URI of a program that processes the information submitted by the button. If specified, it overrides the action attribute of the button's form owner. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formenctype b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formenctype deleted file mode 100644 index 1224cdb..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formenctype +++ /dev/null @@ -1,8 +0,0 @@ -formenctype [HTML5] - -If the button is a submit button, this attribute specifies the type of content that is used to submit the form to the server. Possible values are: - application/x-www-form-urlencoded: The default value if the attribute is not specified. - multipart/form-data: Use this value if you are using an element with the type attribute set to file. - text/plain - -If this attribute is specified, it overrides the enctype attribute of the button's form owner. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formmethod b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formmethod deleted file mode 100644 index 8c7802b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formmethod +++ /dev/null @@ -1,8 +0,0 @@ -formmethod [HTML5] - -If the button is a submit button, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are: - - post: The data from the form is included in the body of the form and is sent to the server. - get: The data from the form are appended to the form attribute URI, with a '?' as a separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters. - -If specified, this attribute overrides the method attribute of the button's form owner. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formtarget b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formtarget deleted file mode 100644 index 2751a5c..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formtarget +++ /dev/null @@ -1,7 +0,0 @@ -formtarget [HTML5] - -If the button is a submit button, this attribute is a name or keyword indicating where to display the response that is received after submitting the form. This is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). If this attribute is specified, it overrides the target attribute of the button's form owner. The following keywords have special meanings: - _self: Load the response into the same browsing context as the current one. This value is the default if the attribute is not specified. - _blank: Load the response into a new unnamed browsing context. - _parent: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self. - _top: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formvalidate b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formvalidate deleted file mode 100644 index 8d6d97b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-formvalidate +++ /dev/null @@ -1,3 +0,0 @@ -formvalidate [HTML5] - -If the button is a submit button, this Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the novalidate attribute of the button's form owner. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-name b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-name deleted file mode 100644 index 074c9dd..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-name +++ /dev/null @@ -1,3 +0,0 @@ -name - -The name of the button, which is submitted with the form data. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-type b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-type deleted file mode 100644 index c6a3af9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-type +++ /dev/null @@ -1,6 +0,0 @@ -type - -The type of the button. Possible values are: - submit: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is dynamically changed to an empty or invalid value. - reset: The button resets all the controls to their initial values. - button: The button has no default behavior. It can have client-side scripts associated with the element's events, which are triggered when the events occur. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-value b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-value deleted file mode 100644 index 55b4b86..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/button-value +++ /dev/null @@ -1,3 +0,0 @@ -value - -The initial value of the button. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-height b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-height deleted file mode 100644 index 8000b56..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-height +++ /dev/null @@ -1,3 +0,0 @@ -height - -The height of the coordinate space in CSS pixels. Defaults to 150. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-moz-opaque b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-moz-opaque deleted file mode 100644 index f62202a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-moz-opaque +++ /dev/null @@ -1,3 +0,0 @@ -moz-opaque - -Lets the canvas know whether or not translucency will be a factor. If the canvas knows there's no translucency, painting performance can be optimized. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-width b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-width deleted file mode 100644 index c97d63e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/canvas-width +++ /dev/null @@ -1,3 +0,0 @@ -width - -The width of the coordinate space in CSS pixels. Defaults to 300. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/caption-align b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/caption-align deleted file mode 100644 index d764381..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/caption-align +++ /dev/null @@ -1,10 +0,0 @@ -align [Deprecated since HTML4.01] [Obsolete since HTML5] - -This enumerated attribute indicates how the caption must be aligned with respect to the table. It may have the following values: - left, displayed to the left of the table - top, displayed before the the table - right, displayed to the right of the table - bottom, displayed under the table - -Usage note: -Do not use this attribute, as it has been deprecated: the element should be styled using CSS. To give a similar effect to the align attribute, use the the CSS properties caption-side and text-align. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/col-align b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/col-align deleted file mode 100644 index 718deac..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/col-align +++ /dev/null @@ -1,8 +0,0 @@ -align [Deprecated since HTML4.01] [Obsolete since HTML5] - -This enumerated attribute specifies how horizontal alignment of each column cell content will be handled. Possible values are: - left, aligning the content to the left of the cell - center, centering the content in the cell - right, aligning the content to the right of the cell - justify, inserting spaces into the textual content so that the content is justified in the cell - char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes Unimplemented (see bug 2212). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/col-span b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/col-span deleted file mode 100644 index ea3881f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/col-span +++ /dev/null @@ -1,3 +0,0 @@ -span - -This attribute contains a positive integer indicating the number of consecutive columns the element spans. If not present, its default value is 1. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/colgroup-span b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/colgroup-span deleted file mode 100644 index 913bee8..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/colgroup-span +++ /dev/null @@ -1,7 +0,0 @@ -span - -This attribute contains a positive integer indicating the number of consecutive columns the element spans. If not present, its default value is 1. - -Note: -This attribute is applied on the attributes of the column group, it has no effect on the CSS styling rules associated with it or, even more, to the cells of the column's members of the group. - The span attribute may not be present if there are one or more elements within the . \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/data-value b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/data-value deleted file mode 100644 index a2ab641..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/data-value +++ /dev/null @@ -1,9 +0,0 @@ -value - -This attribute specifies the machine-readable translation of the content of the element. - -Browser compatibility: - -Desktop: F - -Mobile: None. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dd-nowrap b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dd-nowrap deleted file mode 100644 index 4e65800..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dd-nowrap +++ /dev/null @@ -1,3 +0,0 @@ -nowrap [!] - -If the value of this attribute is set to yes, the definition text will not wrap. The default value is no. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/del-cite b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/del-cite deleted file mode 100644 index 3ef389b..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/del-cite +++ /dev/null @@ -1,3 +0,0 @@ -cite - -A URI for a resource that explains the change (for example, meeting minutes). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/del-datetime b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/del-datetime deleted file mode 100644 index bd70aa2..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/del-datetime +++ /dev/null @@ -1,3 +0,0 @@ -datetime - -This attribute indicates the time and date of the change and must be a valid date with an optional time string. If the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/details-open b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/details-open deleted file mode 100644 index be6dd09..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/details-open +++ /dev/null @@ -1,3 +0,0 @@ -open - -This Boolean attribute indicates whether the details will be shown to the user on page load. Default is false and so details will be hidden. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dfn-title b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dfn-title deleted file mode 100644 index 8ccf328..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dfn-title +++ /dev/null @@ -1,26 +0,0 @@ -dfn - -In HTML5, the title attribute has special meaning. - -Text to be displayed in a tooltip when hovering over the element. - -This attribute contains a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. Here are some typical uses of this attribute: - -Link: the title or a description of the linked document -Media element like an image: a description or associated credits -Paragraph: a footnote or a commentary about it -Quotation: some information about the author, and so on. - -If this attribute is omitted, it means that the title of the nearest ancestor of this element is still relevant for it (and can legitimately be used as the tooltip for that element. If this attribute is set to the empty string, it explicitly means that its nearest ancestor's title is not relevant for this element (and shouldn't be used in the tooltip for that element). - -Additional semantics are attached to the title attributes of the , , and elements. - -Usage note: -The title attribute may contains several lines. Each U+000A LINE FEED (LF) inserted represents such a newline. Some caution must be taken though, as that means that: - -Newlines in title should be taken into account,like this example. - -defines a two-line title. - -Support for multi-line titles was added to Gecko in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dialog-open b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dialog-open deleted file mode 100644 index 3a6f281..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dialog-open +++ /dev/null @@ -1,3 +0,0 @@ -open - -Indicates that the dialog is active and available for interaction. When the open attribute is not set, it shouldn't be shown to the user. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dl-compat b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dl-compat deleted file mode 100644 index 4f1657f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/dl-compat +++ /dev/null @@ -1,3 +0,0 @@ -compact [!] - -Forces the description to appear on the same line as the term. This attribute is currently unsupported \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-height b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-height deleted file mode 100644 index ae90936..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-height +++ /dev/null @@ -1,3 +0,0 @@ -height - -The displayed height of the resource, in CSS pixels. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-src b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-src deleted file mode 100644 index 6f4c4e6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-src +++ /dev/null @@ -1,3 +0,0 @@ -src - -The URL of the resource being embedded. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-type b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-type deleted file mode 100644 index 450512c..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-type +++ /dev/null @@ -1,3 +0,0 @@ -type - -The MIME type to use to select the plug-in to instantiate. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-width b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-width deleted file mode 100644 index 27ebcad..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/embed-width +++ /dev/null @@ -1,3 +0,0 @@ -width - -The displayed width of the resource, in CSS pixels. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-disabled b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-disabled deleted file mode 100644 index 10f0eb0..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-disabled +++ /dev/null @@ -1,3 +0,0 @@ -disabled [HTML5] - -If this Boolean attribute is set, the form controls that are its descendants, except descendants of its first optional element, are disabled, i.e., not editable. They won't receive any browsing events, like mouse clicks or focus-related ones. Often browsers display such controls as gray. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-form b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-form deleted file mode 100644 index be99b7f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-form +++ /dev/null @@ -1,3 +0,0 @@ -form [HTML5] - -This attribute has the value of the id attribute of the element its related to. Its default value is the id of the nearest element it is a descendant of. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-name b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-name deleted file mode 100644 index fff5724..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/fieldset-name +++ /dev/null @@ -1,5 +0,0 @@ -name [HTML5] - -The name associated with the group, which is submitted with the form data. - -The label for the field set is given by the first element that is a child of this field set. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-accept b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-accept deleted file mode 100644 index cf028bc..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-accept +++ /dev/null @@ -1,6 +0,0 @@ -accept [HTML4] [Trash] - -A comma-separated list of content types that the server accepts. - -Usage note: -This attribute has been removed in HTML5 and should no longer be used. Instead, use the accept attribute of the specific element. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-accept-charset b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-accept-charset deleted file mode 100644 index 75d3f15..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-accept-charset +++ /dev/null @@ -1,4 +0,0 @@ -accept-charset - -A space- or comma-delimited list of character encodings that the server accepts. The browser uses them in the order in which they are listed. The default value, the reserved string "UNKNOWN", indicates the same encoding as that of the document containing the form element. -In previous versions of HTML, the different character encodings could be delimited by spaces or commas. In HTML5, only spaces are allowed as delimiters. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-action b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-action deleted file mode 100644 index 612247d..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-action +++ /dev/null @@ -1,3 +0,0 @@ -action - -The URI of a program that processes the form information. This value can be overridden by a formaction attribute on a or element. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-autocapitalize b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-autocapitalize deleted file mode 100644 index 6339121..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-autocapitalize +++ /dev/null @@ -1,9 +0,0 @@ -autocapitalize [!] - -This is a nonstandard attribute used by iOS Safari Mobile which controls whether and how the text value for textual form control descendants should be automatically capitalized as it is entered/edited by the user. If the autocapitalize attribute is specified on an individual form control descendant, it trumps the form-wide autocapitalize setting. The non-deprecated values are available in iOS 5 and later. The default value is sentences. Possible values are: - none: Completely disables automatic capitalization - sentences: Automatically capitalize the first letter of sentences. - words: Automatically capitalize the first letter of words. - characters: Automatically capitalize all characters. - on: Deprecated since iOS 5. - off: Deprecated since iOS 5. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-autocomplete b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-autocomplete deleted file mode 100644 index a8d81e5..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-autocomplete +++ /dev/null @@ -1,8 +0,0 @@ -autocomplete [HTML5] - -Indicates whether input elements can by default have their values automatically completed by the browser. This setting can be overridden by an autocomplete attribute on an element belonging to the form. Possible values are: - off: The user must explicitly enter a value into each field for every use, or the document provides its own auto-completion method; the browser does not automatically complete entries. - on: The browser can automatically complete values based on values that the user has previously entered in the form. - -Note: -If you set autocomplete to off in a form because the document provides its own auto-completion, then you should also set autocomplete to off for each of the form's input elements that the document can auto-complete. For details, see Google Chrome notes. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-enctype b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-enctype deleted file mode 100644 index b5c3b6a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-enctype +++ /dev/null @@ -1,7 +0,0 @@ -enctype - -When the value of the method attribute is post, enctype is the MIME type of content that is used to submit the form to the server. Possible values are: - application/x-www-form-urlencoded: The default value if the attribute is not specified. - multipart/form-data: The value used for an element with the type attribute set to "file". - text/plain (HTML5) -This value can be overridden by a formenctype attribute on a or element. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-method b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-method deleted file mode 100644 index ec17df1..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-method +++ /dev/null @@ -1,6 +0,0 @@ -method - -The HTTP method that the browser uses to submit the form. Possible values are: - post: Corresponds to the HTTP POST method ; form data are included in the body of the form and sent to the server. - get: Corresponds to the HTTP GET method; form data are appended to the action attribute URI with a '?' as separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters. -This value can be overridden by a formmethod attribute on a or element. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-name b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-name deleted file mode 100644 index 26abb93..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-name +++ /dev/null @@ -1,3 +0,0 @@ -name - -The name of the form. In HTML 4,its use is deprecated (id should be used instead). It must be unique among the forms in a document and not just an empty string in HTML 5. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-novalidate b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-novalidate deleted file mode 100644 index 2a019de..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-novalidate +++ /dev/null @@ -1,3 +0,0 @@ -no-validate [HTML5] - -This Boolean attribute indicates that the form is not to be validated when submitted. If this attribute is not specified (and therefore the form is validated), this default setting can be overridden by a formnovalidate attribute on a or element belonging to the form. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-target b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-target deleted file mode 100644 index 275d210..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/form-target +++ /dev/null @@ -1,10 +0,0 @@ -target - -A name or keyword indicating where to display the response that is received after submitting the form. In HTML 4, this is the name/keyword for a frame. In HTML5, it is a name/keyword for a browsing context (for example, tab, window, or inline frame). The following keywords have special meanings: - _self: Load the response into the same HTML 4 frame (or HTML5 browsing context) as the current one. This value is the default if the attribute is not specified. - _blank: Load the response into a new unnamed HTML 4 window or HTML5 browsing context. - _parent: Load the response into the HTML 4 frameset parent of the current frame, or HTML5 parent browsing context of the current one. If there is no parent, this option behaves the same way as _self. - _top: HTML 4: Load the response into the full original window, and cancel all other frames. HTML5: Load the response into the top-level browsing context (i.e., the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self. - iframename: The response is displayed in a named . - -HTML5: This value can be overridden by a formtarget attribute on a or element. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-frameborder b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-frameborder deleted file mode 100644 index 7b963d7..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-frameborder +++ /dev/null @@ -1,3 +0,0 @@ -frameborder [Deprecated] - -This attribute allows you to put borders for frames. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-marginheight b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-marginheight deleted file mode 100644 index bcaadc9..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-marginheight +++ /dev/null @@ -1,3 +0,0 @@ -marginheight [Deprecated] - -This attribute defines how tall the margin between frames will be. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-marginwidth b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-marginwidth deleted file mode 100644 index 1dd5e84..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-marginwidth +++ /dev/null @@ -1,3 +0,0 @@ -marginwidth [Deprecated] - -This attribute defines how wide the margin between frames will be. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-name b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-name deleted file mode 100644 index 7a12024..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-name +++ /dev/null @@ -1,3 +0,0 @@ -name [Deprecated] - -This attribute is used to labeling frames. Without labeling all links will open in the frame that they are in. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-noresize b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-noresize deleted file mode 100644 index 7f281d4..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-noresize +++ /dev/null @@ -1,3 +0,0 @@ -noresize [Deprecated] - -This attribute avoid resizing of frames by users. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-scrolling b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-scrolling deleted file mode 100644 index be16226..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-scrolling +++ /dev/null @@ -1,3 +0,0 @@ -scrolling [Deprecated] - -This attribute defines existence of scrollbar. If this attribute is not used, browser put a scrollbar when necessary. There are two choices; "yes" for showing a scrollbar even when it is not necessary and "no" for do not showing a scrollbar even when it is necessary. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-src b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-src deleted file mode 100644 index 883c99e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frame-src +++ /dev/null @@ -1,3 +0,0 @@ -src [Deprecated] - -This attribute is specify document which will be displayed by frame. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frameset-cols b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frameset-cols deleted file mode 100644 index 9fd8a73..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frameset-cols +++ /dev/null @@ -1,3 +0,0 @@ -cols [Deprecated] - -This attribute is specify the number and size of horizontal spaces in a frameset. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frameset-rows b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frameset-rows deleted file mode 100644 index d4b1346..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/frameset-rows +++ /dev/null @@ -1,3 +0,0 @@ -rows [Deprecated] - -This attribute is specify the number and size of vertical spaces in a frameset. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-accesskey b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-accesskey deleted file mode 100644 index 2d84a36..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-accesskey +++ /dev/null @@ -1,9 +0,0 @@ -Defines a keyboard shortcut to activate or add focus to the element. - -This attribute provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters (one single Unicode code point). The browser should use the first one that exists on the computer keyboard layout. - -HTML4 Note: -In previous versions of HTML, only one character could be specified. Also it wasn't a global attribute and could be applied only to , , , , , and . - -Usage note: -The operation to activate the accesskey depends on browser and its platform. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-class b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-class deleted file mode 100644 index 47c070d..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-class +++ /dev/null @@ -1,6 +0,0 @@ -Often used with CSS to style elements with common properties. - -This attribute is a space-separated list of the classes of the element. Classes allows CSS and Javascript to select and access specific elements via the class selectors or functions like the DOM method document.getElementsByClassName. - -Usage note: -Though the specification doesn't put requirements on the name of classes, web developers are encouraged to use names that describe the semantic purpose of the element, rather to the presentation of the element (e.g., attribute to describe an attribute rather than italics, although an element of this class may be presented by italics). Semantic names remain logical even if the presentation of the page changes. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-contenteditable b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-contenteditable deleted file mode 100644 index 51709b6..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-contenteditable +++ /dev/null @@ -1,12 +0,0 @@ -Indicates whether the element's content is editable. - -This enumerated attribute indicates if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The attribute must take one of the following values: - -true or the empty string, which indicates that the element must be editable; - -false, which indicates that the element must not be editable. - -If this attribute is not set, its default value is inherited from its parent element. - -Usage note: -This attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true, false or the empty string is mandatory and that a shorthand like Example Label is not allowed. The correct usage is Example Label. diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-contextmenu b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-contextmenu deleted file mode 100644 index 34d752f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-contextmenu +++ /dev/null @@ -1,3 +0,0 @@ -Defines the ID of a element which will serve as the element's context menu. - -A context menu is a menu that appears upon user interaction, such as a right-click. HTML5 now allows us to customize this menu. Here are some implementation examples, including nested menus. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-data- b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-data- deleted file mode 100644 index d9908aa..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-data- +++ /dev/null @@ -1,9 +0,0 @@ -Lets you attach custom attributes to an HTML element. - -This class of attributes, called custom data attributes, allows proprietary information to be exchanged between the HTML and its DOM representation that may be used by scripts. All such custom data are available via the HTMLElement interface of the element the attribute is set on. The HTMLElement.dataset property gives access to them. -The * may be replaced by any name following the production rule of xml names with the following restrictions: - -the name must not start with xml, whatever case is used for these letters; -the name must not contain any semicolon (U+003A); -the name must not contain capital A to Z letters. -Note that the HTMLElement.dataset attribute is a StringMap and the name of the custom data attribute data-test-value will be accessible via HTMLElement.dataset.testValue as any dash (U+002D) is replaced by the capitalization of the next letter (camelcase). \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-dir b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-dir deleted file mode 100644 index b72fde3..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-dir +++ /dev/null @@ -1,14 +0,0 @@ -Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) - -This enumerated attribute indicates the directionality of the element's text. It can have the following values: - -ltr, which means left to right and is to be used for languages that are written from the left to the right (like English); -rtl, which means right to left and is to be used for languages that are written from the right to the left (like Arabic); -auto, which let the user agent decides. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then apply that directionality to the whole element. - -Usage notes: -This attribute is mandatory for the element where it has a different semantic meaning. -This attribute is not inherited by the element. If not set, its value is auto. -This attribute can be overridden by the CSS properties direction and unicode-bidi, if a CSS page is active and the element supports these properties. -As the directionality of the text is semantically related to its content and not to its presentation, it is recommended that web developers use this attribute instead of the related CSS properties when possible. That way, the text will display correctly even on a browser that doesn't support CSS or has the CSS deactivated. -The auto value should be used for data with an unknown directionality, like data coming from user input, eventually stored in a database. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-draggable b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-draggable deleted file mode 100644 index cc2b6df..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-draggable +++ /dev/null @@ -1,12 +0,0 @@ -Defines whether the element can be dragged. - -This enumerated attribute indicates whether the element can be dragged, using the Drag and Drop API. It can have the following values: - -true, which indicates that the element may be dragged. -false, which indicates that the element may not be dragged. - -If this attribute is not set, its default value is auto, meaning the behavior should be the one defined by default by the browser. - -Usage notes: -This attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true or false is mandatory and that a shorthand like Example Label is not allowed. The correct usage is Example Label. -By default, only text selections, images, and links can be dragged. For all others elements, the event ondragstart must be set in order to the drag and drop mechanism to work, as shown in this comprehensive example. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-dropzone b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-dropzone deleted file mode 100644 index f4c40f1..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-dropzone +++ /dev/null @@ -1,9 +0,0 @@ -Indicates that the element accept the dropping of content on it. - -HTML5. -Unimplemented. -This enumerated attribute indicates what types of content can be dropped on an element, using the Drag and Drop API. It can have the following values: - -copy, which indicates that dropping will create a copy of the element that was dragged -move, which indicates that the element that was dragged will be moved to this new location. -link, will create a link to the dragged data. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-hidden b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-hidden deleted file mode 100644 index f19a22e..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-hidden +++ /dev/null @@ -1,9 +0,0 @@ -Prevents rendering of given element, while keeping child elements, e.g. script elements, active. - -This Boolean attribute indicates that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. - -Usage notes: -This attribute must not be used to hide content that could legitimately be shown. For example, it shouldn't be used to hide tabs panels of a tabbed interface, as this is a styling decision and another style showing them would lead to a perfectly correct page. -Hidden elements shouldn't be linked from non-hidden elements. -Elements that are descendants of a hidden element are still active, which means that script elements can still execute and form elements can still submit. -Changing the display CSS value of an element with the hidden attribute overrides the behavior. For instance, an element styled display: flex will be displayed on screen regardless of the hidden attribute being present. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-id b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-id deleted file mode 100644 index aa696aa..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-id +++ /dev/null @@ -1,8 +0,0 @@ -id - -This attribute defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS). - -Usage note: -This attribute's value is an opaque string: this means that web author must not use it to convey any information. Particular meaning, for example semantic meaning, must not be derived from the string. -This attribute's value must not contain white spaces. Browsers treat non-conforming IDs that contains white spaces as if the white space is part of the ID. In contrast to the class attribute, which allows space-separated values, elements can only have one single ID defined through the id attribute. Note that an element may have several IDs, but the others should be set by another means, such as via a script interfacing with the DOM interface of the element. -Using characters except ASCII letters and digits, '_', '-' and '.' may cause compatibility problems, as they weren't allowed in HTML 4. Though this restriction has been lifted in HTML 5, an ID should start with a letter for compatibility. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-lang b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-lang deleted file mode 100644 index a75f38a..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-lang +++ /dev/null @@ -1,7 +0,0 @@ -Defines the language used in the element. - -This attribute participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. The tag contains one single entry value in the format defines in the Tags for Identifying Languages (BCP47) IETF document. If the tag content is the empty string the language is set to unknown; if the tag content is not valid, regarding to BCP47, it is set to invalid. - -Usage note: -Even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority. Read the algorithm determining the language of an element's content to see how the language is determined in all cases. -For the CSS pseudo-class :lang, two invalid language names are different if their names are different. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-spellcheck b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-spellcheck deleted file mode 100644 index 2de358f..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-spellcheck +++ /dev/null @@ -1,13 +0,0 @@ -Indicates whether spell checking is allowed for the element. - -This enumerated attribute defines whether the element may be checked for spelling errors. It may have the following values: - -true, which indicates that the element should be, if possible, checked for spelling errors; -false, which indicates that the element should not be checked for spelling errors. - -If this attribute is not set, its default value is element-type and browser-defined. This default value may also be inherited, which means that the element content will be checked for spelling errors only if its nearest ancestor has a spellcheck state of true. - -Usage note: -his attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true or false is mandatory and that a shorthand like Example Label is not allowed. The correct usage is Example Label. -This attribute is merely a hint for the browser: browsers are not required to be able to check for spelling errors. Typically non-editable elements are not checked for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking. -The default value of this attribute is browser and element-dependant. \ No newline at end of file diff --git a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-style b/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-style deleted file mode 100644 index 5ce6828..0000000 --- a/elpa/ac-html-20151005.731/completion-data/html-attributes-short-docs/global-style +++ /dev/null @@ -1,6 +0,0 @@ -Defines CSS styles which will override styles previously set. - -This attribute contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files. This attribute and the \"))" + :type '(repeat (symbol string string)) + :group 'multi-web-mode + :safe #'(lambda (tags) + (not (catch 'fail + (dolist (tag tags) + (when (or + (not (symbolp (mweb-get-tag-attr tag 'mode))) + (not (stringp (mweb-get-tag-attr tag 'open))) + (not (stringp (mweb-get-tag-attr tag 'close)))) + (throw 'fail t))))))) + +(defcustom mweb-submode-indent-offset 2 + "Indentation offset for code inside chunks." + :type 'integer + :group 'multi-web-mode + :safe 'integerp) + +(defcustom mweb-ignored-commands + (list + 'undo + 'yas/expand + 'yas/next-field-or-maybe-expand + 'isearch-forward + 'isearch-backward + 'isearch-other-control-char) + "Commands that prevent changing the major mode." + :type '(repeat symbol) + :group 'multi-web-mode + :safe #'(lambda (names) + (not (catch 'fail + (dolist (name names) + (when (not (symbolp name)) + (throw 'fail t))))))) + +(defun mweb-get-tag-attr (tag attribute) + "Get TAG ATTRIBUTE. +ATTRIBUTE values can be 'mode to get the tag's major mode or +'open/'close to get the open/close regexp respectively." + (case attribute + (mode (car tag)) + (open (cadr tag)) + (close (caddr tag)))) + +(defun mweb-get-tag (tag-major-mode) + "Return tag from `mweb-tags' matching TAG-MAJOR-MODE." + (assoc tag-major-mode mweb-tags)) + +(defun mweb--looking-at-tag (&optional type) + "Return non-nil if pointer is looking at an open or close tag. + +Possible values of TYPE are: + * nil: to check if point is looking at an open or close tag. + * 'open: to check if point is looking at an open tag + * 'close: to check if point is looking at a close tag" + (let ((index 0) + (looking) + (open-tag) + (close-tag) + (tag-regexp)) + (save-excursion + (back-to-indentation) + (while (and (< index (length mweb-tags)) + (not looking)) + (setq open-tag (mweb-get-tag-attr (elt mweb-tags index) 'open)) + (setq close-tag (mweb-get-tag-attr (elt mweb-tags index) 'close)) + (case type + (open (setq tag-regexp open-tag)) + (close (setq tag-regexp close-tag)) + (otherwise (setq tag-regexp (concat open-tag "\\|" close-tag)))) + (when (looking-at tag-regexp) + (setq looking t)) + (setq index (+ 1 index)))) + looking)) + +(defsubst mweb-looking-at-open-tag-p () + "Return t if point is looking at an open tag." + (mweb--looking-at-tag 'open)) + +(defsubst mweb-looking-at-close-tag-p () + "Return t if point is looking at a close tag." + (mweb--looking-at-tag 'close)) + +(defsubst mweb-looking-at-tag-p () + "Return t if point is looking at an open or close tag." + (mweb--looking-at-tag)) + +(defun mweb-change-major-mode () + "Call the appropriate major mode for the pointed chunk. +If the current `major-mode' is the correct one it doesn't funcall the +major mode and returns nil, otherwise changes the `major-mode' and +returns a symbol with its name." + (let ((closest-chunk-point 0) + (closest-chunk-mode mweb-default-major-mode) + (result nil)) + (save-restriction + (widen) + (dolist (tag mweb-tags) + (setq result (mweb-closest-starting-chunk-point tag)) + (when (and (integerp result) + (<= closest-chunk-point result)) + (setq closest-chunk-point result) + (setq closest-chunk-mode (mweb-get-tag-attr tag 'mode))))) + (when (not (equal closest-chunk-mode major-mode)) + (funcall closest-chunk-mode) + closest-chunk-mode))) + +(defun mweb-change-indent-line-function () + "Set the correct value for `indent-line-function'. +Depending of `major-mode'." + (when (not (equal major-mode mweb-default-major-mode)) + (setq indent-line-function 'mweb-indent-line))) + +(defun mweb-closest-starting-chunk-point (tag) + "Return the point of the closest chunk for TAG. +Where TAG is one of the tags contained in the `mweb-tags' +list. If the chunk is not found then it returns nil." + (let ((open-tag) + (close-tag)) + (save-excursion + (setq open-tag (re-search-backward (mweb-get-tag-attr tag 'open) nil t))) + (save-excursion + (setq close-tag (re-search-backward (mweb-get-tag-attr tag 'close) nil t))) + (cond ((not open-tag) + nil) + ((and open-tag + (not close-tag)) + open-tag) + ((> open-tag close-tag) + open-tag)))) + +(defun mweb-multiple-chunks-p () + "Check if multiple chunks exist in the current buffer." + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (re-search-forward "[^\s\t\n]" nil t) + (or (not (mweb-looking-at-open-tag-p)) + (catch 'break + (dolist (tag mweb-tags) + (when (re-search-forward (mweb-get-tag-attr tag 'close) nil t) + (throw 'break (not (not (re-search-forward "[^\s\t\n]" nil t))))))))))) + +(defun mweb-update-context () + "Update extra indentation value for chunks." + (let ((changed-major-mode (mweb-change-major-mode))) + (if (and changed-major-mode + (not (equal major-mode mweb-default-major-mode))) + (setq mweb-extra-indentation (mweb-calculate-indentation)) + (setq mweb-extra-indentation 0))) + (mweb-change-indent-line-function)) + +(defun mweb-calculate-indentation () + "Calculate the correct indentation given previous submode." + (let ((indentation 0) + (prev-line-pos) + (changed-major-mode major-mode) + (buffer-modified-flag (buffer-modified-p))) + (save-restriction + (widen) + (save-excursion + (mweb-goto-current-mode-open-tag) + (if (progn (mweb-forward-nonblank-line -1) (bobp)) + (if (mweb-multiple-chunks-p) + (setq indentation 0) + (setq indentation (- mweb-submode-indent-offset))) + (end-of-line) + (setq prev-line-pos (point-marker)) + (insert "\na") + (mweb-change-major-mode) + (indent-according-to-mode) + (setq indentation (current-indentation)) + (delete-region prev-line-pos (line-end-position)))) + (funcall changed-major-mode) + (set-buffer-modified-p buffer-modified-flag) + indentation))) + +(defun mweb-mark-whole-buffer () + "Multi-web-mode's version of `mark-whole-buffer'." + (interactive) + (push-mark (point)) + (goto-char (point-min)) + (mweb-change-major-mode) + (push-mark (point-max) nil t)) + +(defun mweb-indent-line () + "Function to use when indenting a submode line." + (interactive) + ;; Yes, indent according to mode will do what we expect + (setq mweb-extra-indentation (mweb-calculate-indentation)) + (if (not (mweb-looking-at-open-tag-p)) + (if (not (mweb-looking-at-close-tag-p)) + ;; Normal indentation + (if (equal major-mode mweb-default-major-mode) + (indent-according-to-mode) + (save-excursion + (beginning-of-line) + (delete-horizontal-space) + (unless (bobp) + (indent-according-to-mode) + (indent-to (+ mweb-extra-indentation mweb-submode-indent-offset))))) + ;; Close tag indentation routine + (let ((open-tag-indentation 0)) + (save-excursion + (mweb-goto-current-mode-open-tag) + (setq open-tag-indentation (current-indentation))) + (beginning-of-line) + (delete-horizontal-space) + (indent-to open-tag-indentation))) + ;; Open tag indentation routine + (beginning-of-line) + (delete-horizontal-space) + (insert "a") + (delete-horizontal-space) + (beginning-of-line) + (mweb-update-context) + (indent-according-to-mode) + (indent-to (+ mweb-extra-indentation mweb-submode-indent-offset)) + (delete-char 1)) + (and (bolp) (back-to-indentation))) + +(defun mweb-indent-region (start end) + "Indent a region taking care of chunks. +This routine considers the relative position of the chunks within +the buffer. It follows the same filosophy than +`mweb-indent-line-forward' because that function is what is used +to indent the chunks which are not for the default major mode. +Called from a program, START and END specify the region to indent." + (interactive "r") + (let ((delete-active-region nil) + (line-end)) + (save-excursion + (goto-char end) + (setq end (point-marker)) + (goto-char start) + (mweb-change-major-mode) + (or (bolp) (forward-line 1)) + (while (< (point) end) + (mweb-update-context) + (if (equal major-mode mweb-default-major-mode) + (indent-according-to-mode) + (mweb-indent-line)) + (forward-line 1)) + (move-marker end nil)))) + +(defun mweb-get-current-mode-tag-point (type) + "Gets the point marker of current chunk's open/close tag. + +The TYPE argument can be a 'open for the open tag or 'close for +the close tag." + (when (not (equal major-mode mweb-default-major-mode)) + (let ((index 0) + (found nil) + (tag) + (result nil) + (re-search-func (if (equal type 'open) + 're-search-backward + 're-search-forward))) + (while (and (< index (length mweb-tags)) + (not found)) + (setq tag (elt mweb-tags index)) + (when (or (equal (mweb-get-tag-attr tag 'mode) major-mode) + (equal major-mode mweb-default-major-mode)) + (setq found t) + (save-excursion + (if (looking-at (mweb-get-tag-attr tag type)) + (progn + (back-to-indentation) + (setq result (point))) + (setq result (funcall re-search-func + (mweb-get-tag-attr tag type) + nil t))))) + (setq index (+ 1 index))) + result))) + +(defun mweb-goto-current-mode-open-tag () + "Move the point to the open tag of the current chunk." + (interactive) + (let ((tag-point (mweb-get-current-mode-tag-point 'open))) + (when tag-point + (goto-char tag-point)))) + +(defun mweb-goto-current-mode-close-tag () + "Move the point to the close tag of the current chunk." + (interactive) + (let ((tag-point (mweb-get-current-mode-tag-point 'close))) + (when tag-point + (goto-char tag-point)))) + +(defun mweb-set-extra-indentation (number) + "Set the new value for `mweb-extra-indentation' to NUMBER." + (interactive "nNew mweb-extra-indentation value: ") + (setq mweb-extra-indentation number) + (message "mweb-extra-indentation = %d" mweb-extra-indentation)) + +(defun mweb-set-default-major-mode (major-mode) + "Set the new value for `mweb-default-major-mode' to MAJOR-MODE." + (interactive "CNew default major mode: ") + (setq mweb-default-major-mode major-mode) + (mweb-change-major-mode) + (message "mweb-default-major-mode = %s" mweb-default-major-mode)) + +(defun mweb-forward-nonblank-line (&optional number) + "Move the cursor to the next/previous non blank line. + +When NUMBER is positive it moves forward and when is negative +it moves backwards." + (when (not number) + (setq number 1)) + (when (> number 1) + (setq number 1)) + (when (< number -1) + (setq number -1)) + (forward-line number) + (while (and (equal (mweb-get-current-line-trimmed-contents) "") + (not (or (bobp) (eobp)))) + (forward-line number))) + +(defun mweb-get-current-line-trimmed-contents () + "Gets the contents of the current line. +It trims all space characters at the beginning and end of the line." + (let ((start-point) + (end-point) + (contents)) + (save-excursion + (beginning-of-line) + (setq start-point (point)) + (end-of-line) + (setq end-point (point)) + (setq contents (buffer-substring start-point end-point)) + (when (string-match "[ \t]*$" contents) + (setq contents (replace-match "" nil nil contents))) + (when (string-match "^[ \t]*" contents) + (setq contents (replace-match "" nil nil contents)))) + contents)) + +(defun mweb-post-command-hook () + "The function which is appended to the `post-command-hook'." + (when (and multi-web-mode + (not (region-active-p)) + (not (member last-command mweb-ignored-commands))) + (mweb-update-context))) + +(defun mweb-enable () + "Setup the minor mode." + (set (make-local-variable 'indent-region-function) + 'mweb-indent-region) + (make-local-variable 'indent-line-function) + (add-hook 'post-command-hook 'mweb-post-command-hook) + (assq-delete-all 'multi-web-mode minor-mode-map-alist) + (push (cons 'multi-web-mode mweb-mode-map) + minor-mode-map-alist) + (run-hooks 'mweb-mode-hook)) + +(defun mweb-disable () + "Disable the minor mode." + (assq-delete-all 'multi-web-mode minor-mode-map-alist)) + +;;;###autoload +(define-minor-mode multi-web-mode + "Enables the multi web mode chunk detection and indentation" + :lighter " Multi-Web" :group 'convenience + (if multi-web-mode + (mweb-enable) + (mweb-disable))) + +(defun multi-web-mode-maybe () + "Used to turn on the globalized minor mode." + (when (member + (file-name-extension (or buffer-file-name "")) + mweb-filename-extensions) + (multi-web-mode 1))) + +;;;###autoload +(define-globalized-minor-mode multi-web-global-mode + multi-web-mode multi-web-mode-maybe + :group 'multi-web-mode + :require 'multi-web-mode) + +(provide 'multi-web-mode) +;;; multi-web-mode.el ends here diff --git a/elpa/multi-web-mode-20130824.354/multi-web-mode.elc b/elpa/multi-web-mode-20130824.354/multi-web-mode.elc new file mode 100644 index 0000000..d1d18da Binary files /dev/null and b/elpa/multi-web-mode-20130824.354/multi-web-mode.elc differ diff --git a/elpa/multi-web-mode-20130824.354/mweb-example-config.el b/elpa/multi-web-mode-20130824.354/mweb-example-config.el new file mode 100644 index 0000000..7bd2ea3 --- /dev/null +++ b/elpa/multi-web-mode-20130824.354/mweb-example-config.el @@ -0,0 +1,7 @@ +(require 'multi-web-mode) +(setq mweb-default-major-mode 'html-mode) +(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>") + (js-mode "") + (css-mode ""))) +(setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5")) +(multi-web-global-mode 1) diff --git a/elpa/multi-web-mode-20130824.354/mweb-example-config.elc b/elpa/multi-web-mode-20130824.354/mweb-example-config.elc new file mode 100644 index 0000000..f827c08 Binary files /dev/null and b/elpa/multi-web-mode-20130824.354/mweb-example-config.elc differ diff --git a/elpa/web-mode-20200612.1038/web-mode-autoloads.el b/elpa/web-mode-20200612.1038/web-mode-autoloads.el deleted file mode 100644 index f319e69..0000000 --- a/elpa/web-mode-20200612.1038/web-mode-autoloads.el +++ /dev/null @@ -1,27 +0,0 @@ -;;; web-mode-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - - -;;;### (autoloads nil "web-mode" "web-mode.el" (0 0 0 0)) -;;; Generated autoloads from web-mode.el - -(autoload 'web-mode "web-mode" "\ -Major mode for editing web templates. - -\(fn)" t nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "web-mode" '("web-mode-"))) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; web-mode-autoloads.el ends here diff --git a/elpa/web-mode-20200612.1038/web-mode-pkg.el b/elpa/web-mode-20200612.1038/web-mode-pkg.el deleted file mode 100644 index 07a32a1..0000000 --- a/elpa/web-mode-20200612.1038/web-mode-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "web-mode" "20200612.1038" "major mode for editing web templates" '((emacs "23.1")) :commit "60ffd878c4371644bd964f00fea38054645e3e47" :keywords '("languages") :authors '(("François-Xavier Bois ")) :maintainer '("François-Xavier Bois") :url "http://web-mode.org") diff --git a/elpa/web-mode-20200612.1038/web-mode.el b/elpa/web-mode-20200612.1038/web-mode.el deleted file mode 100644 index 6626eb3..0000000 --- a/elpa/web-mode-20200612.1038/web-mode.el +++ /dev/null @@ -1,14312 +0,0 @@ -;;; web-mode.el --- major mode for editing web templates -;;; -*- coding: utf-8; lexical-binding: t; -*- - -;; Copyright 2011-2020 François-Xavier Bois - -;; Version: 17.0.0 -;; Package-Version: 20200612.1038 -;; Package-Commit: 60ffd878c4371644bd964f00fea38054645e3e47 -;; Author: François-Xavier Bois -;; Maintainer: François-Xavier Bois -;; Package-Requires: ((emacs "23.1")) -;; URL: http://web-mode.org -;; Repository: http://github.com/fxbois/web-mode -;; Created: July 2011 -;; Keywords: languages -;; License: GNU General Public License >= 2 -;; Distribution: This file is not part of Emacs - -;;; Commentary: - -;;============================================================================== -;; WEB-MODE is sponsored by ** Kernix ** Best Digital Factory & Data Lab (Paris) -;;============================================================================== - -;;; Code: - -;;---- CONSTS ------------------------------------------------------------------ - -(defconst web-mode-version "17.0.0" - "Web Mode version.") - -;;---- GROUPS ------------------------------------------------------------------ - -(defgroup web-mode nil - "Major mode for editing web templates" - :group 'languages - :prefix "web-" - :link '(url-link :tag "Site" "http://web-mode.org") - :link '(url-link :tag "Repository" "https://github.com/fxbois/web-mode")) - -(defgroup web-mode-faces nil - "Faces for syntax highlighting." - :group 'web-mode - :group 'faces) - -;;---- CUSTOMS ----------------------------------------------------------------- - -(defcustom web-mode-block-padding 0 - "Multi-line block (php, ruby, java, python, asp, etc.) left padding. - -1 to have to code aligned on the column 0." - :type '(choice (integer :tags "Number of spaces") - (const :tags "No indent" nil)) - :group 'web-mode) - -(defcustom web-mode-part-padding 1 - "Part elements (script, style) left padding." - :type '(choice (integer :tags "Number of spaces") - (const :tags "No indent" nil)) - :group 'web-mode) - -(defcustom web-mode-script-padding web-mode-part-padding - "Script element left padding." - :type '(choice (integer :tags "Number of spaces") - (const :tags "No indent" nil)) - :group 'web-mode) - -(defcustom web-mode-style-padding web-mode-part-padding - "Style element left padding." - :type '(choice (integer :tags "Number of spaces") - (const :tags "No indent" nil)) - :group 'web-mode) - -(defcustom web-mode-attr-indent-offset nil - "Html attribute indentation level." - :type '(choice (integer :tags "Number of spaces") - (const :tags "Default" nil)) - :safe #'(lambda (v) (or (integerp v) (booleanp v))) - :group 'web-mode) - -(defcustom web-mode-attr-value-indent-offset nil - "Html attribute value indentation level." - :type '(choice (integer :tags "Number of spaces") - (const :tags "Default" nil)) - :safe #'(lambda (v) (or (integerp v) (booleanp v))) - :group 'web-mode) - -(defcustom web-mode-markup-indent-offset - (if (and (boundp 'standard-indent) standard-indent) standard-indent 2) - "Html indentation level." - :type 'integer - :safe #'integerp - :group 'web-mode) - -(defcustom web-mode-css-indent-offset - (if (and (boundp 'standard-indent) standard-indent) standard-indent 2) - "CSS indentation level." - :type 'integer - :safe #'integerp - :group 'web-mode) - -(defcustom web-mode-code-indent-offset - (if (and (boundp 'standard-indent) standard-indent) standard-indent 2) - "Code (javascript, php, etc.) indentation level." - :type 'integer - :safe #'integerp - :group 'web-mode) - -(defcustom web-mode-sql-indent-offset 4 - "Sql (inside strings) indentation level." - :type 'integer - :safe #'integerp - :group 'web-mode) - -(defcustom web-mode-enable-css-colorization (display-graphic-p) - "In a CSS part, set background according to the color: #xxx, rgb(x,x,x)." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-comment-interpolation nil - "Enable highlight of keywords like FIXME, TODO, etc. in comments." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-comment-annotation nil - "Enable annotation in comments (jsdoc, phpdoc, etc.)." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-auto-indentation (display-graphic-p) - "Auto-indentation." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-auto-closing (display-graphic-p) - "Auto-closing." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-auto-pairing (display-graphic-p) - "Auto-pairing." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-auto-opening (display-graphic-p) - "Html element auto-opening." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-auto-quoting (display-graphic-p) - "Add double quotes after the character = in a tag." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-auto-expanding nil - "e.g. s/ expands to |." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-control-block-indentation t - "Control blocks increase indentation." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-current-element-highlight nil - "Enable current element highlight." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-current-column-highlight nil - "Show column for current element." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-whitespace-fontification nil - "Enable whitespaces." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-html-entities-fontification nil - "Enable html entities fontification." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-block-face nil - "Enable block face (useful for setting a background for example). -See web-mode-block-face." - :type 'boolean - :group 'web-mode) - -(defcustom web-mode-enable-part-face nil - "Enable part face (useful for setting background of ") - (cond - ((string-match-p " lang[ ]*=[ ]*[\"']stylus" style) - (setq element-content-type "stylus")) - ((string-match-p " lang[ ]*=[ ]*[\"']sass" style) - (setq element-content-type "sass")) - (t - (setq element-content-type "css")) - ) ;cond - ) ;let - ) ;style - ((string= tname "script") - (let (script) - (setq script (buffer-substring-no-properties tbeg tend) - part-close-tag "") - (cond - ((string-match-p " type[ ]*=[ ]*[\"']text/\\(jsx\\|babel\\)" script) - (setq element-content-type "jsx")) - ((string-match-p " type[ ]*=[ ]*[\"']text/\\(markdown\\|template\\)" script) - (setq element-content-type "markdown")) - ((string-match-p " type[ ]*=[ ]*[\"']text/ruby" script) - (setq element-content-type "ruby")) - ((seq-some (lambda (x) - (string-match-p (concat "type[ ]*=[ ]*[\"']" x) script)) - web-mode-script-template-types) - (setq element-content-type "html" - part-close-tag nil)) - ((string-match-p " type[ ]*=[ ]*[\"']application/\\(ld\\+json\\|json\\)" script) - (setq element-content-type "json")) - ((string-match-p " lang[ ]*=[ ]*[\"']\\(typescript\\|ts\\)" script) - (setq element-content-type "typescript")) - (t - (setq element-content-type "javascript")) - ) ;cond - ) ;let - ) ;script - ((and (string= tname "template") (string-match-p " lang" (buffer-substring-no-properties tbeg tend))) - (let (template) - (setq template (buffer-substring-no-properties tbeg tend) - part-close-tag "") - (cond - ((string-match-p " lang[ ]*=[ ]*[\"']pug" template) - (setq element-content-type "pug")) - (t - (setq element-content-type "html")) - ) ;cond - ) ;let - ) ;style - ((and (string= web-mode-engine "archibus") - (string= tname "sql")) - (setq element-content-type "sql" - part-close-tag "")) - ) - - (add-text-properties tbeg tend props) - (put-text-property tbeg (1+ tbeg) 'tag-beg flags) - (put-text-property (1- tend) tend 'tag-end t) - - (when (and part-close-tag - (web-mode-dom-sf part-close-tag reg-end t) - (setq part-beg tend) - (setq part-end (match-beginning 0)) - (> part-end part-beg)) - (put-text-property part-beg part-end 'part-side - (intern element-content-type web-mode-obarray)) - (setq tend part-end) - ) ;when - - (goto-char tend) - - ) ;while - - ))) - -;; FLAGS: attr -;; (1)custom-attr (2)engine-attr (4)spread-attr[jsx] (8)code-value - -;; STATES: attr -;; (0)nil (1)space (2)name (3)space-before (4)equal (5)space-after -;; (6)value-uq (7)value-sq (8)value-dq (9)value-bq : jsx attr={} - -(defun web-mode-attr-skip (limit) - - (let ((tag-flags 0) (attr-flags 0) (continue t) (attrs 0) (counter 0) (brace-depth 0) - (pos-ori (point)) (state 0) (equal-offset 0) (go-back nil) - (is-jsx (or (string= web-mode-content-type "jsx") (eq (get-text-property (point) 'part-type) 'jsx))) - attr name-beg name-end val-beg char pos escaped spaced quoted) - - (while continue - - (setq pos (point) - char (char-after) - ;;spaced (eq char ?\s) - spaced (member char '(?\s ?\n)) - ) - - (when quoted (setq quoted (1+ quoted))) - - (cond - - ((>= pos limit) - (setq continue nil) - (setq go-back t) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - ) - - ((or (and (= state 8) (not (member char '(?\" ?\\)))) - (and (= state 7) (not (member char '(?\' ?\\)))) - (and (= state 9) (not (member char '(?} ?\\)))) - ) - (when (and (= state 9) (eq char ?\{)) - (setq brace-depth (1+ brace-depth))) - ) - - ((and (= state 9) (eq char ?\}) (> brace-depth 1)) - (setq brace-depth (1- brace-depth))) - - ((get-text-property pos 'block-side) - (when (= state 2) - (setq name-end pos)) - ) - - ((and (= state 2) is-jsx (eq char ?\}) (eq attr-flags 4)) - (setq name-end pos) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 0 - attr-flags 0 - equal-offset 0 - name-beg nil - name-end nil - val-beg nil) - ) - - ((or (and (= state 8) (eq ?\" char) (not escaped)) - (and (= state 7) (eq ?\' char) (not escaped)) - (and (= state 9) (eq ?\} char) (= brace-depth 1)) - ) - - ;;(message "%S %S" (point) attr-flags) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 0 - attr-flags 0 - equal-offset 0 - name-beg nil - name-end nil - val-beg nil) - ) - - ((and (member state '(4 5)) (member char '(?\' ?\" ?\{))) - (setq val-beg pos) - (setq quoted 1) - (setq state (cond ((eq ?\' char) 7) - ((eq ?\" char) 8) - (t 9))) - (when (= state 9) - (setq brace-depth 1)) - ) - - ((and (eq ?\= char) (member state '(2 3))) - (setq equal-offset (- pos name-beg) - name-end (1- pos)) - (setq state 4) - (setq attr (buffer-substring-no-properties name-beg (1+ name-end))) - (when (and web-mode-indentless-attributes (member (downcase attr) web-mode-indentless-attributes)) - ;;(message "onclick") - (setq attr-flags (logior attr-flags 8))) - ) - - ((and spaced (= state 0)) - (setq state 1) - ) - - ((and (eq char ?\<) (not (member state '(7 8 9)))) - (setq continue nil) - (setq go-back t) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - ) - - ((and (eq char ?\>) (not (member state '(7 8 9)))) - (setq tag-flags (logior tag-flags 16)) - (when (eq (char-before) ?\/) - (setq tag-flags (logior tag-flags 8)) - ) - (setq continue nil) - (when name-beg - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset)))) - ) - - ((and spaced (member state '(1 3 5))) - ) - - ((and spaced (= state 2)) - (setq state 3) - ) - - ((and (eq char ?\/) (member state '(4 5))) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 1 - attr-flags 0 - equal-offset 0 - name-beg nil - name-end nil - val-beg nil) - ) - - ((and (eq char ?\/) (member state '(0 1))) - ) - - ((and spaced (= state 4)) - (setq state 5) - ) - - ((and (= state 3) - (or (and (>= char 97) (<= char 122)) ;a - z - (and (>= char 65) (<= char 90)) ;A - Z - (eq char ?\-))) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 2 - attr-flags 0 - equal-offset 0 - name-beg pos - name-end pos - val-beg nil) - ) - - ((and (eq char ?\n) (not (member state '(7 8 9)))) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 1 - attr-flags 0 - equal-offset 0 - name-beg nil - name-end nil - val-beg nil) - ) - - ((and (= state 6) (member char '(?\s ?\n ?\/))) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 1 - attr-flags 0 - equal-offset 0 - name-beg nil - name-end nil - val-beg nil) - ) - - ((and quoted (= quoted 2) (member char '(?\s ?\n ?\>))) - (when (eq char ?\>) - (setq tag-flags (logior tag-flags 16)) - (setq continue nil)) - (setq state 6) - (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) - (setq state 1 - attr-flags 0 - equal-offset 0 - name-beg nil - name-end nil - val-beg nil) - ) - - ((and (not spaced) (= state 1)) - (when (and is-jsx (eq char ?\{)) - (setq attr-flags 4)) - (setq state 2) - (setq name-beg pos - name-end pos) - ) - - ((member state '(4 5)) - (setq val-beg pos) - (setq state 6) - ) - - ((= state 1) - (setq state 2) - ) - - ((= state 2) - (setq name-end pos) - (when (and nil (= attr-flags 0) (member char '(?\- ?\:))) - (let (attr) - (setq attr (buffer-substring-no-properties name-beg (1+ name-end))) - (cond - ((member attr '("http-equiv")) - (setq attr-flags (1- attr-flags)) - ) - ;;((and web-mode-engine-attr-regexp - ;; (string-match-p web-mode-engine-attr-regexp attr)) - ;; (setq attr-flags (logior attr-flags 2)) - ;; ) - ((and (eq char ?\-) (not (string= attr "http-"))) - (setq attr-flags (logior attr-flags 1))) - ) ;cond - ) ;let - ) ;when attr-flags = 1 - ) ;state=2 - - ) ;cond - - ;;(message "point(%S) end(%S) state(%S) c(%S) name-beg(%S) name-end(%S) val-beg(%S) attr-flags(%S) equal-offset(%S)" pos end state char name-beg name-end val-beg attr-flags equal-offset) - - (when (and quoted (>= quoted 2)) - (setq quoted nil)) - - (setq escaped (eq ?\\ char)) - (when (null go-back) - (forward-char)) - - ) ;while - - (when (> attrs 0) (setq tag-flags (logior tag-flags 1))) - - tag-flags)) - -(defun web-mode-attr-scan (state char name-beg name-end val-beg flags equal-offset) - ;;(message "point(%S) state(%S) c(%c) name-beg(%S) name-end(%S) val-beg(%S) flags(%S) equal-offset(%S)" - ;; (point) state char name-beg name-end val-beg flags equal-offset) - (when (null flags) (setq flags 0)) - (when (and name-beg name-end web-mode-engine-attr-regexp) - (let (name) - (setq name (buffer-substring-no-properties name-beg (1+ name-end))) - ;;(message "%S" name) - (cond - ((string-match-p "^data[-]" name) - (setq flags (logior flags 1)) - ) - ((string-match-p web-mode-engine-attr-regexp name) - (setq flags (logior flags 2)) - ) - ) - ) ;name - ) - ;;(message "%S" name) - (cond - ((null name-beg) - ;; (message "name-beg is null (%S)" (point)) - 0) - ((or (and (= state 8) (not (eq ?\" char))) - (and (= state 7) (not (eq ?\' char)))) - (put-text-property name-beg (1+ name-beg) 'tag-attr-beg flags) - (put-text-property name-beg val-beg 'tag-attr t) - (put-text-property (1- val-beg) val-beg 'tag-attr-end equal-offset) - 1) - ((and (member state '(4 5)) (null val-beg)) - (put-text-property name-beg (1+ name-beg) 'tag-attr-beg flags) - (put-text-property name-beg (+ name-beg equal-offset 1) 'tag-attr t) - (put-text-property (+ name-beg equal-offset) (+ name-beg equal-offset 1) 'tag-attr-end equal-offset) - 1) - (t - (let (val-end) - (if (null val-beg) - (setq val-end name-end) - (setq val-end (point)) - (when (or (null char) (member char '(?\s ?\n ?\> ?\/))) - (setq val-end (1- val-end)) - ) - ) ;if - (put-text-property name-beg (1+ name-beg) 'tag-attr-beg flags) - (put-text-property name-beg (1+ val-end) 'tag-attr t) - (put-text-property val-end (1+ val-end) 'tag-attr-end equal-offset) - ) ;let - 1) ;t - ) ;cond - ) - -(defun web-mode-part-foreach (reg-beg reg-end func) - (let ((i 0) (continue t) (part-beg reg-beg) (part-end nil)) - (while continue - (setq part-end nil) - (unless (get-text-property part-beg 'part-side) - (setq part-beg (web-mode-part-next-position part-beg))) - (when (and part-beg (< part-beg reg-end)) - (setq part-end (web-mode-part-end-position part-beg))) - (cond - ((> (setq i (1+ i)) 100) - (message "process-parts ** warning (%S) **" (point)) - (setq continue nil)) - ((or (null part-end) (> part-end reg-end)) - (setq continue nil)) - (t - (setq part-end (1+ part-end)) - (funcall func part-beg part-end) - (setq part-beg part-end)) - ) ;cond - ) ;while - )) - -(defun web-mode-part-scan (reg-beg reg-end &optional content-type depth) - (save-excursion - (let (token-re ch-before ch-at ch-next token-type beg continue) - ;;(message "%S %S" reg-beg reg-end) - (cond - (content-type - ) - ((member web-mode-content-type web-mode-part-content-types) - (setq content-type web-mode-content-type)) - (t - (setq content-type (symbol-name (get-text-property reg-beg 'part-side)))) - ) ;cond - - (goto-char reg-beg) - - (cond - ((member content-type '("javascript" "json")) - (setq token-re "/\\|\"\\|'\\|`")) - ((member content-type '("typescript")) - (setq token-re "\"\\|'\\|`\\|//\\|/\\*")) - ((member content-type '("jsx")) - (setq token-re "/\\|\"\\|'\\|`\\|?[[:alpha:]>]")) - ((string= web-mode-content-type "css") - (setq token-re "\"\\|'\\|/\\*\\|//")) - ((string= content-type "css") - (setq token-re "\"\\|'\\|/\\*")) - (t - (setq token-re "/\\*\\|\"\\|'")) - ) - - (while (and token-re (< (point) reg-end) (web-mode-dom-rsf token-re reg-end t)) - - (setq beg (match-beginning 0) - token-type nil - continue t - ch-at (char-after beg) - ch-next (or (char-after (1+ beg)) ?\d) - ch-before (or (char-before beg) ?\d)) - - ;;(message "[%S>%S|%S] %S %c %c %c" reg-beg reg-end depth beg ch-before ch-at ch-next) - - (cond - - ((eq ?\' ch-at) - (while (and continue (search-forward "'" reg-end t)) - (cond - ((get-text-property (1- (point)) 'block-side) - (setq continue t)) - (t - (setq continue (web-mode-string-continue-p reg-beg))) - ) - ) ;while - (setq token-type 'string)) - - ((eq ?\` ch-at) - (while (and continue (search-forward "`" reg-end t)) - (cond - ((get-text-property (1- (point)) 'block-side) - (setq continue t)) - (t - (setq continue (web-mode-string-continue-p reg-beg))) - ) - ) ;while - (setq token-type 'string)) - - ((eq ?\" ch-at) - (while (and continue (search-forward "\"" reg-end t)) - (cond - ((get-text-property (1- (point)) 'block-side) - (setq continue t)) - (t - (setq continue (web-mode-string-continue-p reg-beg))) - ) ;cond - ) ;while - (cond - ((string= content-type "json") - (if (looking-at-p "[ ]*:") - (cond - ((eq ?\@ (char-after (1+ beg))) - (setq token-type 'context)) - (t - (setq token-type 'key)) - ) - (setq token-type 'string)) - ) ;json - (t - (setq token-type 'string)) - ) ;cond - ) - - ((and (eq ?\< ch-at) - (not (or (and (>= ch-before 97) (<= ch-before 122)) - (and (>= ch-before 65) (<= ch-before 90))))) - ;;(message "before [%S>%S|%S] pt=%S" reg-beg reg-end depth (point)) - (search-backward "<") - (if (web-mode-jsx-skip reg-end) - (web-mode-jsx-scan-element beg (point) depth) - (forward-char)) - ;;(message "after [%S>%S|%S] pt=%S" reg-beg reg-end depth (point)) - ) - - ((and (eq ?\/ ch-at) (member content-type '("javascript" "jsx"))) - (cond - ((eq ?\\ ch-before) - ) - ((eq ?\* ch-next) - ;;(message "--> %S %S" (point) reg-end) - (when (search-forward "*/" reg-end t) - (setq token-type 'comment)) - ) - ((eq ?\/ ch-next) - (setq token-type 'comment) - (goto-char (if (< reg-end (line-end-position)) reg-end (line-end-position))) - ) - ((and (looking-at-p ".*/") - (looking-back "\\(^\\|case\\|[[(,=:!&|?{};]\\)[ ]*/" (point-min))) - ;;(re-search-forward "/[gimyu]*" reg-end t)) - (let ((eol (line-end-position))) - (while (and continue (search-forward "/" eol t)) - (cond - ((get-text-property (1- (point)) 'block-side) - (setq continue t)) - ((looking-back "\\\\+/" reg-beg t) - (setq continue (= (mod (- (point) (match-beginning 0)) 2) 0))) - (t - (re-search-forward "[gimyu]*" eol t) - (setq token-type 'string) - (setq continue nil)) - ) - ) ;while - ) ;let - ) - ) ;cond - ) - - ((eq ?\/ ch-next) - ;;(message "%S" (point)) - (cond - ((and (string= content-type "css") - (eq ?/ ch-at) - (eq ?: ch-before)) - ) - (t - (unless (eq ?\\ ch-before) - (setq token-type 'comment) - (goto-char (if (< reg-end (line-end-position)) reg-end (line-end-position))) - ) - ) - ) - - ) - - ((eq ?\* ch-next) - (cond - ((search-forward "*/" reg-end t) - (setq token-type 'comment)) - ((not (eobp)) - (forward-char)) - ) ;cond - ) - - ) ;cond - - (when (and beg (>= reg-end (point)) token-type) - (put-text-property beg (point) 'part-token token-type) - (cond - ((eq token-type 'comment) - (put-text-property beg (1+ beg) 'syntax-table (string-to-syntax "<")) - (when (< (point) (point-max)) - (if (< (point) (line-end-position)) - (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax ">")) ;#445 - (put-text-property (point) (1+ (point)) 'syntax-table (string-to-syntax ">")) ;#377 - ) - ) ;when - ) ;comment - ((eq token-type 'string) - (put-text-property beg (1+ beg) 'syntax-table (string-to-syntax "|")) - (when (< (point) (point-max)) - (if (< (point) (line-end-position)) - (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "|")) - (put-text-property (point) (1+ (point)) 'syntax-table (string-to-syntax "|")) - ) - ) ;when - ) ;string - ) ;cond - ) ;when - - (when (> (point) reg-end) - (message "reg-beg(%S) reg-end(%S) token-type(%S) point(%S)" reg-beg reg-end token-type (point))) - - ;;(message "#[%S>%S|%S] %S %c %c %c | (%S)" reg-beg reg-end depth beg ch-before ch-at ch-next (point)) - - ) ;while - - ))) - -(defun web-mode-string-continue-p (reg-beg) - "Is `point' preceeded by an odd number of backslashes?" - (let ((p (1- (point)))) - (while (and (< reg-beg p) (eq ?\\ (char-before p))) - (setq p (1- p))) - (= (mod (- (point) p) 2) 0))) - -;; css rule = selector(s) + declaration (properties) -(defun web-mode-css-rule-next (limit) - (let (at-rule var-rule sel-beg sel-end dec-beg dec-end chunk) - (skip-chars-forward "\n\t ") - (setq sel-beg (point)) - (when (and (< (point) limit) - (web-mode-part-rsf "[{;]" limit)) - (setq sel-end (1- (point))) - (cond - ((eq (char-before) ?\{) - (setq dec-beg (point)) - (setq dec-end (web-mode-closing-paren-position (1- dec-beg) limit)) - (if dec-end - (progn - (goto-char dec-end) - (forward-char)) - (setq dec-end limit) - (goto-char limit)) - ) - (t - ) - ) ;cond - (setq chunk (buffer-substring-no-properties sel-beg sel-end)) - (cond - ((string-match "@\\([[:alpha:]-]+\\)" chunk) - (setq at-rule (match-string-no-properties 1 chunk))) - ((string-match "\\$\\([[:alpha:]-]+\\)" chunk) - (setq var-rule (match-string-no-properties 1 chunk))) - ) ;cond - ) ;when - (if (not sel-end) - (progn (goto-char limit) nil) - (list :at-rule at-rule - :var-rule var-rule - :sel-beg sel-beg - :sel-end sel-end - :dec-beg dec-beg - :dec-end dec-end) - ) ;if - )) - -(defun web-mode-css-rule-current (&optional pos part-beg part-end) - "Current CSS rule boundaries." - (unless pos (setq pos (point))) - (unless part-beg (setq part-beg (web-mode-part-beginning-position pos))) - (unless part-end (setq part-end (web-mode-part-end-position pos))) - (save-excursion - (let (beg end) - (goto-char pos) - (if (not (web-mode-part-sb "{" part-beg)) - (progn - (setq beg part-beg) - (if (web-mode-part-sf ";" part-end) - (setq end (1+ (point))) - (setq end part-end)) - ) ;progn - (setq beg (point)) - (setq end (web-mode-closing-paren-position beg part-end)) - (if end - (setq end (1+ end)) - (setq end (line-end-position))) -;; (message "%S >>beg%S >>end%S" pos beg end) - (if (> pos end) - - ;;selectors - (progn - (goto-char pos) - (if (web-mode-part-rsb "[};]" part-beg) - (setq beg (1+ (point))) - (setq beg part-beg) - ) ;if - (goto-char pos) - (if (web-mode-part-rsf "[{;]" part-end) - (cond - ((eq (char-before) ?\;) - (setq end (point)) - ) - (t - (setq end (web-mode-closing-paren-position (1- (point)) part-end)) - (if end - (setq end (1+ end)) - (setq end part-end)) - ) - ) ;cond - (setq end part-end) - ) - ) ;progn selectors - - ;; declaration - (goto-char beg) - (if (web-mode-part-rsb "[}{;]" part-beg) - (setq beg (1+ (point))) - (setq beg part-beg) - ) ;if - ) ;if > pos end - ) -;; (message "beg(%S) end(%S)" beg end) - (when (eq (char-after beg) ?\n) - (setq beg (1+ beg))) - (cons beg end) - ))) - -(defun web-mode-jsx-skip (reg-end) - (let ((continue t) (pos nil) (i 0) tag) - (looking-at "<\\([[:alpha:]][[:alnum:]:-]*\\)") - (setq tag (match-string-no-properties 1)) - ;;(message "point=%S tag=%S" (point) tag) - (save-excursion - (while continue - (cond - ((> (setq i (1+ i)) 1000) - (message "jsx-skip ** warning **") - (setq continue nil)) - ((looking-at "<[[:alpha:]][[:alnum:]:-]*[ ]*/>") - (goto-char (match-end 0)) - (setq pos (point)) - (setq continue nil)) - ((not (web-mode-dom-rsf ">\\([ \t\n]*[\];,)':}|&]\\)\\|{" reg-end)) - (setq continue nil) - ) - ((eq (char-before) ?\{) - (backward-char) - (web-mode-closing-paren reg-end) - (forward-char) - ) - (t - (setq continue nil) - (setq pos (match-beginning 1)) - ) ;t - ) ;cond - ) ;while - ) ;save-excursion - (when pos (goto-char pos)) - ;;(message "jsx-skip: %S" pos) - pos)) - -;; (defun web-mode-jsx-skip2 (reg-end) -;; (let ((continue t) (pos nil) (i 0) (tag nil) (regexp nil) (counter 1)) -;; (looking-at "<\\([[:alpha:]][[:alnum:]:-]*\\)") -;; (setq tag (match-string-no-properties 1)) -;; (setq regexp (concat "?" tag)) -;; ;;(message "point=%S tag=%S" (point) tag) -;; (save-excursion -;; (while continue -;; (cond -;; ((> (setq i (1+ i)) 100) -;; (message "jsx-skip ** warning **") -;; (setq continue nil)) -;; ((looking-at "<[[:alpha:]][[:alnum:]:-]*[ ]*/>") -;; (goto-char (match-end 0)) -;; (setq pos (point)) -;; (setq continue nil)) -;; ((not (web-mode-dom-rsf ">\\([ \t\n]*[\];,)':}]\\)\\|{" reg-end)) -;; (setq continue nil) -;; ) -;; ((eq (char-before) ?\{) -;; (backward-char) -;; (web-mode-closing-paren reg-end) -;; (forward-char) -;; ) -;; (t -;; (setq continue nil) -;; (setq pos (match-beginning 1)) -;; ) ;t -;; ) ;cond -;; ) ;while -;; ) ;save-excursion -;; (when pos (goto-char pos)) -;; ;;(message "jsx-skip: %S" pos) -;; pos)) - -;; http://facebook.github.io/jsx/ -;; https://github.com/facebook/jsx/blob/master/AST.md -(defun web-mode-jsx-scan-element (reg-beg reg-end depth) - (unless depth (setq depth 1)) - (save-excursion - (let (token-beg token-end regexp) - (goto-char reg-beg) - (put-text-property reg-beg (1+ reg-beg) 'jsx-beg depth) - (put-text-property (1- reg-end) reg-end 'jsx-end depth) - (put-text-property reg-beg reg-end 'jsx-depth depth) - (goto-char reg-beg) - (web-mode-scan-elements reg-beg reg-end) - (web-mode-jsx-scan-expression reg-beg reg-end (1+ depth)) - ))) - -(defun web-mode-jsx-scan-expression (reg-beg reg-end depth) - (let ((continue t) beg end) - (save-excursion - (goto-char reg-beg) - ;;(message "reg-beg=%S reg-end=%S" reg-beg reg-end) - (while (and continue (search-forward "{" reg-end t)) - (backward-char) - (setq beg (point) - end (web-mode-closing-paren reg-end)) - (cond - ((eq (get-text-property beg 'part-token) 'comment) - (forward-char)) - ((not end) - (setq continue nil)) - (t - (setq end (1+ end)) - (put-text-property beg end 'jsx-depth depth) - (put-text-property beg (1+ beg) 'jsx-beg depth) - (put-text-property (1- end) end 'jsx-end depth) - (web-mode-part-scan beg end "jsx" (1+ depth)) - ) ;t - ) ;cond - ) ;while - ) ;save-excursion - )) - -(defun web-mode-jsx-is-html (&optional pos) - (interactive) - (unless pos (setq pos (point))) - (let (ret (depth (get-text-property pos 'jsx-depth))) - (cond - ((or (null depth) (<= pos 2)) - (setq pos nil)) - ((and (= depth 1) (get-text-property pos 'jsx-beg)) - (setq pos nil)) - ((get-text-property pos 'tag-end) - (setq pos nil)) - ((get-text-property pos 'tag-attr-beg) - (setq pos nil)) - ((get-text-property pos 'jsx-beg) - (setq pos (null (get-text-property pos 'tag-beg)))) - ((setq pos (web-mode-jsx-depth-beginning-position pos)) - (setq pos (not (null (get-text-property pos 'tag-beg))))) - (t - (setq pos nil)) - ) ;cond - ;;(message "is-html: %S (depth=%S)" pos depth) - pos)) - -(defun web-mode-jsx-is-expr (&optional pos) - (cond - ((and (get-text-property pos 'jsx-beg) - (not (get-text-property pos 'tag-beg))) - nil) - (t - (setq pos (web-mode-jsx-depth-beginning-position pos)) - (null (get-text-property pos 'tag-beg))) - ) ;cond - ) - -(defun web-mode-jsx-depth-beginning-position (&optional pos target-depth) - (interactive) - (unless pos (setq pos (point))) - (unless target-depth (setq target-depth (get-text-property pos 'jsx-depth))) - (cond - ((or (null target-depth) (bobp)) - (setq pos nil)) - ((and (get-text-property pos 'jsx-beg) (= target-depth (get-text-property pos 'jsx-depth))) - ) - (t - (let ((continue t) depth) - (while continue - (setq pos (previous-single-property-change pos 'jsx-depth)) - (cond - ((or (null pos) - (null (setq depth (get-text-property pos 'jsx-depth)))) - (setq continue nil - pos nil)) - ((and (get-text-property pos 'jsx-beg) (= target-depth depth)) - (setq continue nil)) - ) ;cond - ) ;while - ) ;let - ) ;t - ) ;cond - ;;(message "beg: %S" pos) - pos) - -(defun web-mode-jsx-element-next (reg-end) - (let (continue beg end) - (setq beg (point)) - (unless (get-text-property beg 'jsx-depth) - (setq beg (next-single-property-change beg 'jsx-beg))) - (setq continue (and beg (< beg reg-end)) - end beg) - (while continue - (setq end (next-single-property-change end 'jsx-end)) - (cond - ((or (null end) (> end reg-end)) - (setq continue nil - end nil)) - ((eq (get-text-property end 'jsx-depth) 1) - (setq continue nil)) - (t - (setq end (1+ end))) - ) ;cond - ) ;while - ;;(message "beg=%S end=%S" beg end) - (if (and beg end (< beg end)) (cons beg end) nil))) - -(defun web-mode-jsx-expression-next (reg-end) - (let (beg end depth continue pos) - (setq beg (point)) - ;;(message "pt=%S" beg) - (unless (and (get-text-property beg 'jsx-beg) (null (get-text-property beg 'tag-beg))) - ;;(setq beg (next-single-property-change beg 'jsx-beg)) - (setq continue t - pos (1+ beg)) - (while continue - (setq pos (next-single-property-change pos 'jsx-beg)) - (cond - ((null pos) - (setq continue nil - beg nil)) - ((> pos reg-end) - (setq continue nil - beg nil)) - ((null (get-text-property pos 'jsx-beg)) - ) - ((null (get-text-property pos 'tag-beg)) - (setq continue nil - beg pos)) - ;;(t - ;; (setq pos (1+ pos))) - ) ;cond - ) ;while - ) ;unless - ;;(message "beg=%S" beg) - (when (and beg (< beg reg-end)) - (setq depth (get-text-property beg 'jsx-beg) - continue (not (null depth)) - pos beg) - ;;(message "beg=%S" beg) - (while continue - (setq pos (next-single-property-change pos 'jsx-end)) - ;;(message "pos=%S" pos) - (cond - ((null pos) - (setq continue nil)) - ((> pos reg-end) - (setq continue nil)) - ((eq depth (get-text-property pos 'jsx-end)) - (setq continue nil - end pos)) - (t - ;;(setq pos (1+ pos)) - ) - ) ;cond - ) ;while - ) ;when - ;;(message "%S > %S" beg end) - (if (and beg end) (cons beg end) nil))) - -(defun web-mode-jsx-depth-next (reg-end) - (let (beg end depth continue pos) - (setq beg (point)) - ;;(message "pt=%S" beg) - (unless (get-text-property beg 'jsx-beg) - ;;(setq beg (next-single-property-change beg 'jsx-beg)) - ;;(setq pos (1+ beg)) - (setq pos (next-single-property-change (1+ beg) 'jsx-beg)) - (cond - ((null pos) - (setq beg nil)) - ((>= pos reg-end) - (setq beg nil)) - (t - (setq beg pos)) - ) ;cond - ) ;unless - ;;(message "beg=%S" beg) - (when beg - (setq depth (get-text-property beg 'jsx-beg) - continue (not (null depth)) - pos beg) - ;;(message "beg=%S" beg) - (while continue - (setq pos (next-single-property-change pos 'jsx-end)) - ;;(message "pos=%S" pos) - (cond - ((null pos) - (setq continue nil)) - ((> pos reg-end) - (setq continue nil)) - ((eq depth (get-text-property pos 'jsx-end)) - (setq continue nil - end pos)) - (t - ;;(setq pos (1+ pos)) - ) - ) ;cond - ) ;while - ) ;when - ;;(message "%S > %S" beg end) - (if (and beg end) (cons beg end) nil))) - -(defun web-mode-jsx-beginning () - (interactive) - (let (depth (continue t) (reg-beg (point-min)) (pos (point))) - (setq depth (get-text-property pos 'jsx-depth)) - (cond - ((not depth) - ) - ((get-text-property (1- pos) 'jsx-beg) - (goto-char (1- pos))) - (t - (while continue - (setq pos (previous-single-property-change pos 'jsx-beg)) - ;;(message "pos=%S" pos) - (cond - ((null pos) - (setq continue nil)) - ((<= pos reg-beg) - (setq continue nil)) - ((eq depth (get-text-property pos 'jsx-beg)) - (setq continue nil)) - ) ;cond - ) ;while - (web-mode-go pos) - ) ;t - ) ;cond - )) - -(defun web-mode-jsx-end () - (interactive) - (let (depth (continue t) (reg-end (point-max)) (pos (point))) - (setq depth (get-text-property pos 'jsx-depth)) - (cond - ((not depth) - ) - ((get-text-property pos 'jsx-end) - (goto-char (+ pos 1))) - (t - (while continue - (setq pos (next-single-property-change pos 'jsx-end)) - ;;(message "pos=%S" pos) - (cond - ((null pos) - (setq continue nil)) - ((> pos reg-end) - (setq continue nil)) - ((eq depth (get-text-property pos 'jsx-end)) - (setq continue nil)) - ) ;cond - ) ;while - (web-mode-go pos 1) - ) ;t - ) ;cond - )) - -;;---- FONTIFICATION ----------------------------------------------------------- - -;; 1/ after-change -;; 2/ extend-region -;; 3/ scan -;; 4/ fontify -;; 5/ post-command - -(defun web-mode-extend-region () - ;;(message "extend-region: flb(%S) fle(%S) wmcb(%S) wmce(%S)" font-lock-beg font-lock-end web-mode-change-beg web-mode-change-end) - (cond - (web-mode-fontification-off - nil) - (t - (when (or (null web-mode-change-beg) (< font-lock-beg web-mode-change-beg)) - ;;(message "font-lock-beg(%S) < web-mode-change-beg(%S)" font-lock-beg web-mode-change-beg) - (setq web-mode-change-beg font-lock-beg)) - (when (or (null web-mode-change-end) (> font-lock-end web-mode-change-end)) - ;;(message "font-lock-end(%S) > web-mode-change-end(%S)" font-lock-end web-mode-change-end) - (setq web-mode-change-end font-lock-end)) - (let ((region (web-mode-scan web-mode-change-beg web-mode-change-end))) - (when region - ;;(message "region: %S" region) - (setq font-lock-beg (car region) - font-lock-end (cdr region)) - ) ;when - ) ;let - nil) ;t - )) - -(defun web-mode-fontify (limit) - ;;(message "fontify: point(%S) limit(%S) change-beg(%S) change-end(%S)" (point) limit web-mode-change-beg web-mode-change-end) - (cond - (web-mode-fontification-off - nil) - (t - (web-mode-with-silent-modifications - (save-excursion - (save-restriction - (save-match-data - (let ((beg (point)) - (buffer-undo-list t) - (end limit) - (inhibit-point-motion-hooks t) - (inhibit-quit t)) - (remove-list-of-text-properties beg end '(font-lock-face face)) - (cond - ((and (get-text-property beg 'block-side) - (not (get-text-property beg 'block-beg))) - (web-mode-fontify-block beg end)) - ((or (member web-mode-content-type web-mode-part-content-types) - (get-text-property beg 'part-side)) - (web-mode-fontify-part beg end) - (web-mode-block-foreach beg end 'web-mode-fontify-block)) - ((string= web-mode-engine "none") - (web-mode-fontify-tags beg end) - (web-mode-part-foreach beg end 'web-mode-fontify-part)) - (t - (web-mode-fontify-tags beg end) - (web-mode-part-foreach beg end 'web-mode-fontify-part) - (web-mode-block-foreach beg end 'web-mode-fontify-block)) - ) ;cond - (when web-mode-enable-element-content-fontification - (web-mode-fontify-elements beg end)) - (when web-mode-enable-whitespace-fontification - (web-mode-fontify-whitespaces beg end)) - ) ;let - )))) - nil) ;t - )) - -(defun web-mode-buffer-fontify () - (interactive) - (cond - ((and (fboundp 'font-lock-flush) global-font-lock-mode) - (font-lock-flush) - (font-lock-ensure)) - (t ;emacs 24 - ;;(font-lock-fontify-buffer) - (and global-font-lock-mode - (font-lock-fontify-region (point-min) (point-max)))) - )) - -(defun web-mode-unfontify-region (beg end) - ;;(message "unfontify: %S %S" beg end) - ) - -(defun web-mode-fontify-region (beg end keywords) -;; (message "beg=%S end=%S keywords=%S" beg end (symbol-name keywords)) - (save-excursion - (let ((font-lock-keywords keywords) - (font-lock-multiline nil) - (font-lock-keywords-case-fold-search - (member web-mode-engine '("archibus" "asp" "template-toolkit"))) - (font-lock-keywords-only t) - (font-lock-extend-region-functions nil)) - (when (and (listp font-lock-keywords) global-font-lock-mode) - (font-lock-fontify-region beg end) - ) - ))) - -(defun web-mode-fontify-tags (reg-beg reg-end &optional depth) - (let ((continue t)) - (goto-char reg-beg) - (when (and (not (get-text-property (point) 'tag-beg)) - (not (web-mode-tag-next))) - (setq continue nil)) - (when (and continue (>= (point) reg-end)) - (setq continue nil)) - (while continue - (cond - (depth - (when (eq depth (get-text-property (point) 'jsx-depth)) - (web-mode-fontify-tag)) - ) - (t - (web-mode-fontify-tag)) - ) ;cond - (when (or (not (web-mode-tag-next)) - (>= (point) reg-end)) - (setq continue nil)) - ) ;while - (when web-mode-enable-inlays - (when (null web-mode-inlay-regexp) - (setq web-mode-inlay-regexp (regexp-opt '("\\[" "\\(" "\\begin{align}")))) - (let (beg end expr) - (goto-char reg-beg) - (while (web-mode-dom-rsf web-mode-inlay-regexp reg-end) - (setq beg (match-beginning 0) - end nil - expr (substring (match-string-no-properties 0) 0 2)) - (setq expr (cond - ((string= expr "\\[") "\\]") - ((string= expr "\\(") "\\)") - (t "\\end{align}"))) - (when (and (web-mode-dom-sf expr reg-end) - (setq end (match-end 0)) - (not (text-property-any beg end 'tag-end t))) - (font-lock-append-text-property beg end 'font-lock-face 'web-mode-inlay-face) - ) ;when - ) ;while - ) ;let - ) ;when - (when web-mode-enable-html-entities-fontification - (let (beg end) - (goto-char reg-beg) - (while (web-mode-dom-rsf "&\\([#]?[[:alnum:]]\\{2,8\\}\\);" reg-end) - (setq beg (match-beginning 0) - end (match-end 0)) - (when (not (text-property-any beg end 'tag-end t)) - (font-lock-append-text-property beg end 'font-lock-face 'web-mode-html-entity-face) - ) ;when - ) ;while - ) ;let - ) ;when - )) - -(defun web-mode-fontify-tag (&optional beg end) - (unless beg (setq beg (point))) - (unless end (setq end (1+ (web-mode-tag-end-position beg)))) - (let (name type face flags slash-beg slash-end bracket-end) - (setq flags (get-text-property beg 'tag-beg) - type (get-text-property beg 'tag-type) - name (get-text-property beg 'tag-name)) - (setq bracket-end (> (logand flags 16) 0)) - (cond - ((eq type 'comment) - (put-text-property beg end 'font-lock-face 'web-mode-comment-face) - (when (and web-mode-enable-comment-interpolation (> (- end beg) 5)) - (web-mode-interpolate-comment beg end nil))) - ((eq type 'cdata) - (put-text-property beg end 'font-lock-face 'web-mode-doctype-face)) - ((eq type 'doctype) - (put-text-property beg end 'font-lock-face 'web-mode-doctype-face)) - ((eq type 'declaration) - (put-text-property beg end 'font-lock-face 'web-mode-doctype-face)) - (name - (setq slash-beg (> (logand flags 4) 0) - slash-end (> (logand flags 8) 0) - bracket-end (> (logand flags 16) 0)) - (setq face (cond - ((not bracket-end) 'web-mode-html-tag-unclosed-face) - ((and web-mode-enable-element-tag-fontification - (setq face (cdr (assoc name web-mode-element-tag-faces)))) - face) - ((> (logand flags 32) 0) 'web-mode-html-tag-namespaced-face) - ((> (logand flags 2) 0) 'web-mode-html-tag-custom-face) - (t 'web-mode-html-tag-face))) - (put-text-property beg (+ beg (if slash-beg 2 1)) - 'font-lock-face 'web-mode-html-tag-bracket-face) - (unless (string= name "_fragment_") - (put-text-property (+ beg (if slash-beg 2 1)) - (+ beg (if slash-beg 2 1) (length name)) - 'font-lock-face face)) - (when (or slash-end bracket-end) - (put-text-property (- end (if slash-end 2 1)) end 'font-lock-face 'web-mode-html-tag-bracket-face) - ) ;when - (when (> (logand flags 1) 0) - ;;(message "%S>%S" beg end) - (web-mode-fontify-attrs beg end)) - ) ;case name - ) ;cond - )) - -(defun web-mode-fontify-attrs (reg-beg reg-end) - (let ((continue t) (pos reg-beg) beg end flags offset face) - ;;(message "fontify-attrs %S>%S" reg-beg reg-end) - (while continue - (setq beg (web-mode-attribute-next-position pos reg-end)) - (cond - ((or (null beg) (>= beg reg-end)) - (setq continue nil)) - (t - (setq flags (or (get-text-property beg 'tag-attr-beg) 0)) - (setq face (cond - ((= (logand flags 1) 1) 'web-mode-html-attr-custom-face) - ((= (logand flags 2) 2) 'web-mode-html-attr-engine-face) - ((= (logand flags 4) 4) nil) - (t 'web-mode-html-attr-name-face))) - ;;(setq end (if (get-text-property beg 'tag-attr-end) beg (web-mode-attribute-end-position beg))) - (setq end (web-mode-attribute-end-position beg)) - ;;(message "beg=%S end=%S" beg end) - (cond - ((or (null end) (>= end reg-end)) - (setq continue nil)) - (t - (setq offset (get-text-property end 'tag-attr-end)) - (if (= offset 0) - (put-text-property beg (1+ end) 'font-lock-face face) - (put-text-property beg (+ beg offset) 'font-lock-face face) - (put-text-property (+ beg offset) (+ beg offset 1) - 'font-lock-face - 'web-mode-html-attr-equal-face) - (when (not (get-text-property (+ beg offset 1) 'jsx-beg)) - (put-text-property (+ beg offset 1) (1+ end) - 'font-lock-face - 'web-mode-html-attr-value-face) - ) - ) ;if offset - (setq pos (1+ end)) - ) ;t - ) ;cond - ) ;t - );cond - ) ;while - )) - -(defun web-mode-fontify-block (reg-beg reg-end) - (let (sub1 sub2 sub3 continue char keywords token-type face beg end (buffer (current-buffer))) - ;;(message "reg-beg=%S reg-end=%S" reg-beg reg-end) - - ;; NOTE: required for blocks inside tag attrs - (remove-list-of-text-properties reg-beg reg-end '(font-lock-face)) - - (goto-char reg-beg) - - (when (null web-mode-engine-font-lock-keywords) - (setq sub1 (buffer-substring-no-properties - reg-beg (+ reg-beg 1)) - sub2 (buffer-substring-no-properties - reg-beg (+ reg-beg 2)) - sub3 (buffer-substring-no-properties - reg-beg (+ reg-beg (if (>= (point-max) (+ reg-beg 3)) 3 2)))) - ) - - (cond - - ((and (get-text-property reg-beg 'block-beg) - (eq (get-text-property reg-beg 'block-token) 'comment)) - (put-text-property reg-beg reg-end 'font-lock-face 'web-mode-comment-face) - ) ;comment block - - (web-mode-engine-font-lock-keywords - (setq keywords web-mode-engine-font-lock-keywords) - ) - - ((string= web-mode-engine "django") - (cond - ((string= sub2 "{{") - (setq keywords web-mode-django-expr-font-lock-keywords)) - ((string= sub2 "{%") - (setq keywords web-mode-django-code-font-lock-keywords)) - )) ;django - - ((string= web-mode-engine "mako") - (cond - ((member sub3 '("<% " "<%\n" "<%!")) - (setq keywords web-mode-mako-block-font-lock-keywords)) - ((eq (aref sub2 0) ?\%) - (setq keywords web-mode-mako-block-font-lock-keywords)) - ((member sub2 '("<%" "")) - (setq keywords web-mode-mako-tag-font-lock-keywords)) - ((member sub2 '("${")) - (setq keywords web-mode-uel-font-lock-keywords)) - )) ;mako - - ((string= web-mode-engine "mason") - ;;(message "%S %S" sub2 sub3) - (cond - ((member sub3 '("<% " "<%\n" "<&|")) - (setq keywords web-mode-mason-code-font-lock-keywords)) - ((eq (aref sub2 0) ?\%) - (setq keywords web-mode-mason-code-font-lock-keywords)) - ((and (or (string= sub2 "<%") (string= sub3 "%")) - (not (member sub3 '("<%c" "<%i" "<%p")))) - (setq keywords web-mode-mason-block-font-lock-keywords)) - (t - (setq keywords web-mode-mason-code-font-lock-keywords)) - )) ;mason - - ((string= web-mode-engine "jsp") - (cond - ((string= sub3 "<%@") - (setq keywords web-mode-directive-font-lock-keywords)) - ((member sub2 '("${" "#{")) - (setq keywords web-mode-uel-font-lock-keywords)) - ((string= sub2 "<%") - (setq keywords web-mode-jsp-font-lock-keywords)) - )) ;jsp - - ((string= web-mode-engine "asp") - (cond - ((or (string= sub2 "<%") - (not (string= sub1 "<"))) - (setq keywords web-mode-asp-font-lock-keywords)) - (t - (setq keywords web-mode-engine-tag-font-lock-keywords)) - )) ;asp - - ((string= web-mode-engine "clip") - (setq keywords web-mode-engine-tag-font-lock-keywords) - ) ;clip - - ((string= web-mode-engine "aspx") - (cond - ((string= sub3 "<%@") - (setq keywords web-mode-directive-font-lock-keywords)) - ((string= sub3 "<%$") - (setq keywords web-mode-expression-font-lock-keywords)) - (t - (setq keywords web-mode-aspx-font-lock-keywords)) - )) ;aspx - - ((string= web-mode-engine "freemarker") - (cond - ((member sub2 '("${" "#{")) - (setq keywords web-mode-uel-font-lock-keywords)) - ((or (member sub2 '("<@" "[@" "<#" "[#")) - (member sub3 '("@" "[/@" "#" "[/#"))) - (setq keywords (if (eq ?\[ (aref sub2 0)) - web-mode-freemarker-square-font-lock-keywords - web-mode-freemarker-font-lock-keywords))) - (t - (setq keywords web-mode-engine-tag-font-lock-keywords)) - )) ;freemarker - - ) ;cond - - (when keywords - (web-mode-fontify-region reg-beg reg-end keywords) - (setq continue t) - (setq end reg-beg) - (while continue - (if (get-text-property end 'block-token) - (setq beg end) - (setq beg (next-single-property-change end 'block-token buffer reg-end))) - (setq end nil) - (when beg (setq char (char-after beg))) - (if (and beg (< beg reg-end)) - (progn - (setq token-type (get-text-property beg 'block-token)) - (setq face (cond - ((eq token-type 'string) 'web-mode-block-string-face) - ((eq token-type 'comment) 'web-mode-block-comment-face) - ((eq token-type 'symbol) 'web-mode-symbol-face) - (t 'web-mode-block-delimiter-face))) - (setq end (next-single-property-change beg 'block-token buffer reg-end)) -;; (message "end=%S" end) - (if (and end (<= end reg-end)) - (progn - ;;(message "%S > %S face(%S)" beg end face) - (remove-list-of-text-properties beg end '(face)) - (put-text-property beg end 'font-lock-face face) - ) - (setq continue nil - end nil) - ) ;if end - ) ;progn beg - (setq continue nil - end nil) - ) ;if beg - (when (and beg end) - (save-match-data - (when (and web-mode-enable-heredoc-fontification - (eq char ?\<) - (> (- end beg) 8) - ;;(progn (message "%S" (buffer-substring-no-properties beg end)) t) - (string-match-p "JS\\|JAVASCRIPT\\|HTM\\|CSS" (buffer-substring-no-properties beg end))) - (setq keywords - (cond - ((string-match-p "H" (buffer-substring-no-properties beg (+ beg 8))) - web-mode-html-font-lock-keywords) - (t - web-mode-javascript-font-lock-keywords) - )) - (web-mode-fontify-region beg end keywords) - )) -;; (message "%S %c %S beg=%S end=%S" web-mode-enable-string-interpolation char web-mode-engine beg end) - (when (and web-mode-enable-string-interpolation - (member char '(?\" ?\<)) - (member web-mode-engine '("php" "erb")) - (> (- end beg) 4)) - (web-mode-interpolate-block-string beg end) - ) ;when - (when (and web-mode-enable-comment-interpolation - (eq token-type 'comment) - (> (- end beg) 3)) - (web-mode-interpolate-comment beg end t) - ) ;when - (when (and web-mode-enable-comment-annotation - (eq token-type 'comment) - (> (- end beg) 3)) - (web-mode-annotate-comment beg end) - ) ;when - (when (and web-mode-enable-sql-detection - (eq token-type 'string) - (> (- end beg) 6) - ;;(eq char ?\<) - ;;(web-mode-looking-at-p (concat "[ \n]*" web-mode-sql-queries) (1+ beg)) - (web-mode-looking-at-p (concat "\\(.\\|<<<[[:alnum:]]+\\)[ \n]*" web-mode-sql-queries) beg) - ) - (web-mode-interpolate-sql-string beg end) - ) ;when - ) ;when beg end - ) ;while continue - ) ;when keywords - - ;;(when (and (member web-mode-engine '("jsp" "mako")) - (when (and (member web-mode-engine '("mako")) - (> (- reg-end reg-beg) 12) - (eq ?\< (char-after reg-beg))) - (web-mode-interpolate-block-tag reg-beg reg-end)) - - (when web-mode-enable-block-face -;; (message "block-face %S %S" reg-beg reg-end) - (font-lock-append-text-property reg-beg reg-end 'face 'web-mode-block-face)) - - )) - -(defun web-mode-fontify-part (reg-beg reg-end &optional depth) - (save-excursion - (let (start continue token-type face pos beg end string-face comment-face content-type) - ;;(message "fontify-part: reg-beg(%S) reg-end(%S)" reg-beg reg-end) - (if (member web-mode-content-type web-mode-part-content-types) - (setq content-type web-mode-content-type) - (setq content-type (symbol-name (get-text-property reg-beg 'part-side)))) - ;;(message "content-type=%S" content-type) - (unless depth - (when (string= content-type "jsx") (setq depth 0)) - ) - (setq string-face 'web-mode-part-string-face - comment-face 'web-mode-part-comment-face) - (cond - ((member content-type '("javascript" "jsx")) - (setq string-face 'web-mode-javascript-string-face - comment-face 'web-mode-javascript-comment-face) - (web-mode-fontify-region reg-beg reg-end web-mode-javascript-font-lock-keywords)) - ((string= content-type "json") - (setq string-face 'web-mode-json-string-face - comment-face 'web-mode-json-comment-face) - (web-mode-fontify-region reg-beg reg-end web-mode-javascript-font-lock-keywords)) - ((string= content-type "css") - (setq string-face 'web-mode-css-string-face - comment-face 'web-mode-css-comment-face) - (web-mode-fontify-css-rules reg-beg reg-end)) - ((string= content-type "sql") - (web-mode-fontify-region reg-beg reg-end web-mode-sql-font-lock-keywords)) - ((string= content-type "stylus") - (web-mode-fontify-region reg-beg reg-end web-mode-stylus-font-lock-keywords)) - ((string= content-type "sass") - (web-mode-fontify-region reg-beg reg-end web-mode-sass-font-lock-keywords)) - ((string= content-type "pug") - (web-mode-fontify-region reg-beg reg-end web-mode-pug-font-lock-keywords)) - ((string= content-type "markdown") - (web-mode-fontify-region reg-beg reg-end web-mode-markdown-font-lock-keywords)) - ((string= content-type "ruby") - (web-mode-fontify-region reg-beg reg-end web-mode-erb-font-lock-keywords)) - ((string= content-type "typescript") - (web-mode-fontify-region reg-beg reg-end web-mode-javascript-font-lock-keywords)) - ) ;cond - - (goto-char reg-beg) - - ;;(when (string= content-type "jsx") (web-mode-fontify-tags reg-beg reg-end)) - ;;(setq continue (and pos (< pos reg-end))) - (setq continue t - pos reg-beg) - (while continue - (if (get-text-property pos 'part-token) - (setq beg pos) - (setq beg (next-single-property-change pos 'part-token))) - (cond - ((or (null beg) (>= beg reg-end)) - (setq continue nil - end nil)) - ((and (eq depth 0) (get-text-property beg 'jsx-depth)) - (setq pos (or (next-single-property-change beg 'jsx-depth) (point-max)))) - (t - ;;(message "%c" (char-after beg)) - (setq token-type (get-text-property beg 'part-token)) - (setq face (cond - ((eq token-type 'string) string-face) - ((eq token-type 'comment) comment-face) - ((eq token-type 'context) 'web-mode-json-context-face) - ((eq token-type 'key) 'web-mode-json-key-face) - (t nil))) - (setq end (or (next-single-property-change beg 'part-token) (point-max)) - pos end) - (cond - ((or (null end) (> end reg-end)) - (setq continue nil - end nil)) - (t - (when face - (remove-list-of-text-properties beg end '(face)) - (put-text-property beg end 'font-lock-face face)) - (cond - ((< (- end beg) 6) - ) - ((eq token-type 'string) - (cond - ((and (eq (char-after beg) ?\`) - web-mode-enable-literal-interpolation - (member content-type '("javascript" "jsx"))) - (web-mode-interpolate-javascript-literal beg end) - ) - ((and (eq (char-after beg) ?\") - web-mode-enable-string-interpolation - (member content-type '("javascript" "jsx"))) - (web-mode-interpolate-javascript-string beg end)) - ) ;cond - ) ;case string - ((eq token-type 'comment) - (when web-mode-enable-comment-interpolation - (web-mode-interpolate-comment beg end t)) - (when web-mode-enable-comment-annotation - (web-mode-annotate-comment beg end)) - ) - ) ;cond - ) ;t - ) ;cond - ) ;t - ) ;cond - ) ;while - - (when (and (string= web-mode-content-type "html") web-mode-enable-part-face) - (font-lock-append-text-property reg-beg reg-end 'face - (cond - ((string= content-type "javascript") - 'web-mode-script-face) - ((string= content-type "css") - 'web-mode-style-face) - (t - 'web-mode-part-face))) - ) - - (when (and web-mode-enable-css-colorization (string= content-type "stylus")) - (goto-char reg-beg) - (while (and (re-search-forward "#[0-9a-fA-F]\\{6\\}\\|#[0-9a-fA-F]\\{3\\}\\|rgba?([ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)\\(.*?\\))" end t) - (<= (point) reg-end)) - (web-mode-colorize (match-beginning 0) (match-end 0)) - ) - ) - - (when (and (eq depth 0) (string= content-type "jsx")) - (let (pair elt-beg elt-end exp-beg exp-end exp-depth) - (goto-char reg-beg) - (while (setq pair (web-mode-jsx-element-next reg-end)) - ;;(message "elt-pair=%S" pair) - (setq elt-beg (car pair) - elt-end (cdr pair)) - (remove-list-of-text-properties elt-beg (1+ elt-end) '(face)) - (web-mode-fontify-tags elt-beg elt-end 1) - (goto-char elt-beg) - (while (setq pair (web-mode-jsx-expression-next elt-end)) - ;;(message "exp-pair=%S elt-end=%S" pair elt-end) - (setq exp-beg (car pair) - exp-end (cdr pair)) - (when (eq (char-after exp-beg) ?\{) - ;;(message "%S : %c %c" exp-beg (char-after (+ exp-beg 1)) (char-after (+ exp-beg 2))) - (cond - ;;((and (eq (char-after (+ exp-beg 1)) ?\/) (eq (char-after (+ exp-beg 2)) ?\*)) - ;; (put-text-property exp-beg (1+ exp-end) 'font-lock-face 'web-mode-part-comment-face) - ;; ) - (t - (setq exp-depth (get-text-property exp-beg 'jsx-depth)) - (remove-list-of-text-properties exp-beg exp-end '(font-lock-face)) - (put-text-property exp-beg (1+ exp-beg) 'font-lock-face 'web-mode-block-delimiter-face) - (when (and (eq (get-text-property exp-beg 'tag-attr-beg) 4) (web-mode-looking-at-p "\.\.\." (1+ exp-beg))) - (put-text-property exp-beg (+ exp-beg 4) 'font-lock-face 'web-mode-block-delimiter-face)) - (put-text-property exp-end (1+ exp-end) 'font-lock-face 'web-mode-block-delimiter-face) - (web-mode-fontify-tags (1+ exp-beg) exp-end (1+ exp-depth)) - (web-mode-fontify-part (1+ exp-beg) exp-end exp-depth) - (web-mode-fontify-region (1+ exp-beg) exp-end web-mode-javascript-font-lock-keywords) - ) ;t - ) ;cond - ) ;when - (goto-char (1+ exp-beg)) - ) ;while exp - - (when (and elt-beg web-mode-jsx-depth-faces) - (let (depth-beg depth-end jsx-face) - (goto-char elt-beg) - (while (setq pair (web-mode-jsx-depth-next reg-end)) - ;;(message "depth-pair=%S" pair) - (setq depth-beg (car pair) - depth-end (cdr pair) - depth (get-text-property depth-beg 'jsx-depth) - jsx-face (elt web-mode-jsx-depth-faces (1- depth))) - ;;(message "%S" jsx-face) - (font-lock-prepend-text-property depth-beg (1+ depth-end) 'face jsx-face) - (goto-char (+ depth-beg 2)) - ) - ) ;let - ) - - (goto-char (1+ elt-end)) - ) ;while elt - ) ;let - ) ;when - - ) ;let - ) ;save-excursion - ) - -(defun web-mode-fontify-css-rules (part-beg part-end) - (save-excursion - (goto-char part-beg) - (let (rule (continue t) (i 0) (at-rule nil) (var-rule nil)) - (while continue - (setq rule (web-mode-css-rule-next part-end)) - ;;(message "rule=%S" rule) - (cond - ((> (setq i (1+ i)) 1000) - (message "fontify-css-rules ** too much rules **") - (setq continue nil)) - ((null rule) - (setq continue nil)) - ((and (setq at-rule (plist-get rule :at-rule)) - (not (member at-rule '("charset" "font-face" "import" "viewport"))) - (plist-get rule :dec-end)) - (web-mode-fontify-css-rule (plist-get rule :sel-beg) - (plist-get rule :sel-end) - nil nil) - (web-mode-fontify-css-rules (plist-get rule :dec-beg) - (plist-get rule :dec-end))) - (t - (web-mode-fontify-css-rule (plist-get rule :sel-beg) - (plist-get rule :sel-end) - (plist-get rule :dec-beg) - (plist-get rule :dec-end))) - ) ;cond - ) ;while - ) ;let - )) - -(defun web-mode-fontify-css-rule (sel-beg sel-end dec-beg dec-end) - (save-excursion - ;;(let ((end sel-end)) - ;;(message "sel-beg=%S sel-end=%S dec-beg=%S dec-end=%S" sel-beg sel-end dec-beg dec-end) - (web-mode-fontify-region sel-beg sel-end web-mode-selector-font-lock-keywords) - (when (and dec-beg dec-end) - ;;(setq end dec-end) - (web-mode-fontify-region dec-beg dec-end web-mode-declaration-font-lock-keywords) - ) ;when - (when (and dec-beg dec-end) - (goto-char dec-beg) - (while (and web-mode-enable-css-colorization - (re-search-forward "#[0-9a-fA-F]\\{6\\}\\|#[0-9a-fA-F]\\{3\\}\\|rgba?([ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)\\(.*?\\))" dec-end t) - ;;(progn (message "%S %S" end (point)) t) - (<= (point) dec-end)) - (web-mode-colorize (match-beginning 0) (match-end 0)) - ) ;while - ) ;when - ;;) ;let - )) - -(defun web-mode-colorize-foreground (color) - (let* ((values (x-color-values color)) - (r (car values)) - (g (cadr values)) - (b (car (cdr (cdr values))))) - (if (> 128.0 (floor (+ (* .3 r) (* .59 g) (* .11 b)) 256)) - "white" "black"))) - -(defun web-mode-colorize (beg end) - (let (str plist len) - (setq str (buffer-substring-no-properties beg end)) - (setq len (length str)) - (cond - ((string= (substring str 0 1) "#") - (setq plist (list :background str - :foreground (web-mode-colorize-foreground str))) - (put-text-property beg end 'face plist)) - ((or (string= (substring str 0 4) "rgb(") (string= (substring str 0 5) "rgba(")) - (setq str (format "#%02X%02X%02X" - (string-to-number (match-string-no-properties 1)) - (string-to-number (match-string-no-properties 2)) - (string-to-number (match-string-no-properties 3)))) - (setq plist (list :background str - :foreground (web-mode-colorize-foreground str))) - (put-text-property beg end 'face plist)) - ) ;cond - )) - -(defun web-mode-interpolate-block-tag (beg end) - (save-excursion - (goto-char (+ 4 beg)) - (setq end (1- end)) - (while (re-search-forward "${.*?}" end t) - (remove-list-of-text-properties (match-beginning 0) (match-end 0) '(face)) - (web-mode-fontify-region (match-beginning 0) (match-end 0) - web-mode-uel-font-lock-keywords)) - )) - -(defun web-mode-interpolate-javascript-string (beg end) - (save-excursion - (goto-char (1+ beg)) - (setq end (1- end)) - (while (re-search-forward "${.*?}" end t) - (put-text-property (match-beginning 0) (match-end 0) - 'font-lock-face - 'web-mode-variable-name-face) - ) - )) - -(defun web-mode-interpolate-javascript-literal (beg end) - (save-excursion - (goto-char (1+ beg)) - (setq end (1- end)) - (while (re-search-forward "${.*?}" end t) - (put-text-property (match-beginning 0) (match-end 0) - 'font-lock-face - 'web-mode-variable-name-face) - ) - (cond - ((web-mode-looking-back "\\(css\\|styled[[:alnum:].]+\\)" beg) - (goto-char (1+ beg)) - (while (re-search-forward ".*?:" end t) - (put-text-property (match-beginning 0) (match-end 0) - 'font-lock-face - 'web-mode-interpolate-color1-face) - ) - ) ;case css - ((web-mode-looking-back "\\(template\\|html\\)" beg) - (goto-char (1+ beg)) - (while (re-search-forward web-mode-tag-regexp end t) - (put-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-interpolate-color1-face) - ) - (goto-char (1+ beg)) - (while (re-search-forward "?\\|/?>\\| [[:alnum:]]+=" end t) - (cond - ((member (char-after (match-beginning 0)) '(?\< ?\/ ?\>)) - (put-text-property (match-beginning 0) (match-end 0) - 'font-lock-face - 'web-mode-interpolate-color2-face) - ) - (t - (put-text-property (1+ (match-beginning 0)) (1- (match-end 0)) - 'font-lock-face - 'web-mode-interpolate-color3-face) - ) ;t - ) ;cond - ) ;while - ) ;case html - ) ;cond type of literal - )) - -;; todo : parsing plus compliqué: {$obj->values[3]->name} -(defun web-mode-interpolate-block-string (beg end) - (save-excursion - (goto-char (1+ beg)) - (setq end (1- end)) - (cond - ((string= web-mode-engine "php") - (while (re-search-forward "$[[:alnum:]_]+\\(->[[:alnum:]_]+\\)*\\|{[ ]*$.+?}" end t) -;; (message "%S > %S" (match-beginning 0) (match-end 0)) - (remove-list-of-text-properties (match-beginning 0) (match-end 0) '(font-lock-face)) - (web-mode-fontify-region (match-beginning 0) (match-end 0) - web-mode-php-var-interpolation-font-lock-keywords) - )) - ((string= web-mode-engine "erb") - (while (re-search-forward "#{.*?}" end t) - (remove-list-of-text-properties (match-beginning 0) (match-end 0) '(font-lock-face)) - (put-text-property (match-beginning 0) (match-end 0) - 'font-lock-face 'web-mode-variable-name-face) - )) - ) ;cond - )) - -(defun web-mode-interpolate-comment (beg end block-side) - (save-excursion - (let ((regexp (concat "\\_<\\(" web-mode-comment-keywords "\\)\\_>"))) - (goto-char beg) - (while (re-search-forward regexp end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-comment-keyword-face) - ) ;while - ))) - -(defun web-mode-annotate-comment (beg end) - (save-excursion - ;;(message "beg=%S end=%S" beg end) - (goto-char beg) - (when (looking-at-p "/\\*\\*") - (while (re-search-forward "\\(.+\\)" end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-annotation-face)) - (goto-char beg) - (while (re-search-forward "[ ]+\\({[^}]+}\\)" end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-annotation-type-face)) - (goto-char beg) - (while (re-search-forward "\\(@[[:alnum:]]+\\)" end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-annotation-tag-face)) - (goto-char beg) - (while (re-search-forward "}[[:blank:]]+\\([[:graph:]]+\\)" end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-annotation-value-face)) - (goto-char beg) - (while (re-search-forward "@see[[:blank:]]+\\([[:graph:]]+\\)" end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-annotation-value-face)) - (goto-char beg) - (while (re-search-forward "{\\(@\\(?:link\\|code\\)\\)\\s-+\\([^}\n]+\\)\\(#.+\\)?}" end t) - (font-lock-prepend-text-property (match-beginning 2) (match-end 2) - 'font-lock-face - 'web-mode-annotation-value-face)) - (goto-char beg) - (while (re-search-forward "\\(?\\)\\([[:alnum:]]+\\)\\s-*\\(/?>\\)" end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-annotation-html-face) - (font-lock-prepend-text-property (match-beginning 2) (match-end 2) - 'font-lock-face - 'web-mode-annotation-html-face) - (font-lock-prepend-text-property (match-beginning 3) (match-end 3) - 'font-lock-face - 'web-mode-annotation-html-face)) - ) ;when - )) - -(defun web-mode-interpolate-sql-string (beg end) - (save-excursion - (let ((case-fold-search t) - (regexp (concat "\\_<\\(" web-mode-sql-keywords "\\)\\_>"))) - (goto-char beg) - (while (re-search-forward regexp end t) - (font-lock-prepend-text-property (match-beginning 1) (match-end 1) - 'font-lock-face - 'web-mode-sql-keyword-face) - ) ;while - ))) - -;;---- EFFECTS ----------------------------------------------------------------- - -(defun web-mode-fill-paragraph (&optional justify) - (save-excursion - (let ((pos (point)) fill-coll - prop pair beg end delim-beg delim-end chunk fill-col) - (cond - ((or (eq (get-text-property pos 'part-token) 'comment) - (eq (get-text-property pos 'block-token) 'comment)) - (setq prop - (if (get-text-property pos 'part-token) 'part-token 'block-token)) - (setq pair (web-mode-property-boundaries prop pos)) - (when (and pair (> (- (cdr pair) (car pair)) 6)) - (setq fill-coll (if (< fill-column 10) 70 fill-column)) - (setq beg (car pair) - end (cdr pair)) - (goto-char beg) - (setq chunk (buffer-substring-no-properties beg (+ beg 2))) - (cond - ((string= chunk "//") - (setq delim-beg "//" - delim-end "EOL")) - ((string= chunk "/*") - (setq delim-beg "/*" - delim-end "*/")) - ((string= chunk "{#") - (setq delim-beg "{#" - delim-end "#}")) - ((string= chunk "")) - ) - ) - ) ;comment - case - ((web-mode-is-content) - (setq pair (web-mode-content-boundaries pos)) - (setq beg (car pair) - end (cdr pair)) - ) - ) ;cond - ;;(message "beg(%S) end(%S)" beg end) - (when (and beg end) - (fill-region beg end)) - t))) - -(defun web-mode-engine-syntax-check () - (interactive) - (let ((proc nil) (errors nil) - (file (concat temporary-file-directory "emacs-web-mode-tmp"))) - (write-region (point-min) (point-max) file) - (cond - ;; ((null (buffer-file-name)) - ;; ) - ((string= web-mode-engine "php") - (setq proc (start-process "php-proc" nil "php" "-l" file)) - (set-process-filter - proc - (lambda (proc output) - (cond - ((string-match-p "No syntax errors" output) - (message "No syntax errors") - ) - (t - ;; (setq output (replace-regexp-in-string temporary-file-directory "" output)) - ;; (message output) - (message "Syntax error") - (setq errors t)) - ) ;cond - ;; (delete-file file) - ) ;lambda - ) - ) ;php - (t - (message "no syntax checker found") - ) ;t - ) ;cond - errors)) - -(defun web-mode-jshint () - "Run JSHint on all the JavaScript parts." - (interactive) - (let (proc lines) - (when (buffer-file-name) - (setq proc (start-process - "jshint-proc" - nil - (or (executable-find "jshint") "/usr/local/bin/jshint") - "--extract=auto" - (buffer-file-name))) - (setq web-mode-jshint-errors 0) - (set-process-filter proc - (lambda (proc output) - (let ((offset 0) overlay pos (old 0) msg) - (remove-overlays (point-min) (point-max) 'font-lock-face 'web-mode-error-face) - (while (string-match - "line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)\\.$" - output offset) - (setq web-mode-jshint-errors (1+ web-mode-jshint-errors)) - (setq offset (match-end 0)) - (setq pos (web-mode-coord-position - (match-string-no-properties 1 output) - (match-string-no-properties 2 output))) - (when (get-text-property pos 'tag-beg) - (setq pos (1- pos))) - (when (not (= pos old)) - (setq old pos) - (setq overlay (make-overlay pos (1+ pos))) - (overlay-put overlay 'font-lock-face 'web-mode-error-face) - ) - (setq msg (or (overlay-get overlay 'help-echo) - (concat "line=" - (match-string-no-properties 1 output) - " column=" - (match-string-no-properties 2 output) - ))) - (overlay-put overlay 'help-echo - (concat msg " ## " (match-string-no-properties 3 output))) - ) ;while - )) - ) - ) ;when - )) - -(defun web-mode-dom-errors-show () - "Show unclosed tags." - (interactive) - (let (beg end tag pos l n tags i cont cell overlay overlays first - (ori (point)) - (errors 0) - (continue t) - ) - (setq overlays (overlays-in (point-min) (point-max))) - (when overlays - (dolist (overlay overlays) - (when (eq (overlay-get overlay 'face) 'web-mode-warning-face) - (delete-overlay overlay) - ) - ) - ) - (goto-char (point-min)) - (when (not (or (get-text-property (point) 'tag-beg) - (web-mode-tag-next))) - (setq continue nil)) - (while continue - (setq pos (point)) - (setq tag (get-text-property pos 'tag-name)) - (cond - ((eq (get-text-property (point) 'tag-type) 'start) - (setq tags (add-to-list 'tags (list tag pos))) -;; (message "(%S) opening %S" pos tag) - ) - ((eq (get-text-property (point) 'tag-type) 'end) - (setq i 0 - l (length tags) - cont t) - (while (and (< i l) cont) - (setq cell (nth i tags)) -;; (message "cell=%S" cell) - (setq i (1+ i)) - (cond - ((string= tag (nth 0 cell)) - (setq cont nil) - ) - (t - (setq errors (1+ errors)) - (setq beg (nth 1 cell)) - (setq end (web-mode-tag-end-position beg)) - (unless first - (setq first beg)) - (setq overlay (make-overlay beg (1+ end))) - (overlay-put overlay 'font-lock-face 'web-mode-warning-face) -;; (message "invalid <%S> at %S" (nth 0 cell) (nth 1 cell)) - ) - ) ;cond - ) ;while - - (dotimes (i i) - (setq tags (cdr tags))) - - ) - ) ;cond - (when (not (web-mode-tag-next)) - (setq continue nil)) - ) ;while - (message "%S error(s) detected" errors) - (if (< errors 1) - (goto-char ori) - (goto-char first) - (recenter)) - ;; (message "%S" tags) - )) - -(defun web-mode-fontify-elements (beg end) - (save-excursion - (goto-char beg) - (let ((continue (or (get-text-property (point) 'tag-beg) (web-mode-tag-next))) - (i 0) (ctx nil) (face nil)) - (while continue - (cond - ((> (setq i (1+ i)) 1000) - (message "fontify-elements ** too much tags **") - (setq continue nil)) - ((> (point) end) - (setq continue nil)) - ((not (get-text-property (point) 'tag-beg)) - (setq continue nil)) - ((eq (get-text-property (point) 'tag-type) 'start) - (when (and (setq ctx (web-mode-element-boundaries (point))) - (<= (car (cdr ctx)) end) - (setq face (cdr (assoc (get-text-property (point) 'tag-name) web-mode-element-content-faces)))) - (font-lock-prepend-text-property (1+ (cdr (car ctx))) (car (cdr ctx)) - 'font-lock-face face)) - ) - ) ;cond - (when (not (web-mode-tag-next)) - (setq continue nil)) - ) ;while - ))) - -(defun web-mode-enable (feature) - "Enable one feature." - (interactive - (list (completing-read - "Feature: " - (let (features) - (dolist (elt web-mode-features) - (setq features (append features (list (car elt))))) - features)))) - (when (and (or (not feature) (< (length feature) 1)) web-mode-last-enabled-feature) - (setq feature web-mode-last-enabled-feature)) - (when feature - (setq web-mode-last-enabled-feature feature) - (setq feature (cdr (assoc feature web-mode-features))) - (cond - ((eq feature 'web-mode-enable-current-column-highlight) - (web-mode-column-show)) - ((eq feature 'web-mode-enable-current-element-highlight) - (when (not web-mode-enable-current-element-highlight) - (web-mode-toggle-current-element-highlight)) - ) - ((eq feature 'web-mode-enable-whitespace-fontification) - (web-mode-whitespaces-on)) - (t - (set feature t) - (web-mode-buffer-fontify)) - ) - ) ;when - ) - -(defun web-mode-disable (feature) - "Disable one feature." - (interactive - (list (completing-read - "Feature: " - (let (features) - (dolist (elt web-mode-features) - (setq features (append features (list (car elt))))) - features)))) - (when (and (or (not feature) (< (length feature) 1)) web-mode-last-enabled-feature) - (setq feature web-mode-last-enabled-feature)) - (when feature - (setq feature (cdr (assoc feature web-mode-features))) - (cond - ((eq feature 'web-mode-enable-current-column-highlight) - (web-mode-column-hide)) - ((eq feature 'web-mode-enable-current-element-highlight) - (when web-mode-enable-current-element-highlight - (web-mode-toggle-current-element-highlight)) - ) - ((eq feature 'web-mode-enable-whitespace-fontification) - (web-mode-whitespaces-off)) - (t - (set feature nil) - (web-mode-buffer-fontify)) - ) - ) ;when - ) - -(defun web-mode-toggle-current-element-highlight () - "Toggle highlighting of the current html element." - (interactive) - (if web-mode-enable-current-element-highlight - (progn - (web-mode-delete-tag-overlays) - (setq web-mode-enable-current-element-highlight nil)) - (setq web-mode-enable-current-element-highlight t) - )) - -(defun web-mode-make-tag-overlays () - (unless web-mode-overlay-tag-start - (setq web-mode-overlay-tag-start (make-overlay 1 1) - web-mode-overlay-tag-end (make-overlay 1 1)) - (overlay-put web-mode-overlay-tag-start - 'font-lock-face - 'web-mode-current-element-highlight-face) - (overlay-put web-mode-overlay-tag-end - 'font-lock-face - 'web-mode-current-element-highlight-face))) - -(defun web-mode-delete-tag-overlays () - (when web-mode-overlay-tag-start - (delete-overlay web-mode-overlay-tag-start) - (delete-overlay web-mode-overlay-tag-end))) - -(defun web-mode-column-overlay-factory (index) - (let (overlay) - (when (null web-mode-column-overlays) - (dotimes (i 100) - (setq overlay (make-overlay 1 1)) - (overlay-put overlay 'font-lock-face 'web-mode-current-column-highlight-face) - (setq web-mode-column-overlays (append web-mode-column-overlays (list overlay))) - ) - ) ;when - (setq overlay (nth index web-mode-column-overlays)) - (when (null overlay) - (setq overlay (make-overlay 1 1)) - (overlay-put overlay 'font-lock-face 'web-mode-current-column-highlight-face) - (setq web-mode-column-overlays (append web-mode-column-overlays (list overlay))) - ) ;when - overlay)) - -(defun web-mode-column-hide () - (setq web-mode-enable-current-column-highlight nil) - (remove-overlays (point-min) (point-max) - 'font-lock-face - 'web-mode-current-column-highlight-face)) - -(defun web-mode-column-show () - (let ((index 0) overlay diff column line-to line-from) - (web-mode-column-hide) - (setq web-mode-enable-current-column-highlight t) - (save-excursion - (back-to-indentation) - (setq column (current-column) - line-to (web-mode-line-number)) - (when (and (get-text-property (point) 'tag-beg) - (member (get-text-property (point) 'tag-type) '(start end)) - (web-mode-tag-match) - (setq line-from (web-mode-line-number)) - (not (= line-from line-to))) - (when (> line-from line-to) - (let (tmp) - (setq tmp line-from) - (setq line-from line-to) - (setq line-to tmp)) - ) ;when - ;;(message "column(%S) line-from(%S) line-to(%S)" column line-from line-to) - (goto-char (point-min)) - (when (> line-from 1) - (forward-line (1- line-from))) - (while (<= line-from line-to) - (setq overlay (web-mode-column-overlay-factory index)) - (setq diff (- (line-end-position) (point))) - (cond - ((or (and (= column 0) (= diff 0)) - (> column diff)) - (end-of-line) - (move-overlay overlay (point) (point)) - (overlay-put overlay - 'after-string - (concat - (if (> column diff) (make-string (- column diff) ?\s) "") - (propertize " " - 'font-lock-face - 'web-mode-current-column-highlight-face) - ) ;concat - ) - ) - (t - (move-to-column column) - (overlay-put overlay 'after-string nil) - (move-overlay overlay (point) (1+ (point))) - ) - ) ;cond - (setq line-from (1+ line-from)) - (forward-line) - (setq index (1+ index)) - ) ;while - ) ;when - ) ;save-excursion - ) ;let - ) - -(defun web-mode-highlight-current-element () - (let ((ctx (web-mode-element-boundaries)) len) - (cond - ((null ctx) - (web-mode-delete-tag-overlays)) - ((eq (get-text-property (caar ctx) 'tag-type) 'void) ;; #1046 - (web-mode-make-tag-overlays) - (setq len (length (get-text-property (caar ctx) 'tag-name))) - (move-overlay web-mode-overlay-tag-start (+ (caar ctx) 1) (+ (caar ctx) 1 len)) - ) - (t - (web-mode-make-tag-overlays) - (setq len (length (get-text-property (caar ctx) 'tag-name))) - (move-overlay web-mode-overlay-tag-start (+ (caar ctx) 1) (+ (caar ctx) 1 len)) - (move-overlay web-mode-overlay-tag-end (+ (cadr ctx) 2) (+ (cadr ctx) 2 len)) - ) ;t - ) ;cond - )) - -(defun web-mode-fontify-whitespaces (beg end) - (save-excursion - (goto-char beg) - (while (re-search-forward web-mode-whitespaces-regexp end t) - (add-text-properties (match-beginning 0) (match-end 0) - '(face web-mode-whitespace-face)) - ) ;while - )) - -(defun web-mode-whitespaces-show () - "Toggle whitespaces." - (interactive) - (if web-mode-enable-whitespace-fontification - (web-mode-whitespaces-off) - (web-mode-whitespaces-on))) - -(defun web-mode-whitespaces-on () - "Show whitespaces." - (interactive) - (when web-mode-display-table - (setq buffer-display-table web-mode-display-table)) - (setq web-mode-enable-whitespace-fontification t)) - -(defun web-mode-whitespaces-off () - (setq buffer-display-table nil) - (setq web-mode-enable-whitespace-fontification nil)) - -(defun web-mode-use-tabs () - "Tweaks vars to be compatible with TAB indentation." - (let (offset) - (setq web-mode-block-padding 0) - (setq web-mode-script-padding 0) - (setq web-mode-style-padding 0) - (setq offset - (cond - ((and (boundp 'tab-width) tab-width) tab-width) - ((and (boundp 'standard-indent) standard-indent) standard-indent) - (t 4))) - ;; (message "offset(%S)" offset) - (setq web-mode-attr-indent-offset offset) - (setq web-mode-code-indent-offset offset) - (setq web-mode-css-indent-offset offset) - (setq web-mode-markup-indent-offset offset) - (setq web-mode-sql-indent-offset offset) - (add-to-list 'web-mode-indentation-params '("lineup-args" . nil)) - (add-to-list 'web-mode-indentation-params '("lineup-calls" . nil)) - (add-to-list 'web-mode-indentation-params '("lineup-concats" . nil)) - (add-to-list 'web-mode-indentation-params '("lineup-ternary" . nil)) - )) - -(defun web-mode-element-children-fold-or-unfold (&optional pos) - "Fold/Unfold all the children of the current html element." - (interactive) - (unless pos (setq pos (point))) - (save-excursion - (dolist (child (reverse (web-mode-element-children pos))) - (goto-char child) - (web-mode-fold-or-unfold)) - )) - -(defun web-mode-fold-or-unfold (&optional pos) - "Toggle folding on an html element or a control block." - (interactive) - (web-mode-scan) - (web-mode-with-silent-modifications - (save-excursion - (if pos (goto-char pos)) - (let (beg-inside beg-outside end-inside end-outside overlay overlays regexp) - (when (looking-back "^[\t ]*" (point-min)) - (back-to-indentation)) - (setq overlays (overlays-at (point))) - (dolist (elt overlays) - (when (and (not overlay) - (eq (overlay-get elt 'font-lock-face) 'web-mode-folded-face)) - (setq overlay elt))) - (cond - ;; *** unfolding - (overlay - (setq beg-inside (overlay-start overlay) - end-inside (overlay-end overlay)) - (remove-overlays beg-inside end-inside) - (put-text-property beg-inside end-inside 'invisible nil) - ) - ;; *** block folding - ((and (get-text-property (point) 'block-side) - (cdr (web-mode-block-is-control (point)))) - (setq beg-outside (web-mode-block-beginning-position (point))) - (setq beg-inside (1+ (web-mode-block-end-position (point)))) - (when (web-mode-block-match) - (setq end-inside (point)) - (setq end-outside (1+ (web-mode-block-end-position (point))))) - ) - ;; *** html comment folding - ((eq (get-text-property (point) 'tag-type) 'comment) - (setq beg-outside (web-mode-tag-beginning-position)) - (setq beg-inside (+ beg-outside 4)) - (setq end-outside (web-mode-tag-end-position)) - (setq end-inside (- end-outside 3)) - ) - ;; *** tag folding - ((or (member (get-text-property (point) 'tag-type) '(start end)) - (web-mode-element-parent)) - (when (not (web-mode-element-is-collapsed (point))) - (web-mode-tag-beginning) - (when (eq (get-text-property (point) 'tag-type) 'end) - (web-mode-tag-match)) - (setq beg-outside (point)) - (web-mode-tag-end) - (setq beg-inside (point)) - (goto-char beg-outside) - (when (web-mode-tag-match) - (setq end-inside (point)) - (web-mode-tag-end) - (setq end-outside (point))) - ) - ) - ) ;cond - (when (and beg-inside beg-outside end-inside end-outside) - (setq overlay (make-overlay beg-outside end-outside)) - (overlay-put overlay 'font-lock-face 'web-mode-folded-face) - (put-text-property beg-inside end-inside 'invisible t)) - )))) - -;;---- TRANSFORMATION ---------------------------------------------------------- - -(defun web-mode-buffer-change-tag-case (&optional type) - "Change html tag case." - (interactive) - (save-excursion - (goto-char (point-min)) - (let ((continue t) f) - (setq f (if (member type '("upper" "uppercase" "upper-case")) 'uppercase 'downcase)) - (when (and (not (get-text-property (point) 'tag-beg)) - (not (web-mode-tag-next))) - (setq continue nil)) - (while continue - (skip-chars-forward " and < in html content." - (interactive) - (save-excursion - (let (expr (min (point-min)) (max (point-max))) - (when mark-active - (setq min (region-beginning) - max (region-end)) - (deactivate-mark)) - (goto-char min) - (while (web-mode-content-rsf "[&<>]" max) - (replace-match (cdr (assq (char-before) web-mode-xml-chars)) t t)) - ))) - -(defun web-mode-dom-quotes-replace () - "Replace dumb quotes." - (interactive) - (save-excursion - (let (expr (min (point-min)) (max (point-max))) - (when mark-active - (setq min (region-beginning) - max (region-end)) - (deactivate-mark)) - (goto-char min) - (setq expr (concat (car web-mode-smart-quotes) "\\2" (cdr web-mode-smart-quotes))) - (while (web-mode-content-rsf "\\(\"\\)\\(.\\{1,200\\}\\)\\(\"\\)" max) - (replace-match expr) - ) ;while - ))) - -;;---- INDENTATION ------------------------------------------------------------- - -;; todo : passer de règle en règle et mettre un \n à la fin -(defun web-mode-css-indent () - (save-excursion - (goto-char (point-min)) - (let ((continue t) rule part-end) - (while continue - (cond - ((not (web-mode-part-next)) - (setq continue nil)) - ((eq (get-text-property (point) 'part-side) 'css) - (setq part-end (web-mode-part-end-position)) - (while (setq rule (web-mode-css-rule-next part-end)) - (when (not (looking-at-p "[[:space:]]*\\($\\|<\\)")) - (newline) - (indent-according-to-mode) - (setq part-end (web-mode-part-end-position))) - ) - ) - ) ;cond - ) - ))) - -(defun web-mode-buffer-indent () - "Indent all buffer." - (interactive) - (let ((debug t) (ts (current-time)) (sub nil)) - (indent-region (point-min) (point-max)) - (when debug - (setq sub (time-subtract (current-time) ts)) - (message "buffer-indent: time elapsed = %Ss %9Sµs" (nth 1 sub) (nth 2 sub))) - (delete-trailing-whitespace))) - -(defun web-mode-point-context (pos) - "POS should be at the beginning of the indentation." - (save-excursion - (let (curr-char curr-indentation curr-line - language - options - reg-beg reg-col - prev-char prev-indentation prev-line prev-pos - token - part-language - depth) - - (setq reg-beg (point-min) - reg-col 0 - token "live" - options "" - language "" - prev-line "" - prev-char 0 - prev-pos nil) - - (when (get-text-property pos 'part-side) - (setq part-language (symbol-name (get-text-property pos 'part-side)))) - - ;;(message "part-language=%S" part-language) - - (cond - - ((and (bobp) (member web-mode-content-type '("html" "xml"))) - (setq language web-mode-content-type) - ) - - ((string= web-mode-content-type "css") - (setq language "css" - curr-indentation web-mode-css-indent-offset)) - - ((member web-mode-content-type '("javascript" "json" "typescript")) - (setq language web-mode-content-type - curr-indentation web-mode-code-indent-offset)) - - ((or (string= web-mode-content-type "jsx") - (and part-language (string= part-language "jsx"))) - (setq language "jsx" - curr-indentation web-mode-code-indent-offset) - (cond - ((web-mode-jsx-is-html pos) - (setq curr-indentation web-mode-markup-indent-offset - options "is-html")) - ((and (setq depth (get-text-property pos 'jsx-depth)) (> depth 1)) - (when (get-text-property pos 'jsx-beg) - (setq depth (1- depth))) - (setq reg-beg (web-mode-jsx-depth-beginning-position pos depth)) - (setq reg-beg (1+ reg-beg)) - ;;(message "%S" (point)) - (save-excursion - (goto-char reg-beg) - ;;(message "pt=%S" reg-beg) - (cond - ((and (not (looking-at-p "[ ]*$")) - (looking-back "^[[:space:]]*{" (point-min))) - (setq reg-col (+ (current-indentation) ;; #1027 - (cond - ((looking-at "[ ]+") (1+ (length (match-string-no-properties 0)))) - (t 0)) - )) - ) - ((looking-at-p "[ ]*\\[[ ]*$") ;; #0659 - (setq reg-col (current-indentation)) - ) - ((and (looking-back "=[ ]*{" (point-min)) ;; #0739 #1022 - (not (looking-at-p "[[:space:]]*<"))) - (setq reg-col (current-indentation)) - ) - ;;((and (looking-back "=[ ]*{" (point-min)) ;; #0739 - ;; (looking-at-p "{[ ]*")) - ;; (setq reg-col (current-indentation)) - ;; ) - ((get-text-property (1- (point)) 'tag-beg) - ;;(message "point=%S" (point)) - (setq reg-col (current-indentation)) - ) - (t - (message "%S : %S %S" (point) (current-indentation) web-mode-code-indent-offset) - ;;(setq reg-col (+ (current-indentation) web-mode-code-indent-offset web-mode-jsx-expression-padding))) - (setq reg-col (+ (current-indentation) web-mode-code-indent-offset))) - ) - - ;;(message "%S %S %S" (point) (current-indentation) reg-col) - ) ;save-excursion - ) - ((string= web-mode-content-type "jsx") - (setq reg-beg (point-min))) - (t - (setq reg-beg (or (web-mode-part-beginning-position pos) (point-min))) - (save-excursion - (goto-char reg-beg) - (search-backward "<" nil t) - (setq reg-col (current-column)) - ) ;save-excursion - ) - ) ;cond - ;;(message "jsx reg-beg=%S" reg-beg) - ) ;jsx - - ((string= web-mode-content-type "php") - (setq language "php" - curr-indentation web-mode-code-indent-offset)) - - ((or (string= web-mode-content-type "xml")) - (setq language "xml" - curr-indentation web-mode-markup-indent-offset)) - - ;; TODO: est ce util ? - ((and (get-text-property pos 'tag-beg) - (get-text-property pos 'tag-name) - ;;(not (get-text-property pos 'part-side)) - ) - (setq language "html" - curr-indentation web-mode-markup-indent-offset)) - - ((and (get-text-property pos 'block-side) - (not (get-text-property pos 'block-beg))) - - (setq reg-beg (or (web-mode-block-beginning-position pos) (point-min))) - (goto-char reg-beg) - (setq reg-col (current-column)) - ;;(message "%S %S" reg-beg reg-col) - (setq language web-mode-engine) - (setq curr-indentation web-mode-code-indent-offset) - - (cond - ((string= web-mode-engine "blade") - (save-excursion - (when (web-mode-rsf "{[{!]+[ ]*") - (setq reg-col (current-column)))) - (setq reg-beg (+ reg-beg 2)) - ) - ((string= web-mode-engine "razor") - ;;(setq reg-beg (+ reg-beg 2)) - ;;(setq reg-col (current-column)) - ) - ;; tests/demo.chtml - ((string= web-mode-engine "ctemplate") - (save-excursion - (when (web-mode-rsf "{{#?") - (setq reg-col (current-column)))) - ) - ((string= web-mode-engine "dust") - (save-excursion - (when (web-mode-rsf "{@") - (setq reg-col (current-column)))) - ) - ((string= web-mode-engine "svelte") - (save-excursion - (when (web-mode-rsf "{@") - (setq reg-col (current-column)))) - ) - ((string= web-mode-engine "template-toolkit") - (setq reg-beg (+ reg-beg 3) - reg-col (+ reg-col 3)) - ) - ((and (string= web-mode-engine "jsp") - (web-mode-looking-at "<%@" reg-beg)) - (save-excursion - (goto-char reg-beg) - (looking-at "<%@[ ]*[[:alpha:]]+[ ]+\\|?[[:alpha:]]+[:.][[:alpha:]]+[ ]+") - (goto-char (match-end 0)) - (setq reg-col (current-column)) - ) - ) - ((and (string= web-mode-engine "freemarker") - (web-mode-looking-at "<@\\|<%@\\|<[[:alpha:]]" reg-beg)) - (save-excursion - (goto-char reg-beg) - (looking-at "<@[[:alpha:].]+[ ]+\\|<%@[ ]*[[:alpha:]]+[ ]+\\|<[[:alpha:]]+:[[:alpha:]]+[ ]+") - (goto-char (match-end 0)) - (setq reg-col (current-column)) - ) - ) - ) ;cond - ) ;block-side - - ((and part-language (member part-language - '("css" "javascript" "json" "sql" "markdown" - "pug" "ruby" "sass" "stylus" "typescript"))) - (setq reg-beg (or (web-mode-part-beginning-position pos) (point-min))) - (goto-char reg-beg) - (if (and (string= web-mode-engine "mojolicious") - (looking-back "javascript begin")) - (search-backward "%" nil t) - (search-backward "<" nil t)) - (setq reg-col (current-column)) - (setq language part-language) - (cond - ((string= language "css") - (setq curr-indentation web-mode-css-indent-offset)) - ((string= language "sql") - (setq curr-indentation web-mode-sql-indent-offset)) - ((string= language "markdown") - (setq curr-indentation web-mode-code-indent-offset)) - ((string= language "pug") - (setq curr-indentation web-mode-code-indent-offset)) - ((string= language "sass") - (setq curr-indentation web-mode-code-indent-offset)) - ((string= language "stylus") - (setq curr-indentation web-mode-code-indent-offset)) - ((string= language "ruby") - (setq curr-indentation web-mode-code-indent-offset)) - ((string= language "typescript") - (setq curr-indentation web-mode-code-indent-offset)) - (t - (setq language "javascript" - curr-indentation web-mode-code-indent-offset)) - ) - ) ;part-side - - (t - (setq language "html" - curr-indentation web-mode-markup-indent-offset) - ) - - ) ;cond - - (cond - ((or (and (> pos (point-min)) - (eq (get-text-property pos 'part-token) 'comment) - (eq (get-text-property (1- pos) 'part-token) 'comment) - (progn - (setq reg-beg (previous-single-property-change pos 'part-token)) - t)) - (and (> pos (point-min)) - (eq (get-text-property pos 'block-token) 'comment) - (eq (get-text-property (1- pos) 'block-token) 'comment) - (progn - (setq reg-beg (previous-single-property-change pos 'block-token)) - t)) - (and (> pos (point-min)) - (eq (get-text-property pos 'tag-type) 'comment) - (not (get-text-property pos 'tag-beg)) - (progn - (setq reg-beg (web-mode-tag-beginning-position pos)) - t)) - ) - (setq token "comment")) - ((or (and (> pos (point-min)) - (member (get-text-property pos 'part-token) - '(string context key)) - (member (get-text-property (1- pos) 'part-token) - '(string context key))) - (and (eq (get-text-property pos 'block-token) 'string) - (eq (get-text-property (1- pos) 'block-token) 'string))) - (setq token "string")) - ) - - (goto-char pos) - (setq curr-line (web-mode-trim - (buffer-substring-no-properties - (line-beginning-position) - (line-end-position)))) - (setq curr-char (if (string= curr-line "") 0 (aref curr-line 0))) - - (when (or (member language '("php" "blade" "javascript" "typescript" "jsx" "razor" "css")) - (and (member language '("html" "xml")) - (not (eq ?\< curr-char)))) - (let (prev) - (cond - ((member language '("html" "xml" "javascript" "jsx" "css")) - (when (setq prev (web-mode-part-previous-live-line reg-beg)) - (setq prev-line (nth 0 prev) - prev-indentation (nth 1 prev) - prev-pos (nth 2 prev)) - ) - ) - ((setq prev (web-mode-block-previous-live-line)) - (setq prev-line (car prev) - prev-indentation (cdr prev)) - (setq prev-line (web-mode-clean-block-line prev-line))) - ) ;cond - ) ;let - (when (>= (length prev-line) 1) - (setq prev-char (aref prev-line (1- (length prev-line)))) - (setq prev-line (substring-no-properties prev-line)) - ) - ) - - (cond - ((not (member web-mode-content-type '("html" "xml"))) - ) - ((member language '("javascript" "typescript" "jsx" "ruby")) - (setq reg-col (if web-mode-script-padding (+ reg-col web-mode-script-padding) 0))) - ((member language '("css" "sql" "markdown" "pug" "sass" "stylus")) - (setq reg-col (if web-mode-style-padding (+ reg-col web-mode-style-padding) 0))) - ((not (member language '("html" "xml"))) - (setq reg-col - (cond - ((not web-mode-block-padding) reg-col) - ((eq web-mode-block-padding -1) 0) - (t (+ reg-col web-mode-block-padding)) - ) ;cond - ) ;setq - ) - ) - - (list :curr-char curr-char - :curr-indentation curr-indentation - :curr-line curr-line - :language language - :options options - :prev-char prev-char - :prev-indentation prev-indentation - :prev-line prev-line - :prev-pos prev-pos - :reg-beg reg-beg - :reg-col reg-col - :token token) - ))) - -(defun web-mode-indent-line () - - (web-mode-scan) - - (let ((offset nil) - (char nil) - (debug nil) - (inhibit-modification-hooks nil) - (adjust t)) - - (save-excursion - (back-to-indentation) - (setq char (char-after)) - (let* ((pos (point)) - (ctx (web-mode-point-context pos)) - (curr-char (plist-get ctx :curr-char)) - (curr-indentation (plist-get ctx :curr-indentation)) - (curr-line (plist-get ctx :curr-line)) - (language (plist-get ctx :language)) - (prev-char (plist-get ctx :prev-char)) - (prev-indentation (plist-get ctx :prev-indentation)) - (prev-line (plist-get ctx :prev-line)) - (prev-pos (plist-get ctx :prev-pos)) - (reg-beg (plist-get ctx :reg-beg)) - (reg-col (plist-get ctx :reg-col)) - (token (plist-get ctx :token)) - (options (plist-get ctx :options)) - (chars (list curr-char prev-char)) - (tmp nil) - (is-js (member language '("javascript" "jsx" "ejs")))) - - (when (member language '("json" "typescript")) - (setq language "javascript")) - - ;;(message "%S" language) - ;;(message "curr-char=[%c] prev-char=[%c]\n%S" curr-char prev-char ctx) - ;;(message "options=%S" ctx) - - (cond - - ((or (bobp) (= (line-number-at-pos pos) 1)) - (when debug (message "I100(%S) first line" pos)) - (setq offset 0)) - - ;; #1073 - ((get-text-property pos 'invisible) - (when debug (message "I110(%S) invible" pos)) - (setq offset nil)) - - ((string= token "string") - (when debug (message "I120(%S) string" pos)) - (cond - ((web-mode-is-token-end pos) - (if (get-text-property pos 'block-side) - (web-mode-block-token-beginning) - (web-mode-part-token-beginning)) - (setq offset (current-indentation)) - ) - ((and web-mode-enable-sql-detection - (web-mode-block-token-starts-with (concat "[ \n]*" web-mode-sql-queries))) - (save-excursion - (let (col) - (web-mode-block-string-beginning) - (skip-chars-forward "[ \"'\n]") - (setq col (current-column)) - (goto-char pos) - (if (looking-at-p "\\(SELECT\\|INSERT\\|DELETE\\|UPDATE\\|FROM\\|LEFT\\|JOIN\\|WHERE\\|GROUP BY\\|LIMIT\\|HAVING\\|\)\\)") - (setq offset col) - (setq offset (+ col web-mode-sql-indent-offset))) - ) - ) ;save-excursion - ) - ((and is-js - (web-mode-is-ql-string pos "Relay\.QL")) - (setq offset (web-mode-relayql-indentation pos)) - ) - ((and is-js - (web-mode-is-ql-string pos "gql")) - (setq offset (web-mode-relayql-indentation pos "gql")) - ) - ((and is-js - (web-mode-is-ql-string pos "graphql")) - (setq offset (web-mode-relayql-indentation pos "graphql")) - ) - ((and is-js - (web-mode-is-css-string pos)) - (when debug (message "I127(%S) css string" pos)) - (setq offset (web-mode-token-css-indentation pos)) - ) - ((and is-js - (web-mode-is-html-string pos)) - (when debug (message "I128(%S) html string" pos)) - (setq offset (web-mode-token-html-indentation pos)) - ) - (t - (setq offset nil)) - ) ;cond - ) ;case string - - ((string= token "comment") - (when debug (message "I130(%S) comment" pos)) - (if (eq (get-text-property pos 'tag-type) 'comment) - (web-mode-tag-beginning) - (goto-char (car - (web-mode-property-boundaries - (if (eq (get-text-property pos 'part-token) 'comment) - 'part-token - 'block-token) - pos)))) - (setq offset (current-column)) - (cond - ((string= web-mode-engine "freemarker") - (setq offset (+ (current-indentation) 2))) - ((member (buffer-substring-no-properties (point) (+ (point) 2)) '("/*" "{*" "@*")) - (cond - ((eq ?\* curr-char) - (setq offset (+ offset 1))) - (t - (setq offset (+ offset 3))) - ) ;cond - ) - ((string= (buffer-substring-no-properties (point) (+ (point) 4)) "" curr-line) - (setq offset offset)) - ((string-match-p "^-" curr-line) - (setq offset (+ offset 3))) - (t - (setq offset (+ offset 5))) - ) ;cond - ) - ((and (string= web-mode-engine "django") (looking-back "{% comment %}" (point-min))) - (setq offset (- offset 12))) - ((and (string= web-mode-engine "mako") (looking-back "<%doc%>" (point-min))) - (setq offset (- offset 6))) - ((and (string= web-mode-engine "mason") (looking-back "<%doc%>" (point-min))) - (setq offset (- offset 6))) - ) ;cond - ) ;case comment - - ((and (string= web-mode-engine "mason") - (string-match-p "^%" curr-line)) - (when debug (message "I140(%S) mason" pos)) - (setq offset 0)) - - ((and (get-text-property pos 'block-beg) - (or (web-mode-block-is-close pos) - (web-mode-block-is-inside pos))) - (when debug (message "I150(%S) block-match" pos)) - (cond - ((not (web-mode-block-match)) - ) - ((and (string= web-mode-engine "closure") - (string-match-p "{\\(case\\|default\\)" curr-line)) - (setq offset (+ (current-indentation) web-mode-markup-indent-offset))) - (t - (setq offset (current-indentation)) - (if (and (string= web-mode-engine "blade") - (string-match-p "@break" curr-line)) - (setq offset (+ (current-indentation) offset))) - ) - ) ;cond - ) - - ((eq (get-text-property pos 'block-token) 'delimiter-end) - (when debug (message "I160(%S) block-beginning" pos)) - (when (web-mode-block-beginning) - (setq reg-col (current-indentation)) - (setq offset (current-column)))) - - ((or (and (get-text-property pos 'tag-beg) - (eq (get-text-property pos 'tag-type) 'end)) - (and (eq (get-text-property pos 'tag-type) 'comment) - (string-match-p "" (point)) - (web-mode-insert-text-at-pos "" (point)) - (web-mode-insert-text-at-pos "") - (search-backward " -->") - ) ;case html - ) ;cond - )) - -(defun web-mode-comment (pos) - (let (ctx language col sel beg end tmp block-side single-line-block pos-after content) - - (setq pos-after pos) - - (setq block-side (get-text-property pos 'block-side)) - (setq single-line-block (web-mode-is-single-line-block pos)) - - (cond - - ((and block-side (string= web-mode-engine "erb")) - (web-mode-comment-erb-block pos) - ) - - ((and block-side (string= web-mode-engine "artanis")) - (web-mode-comment-artanis-block pos) - ) - - ((and single-line-block block-side - (intern-soft (concat "web-mode-comment-" web-mode-engine "-block"))) - (funcall (intern (concat "web-mode-comment-" web-mode-engine "-block")) pos) - ) - - (t - (setq ctx (web-mode-point-context - (if mark-active (region-beginning) (line-beginning-position)))) - ;;(message "%S" ctx) - (setq language (plist-get ctx :language)) - (setq col (current-column)) - (cond - (mark-active - ;;(message "%S %S" (point) col) - ) - ((and (member language '("html" "xml")) - (get-text-property (progn (back-to-indentation) (point)) 'tag-beg)) - (web-mode-element-select)) - (t - (end-of-line) - (set-mark (line-beginning-position))) - ) ;cond - - (setq beg (region-beginning) - end (region-end)) - - (when (> (point) (mark)) - (exchange-point-and-mark)) - - (if (and (eq (char-before end) ?\n) - (not (eq (char-after end) ?\n))) - (setq end (1- end))) - - (setq sel (buffer-substring-no-properties beg end)) - - (cond - - ((member language '("html" "xml")) - (cond - ((and (= web-mode-comment-style 2) (string= web-mode-engine "django")) - (setq content (concat "{# " sel " #}"))) - ((and (= web-mode-comment-style 2) (member web-mode-engine '("ejs" "erb"))) - (setq content (concat "<%# " sel " %>"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "artanis")) - (setq content (concat "<%; " sel " %>"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "aspx")) - (setq content (concat "<%-- " sel " --%>"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "smarty")) - (setq content (concat "{* " sel " *}"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "expressionengine")) - (setq content (concat "{!-- " sel " --}"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "xoops")) - (setq content (concat "<{* " sel " *}>"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "hero")) - (setq content (concat "<%# " sel " %>"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "blade")) - (setq content (concat "{{-- " sel " --}}"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "ctemplate")) - (setq content (concat "{{!-- " sel " --}}"))) - ((and (= web-mode-comment-style 2) (string= web-mode-engine "razor")) - (setq content (concat "@* " sel " *@"))) - (t - (setq content (concat "")) - (when (< (length sel) 1) - (search-backward " -->") - (setq pos-after nil)) - )) - ) ;case html - - ((member language '("php" "javascript" "typescript" "java" "jsx")) - (let (alt) - (setq alt (cdr (assoc language web-mode-comment-formats))) - ;;(message "language=%S alt=%S sel=%S col=%S" language alt sel col) - (cond - ((and alt (string= alt "//")) - (setq content (replace-regexp-in-string (concat "\n[ ]\\{" (number-to-string col) "\\}") "\n" sel)) - (setq content (replace-regexp-in-string (concat "\n") "\n// " content)) - (setq content (concat "// " content))) - ((get-text-property pos 'jsx-depth) - (setq content (concat "{/* " sel " */}"))) - (web-mode-comment-prefixing - (setq content (replace-regexp-in-string (concat "\n[ ]\\{" (number-to-string col) "\\}") "\n* " sel)) - (setq content (concat "/* " content " */"))) - (t - (setq content (concat "/* " sel " */"))) - ) ;cond - ) ;let - ) - - ((member language '("erb")) - (setq content (replace-regexp-in-string "^[ ]*" "#" sel))) - - ((member language '("asp")) - (setq content (replace-regexp-in-string "^[ ]*" "''" sel))) - - (t - (setq content (concat "/* " sel " */"))) - - ) ;cond - - (when content - (delete-region beg end) - (deactivate-mark) - (let (beg end) - (setq beg (point-at-bol)) - (insert content) - (setq end (point-at-eol)) - (indent-region beg end) - ) - ) ;when - - ) ;t - ) ;cond - - (when pos-after (goto-char pos-after)) - - )) - -(defun web-mode-comment-ejs-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "//" (+ beg 2)))) - -(defun web-mode-comment-erb-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "#" (+ beg 2)))) - -(defun web-mode-comment-artanis-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos ";" (+ beg 2)))) - -(defun web-mode-comment-django-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "#" end) - (web-mode-insert-text-at-pos "#" (1+ beg)))) - -(defun web-mode-comment-dust-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "!" end) - (web-mode-insert-text-at-pos "!" (1+ beg)))) - -(defun web-mode-comment-aspx-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "#" end) - (web-mode-insert-text-at-pos "#" (1+ beg)))) - -(defun web-mode-comment-jsp-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "--" (+ beg 2)))) - -(defun web-mode-comment-go-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "*/" (1- end)) - (web-mode-insert-text-at-pos "/*" (+ beg (if (web-mode-looking-at "{{" beg) 2 0))))) - -(defun web-mode-comment-php-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "*/" (- end 2)) - (web-mode-insert-text-at-pos "/*" (+ beg 1 (if (web-mode-looking-at "<\\?php" beg) 5 3))))) - -(defun web-mode-comment-svelte-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-insert-text-at-pos "!" end) - (web-mode-insert-text-at-pos "!" (1+ beg)))) - -(defun web-mode-comment-boundaries (&optional pos) - (interactive) - (unless pos (setq pos (point))) - (let ((beg pos) (end pos) prop) - (save-excursion - (goto-char pos) - (setq prop - (cond - ((eq (get-text-property pos 'block-token) 'comment) 'block-token) - ((eq (get-text-property pos 'tag-type) 'comment) 'tag-type) - ((eq (get-text-property pos 'part-token) 'comment) 'part-token) - (t nil) - )) - (if (null prop) - (setq beg nil - end nil) - (when (and (not (bobp)) - (eq (get-text-property pos prop) (get-text-property (1- pos) prop))) - (setq beg (or (previous-single-property-change pos prop) (point-min)))) - (when (and (not (eobp)) - (eq (get-text-property pos prop) (get-text-property (1+ pos) prop))) - (setq end (or (next-single-property-change pos prop) (point-max))))) - (message "beg(%S) end(%S) point-max(%S)" beg end (point-max)) - (when (and beg (string= (buffer-substring-no-properties beg (+ beg 2)) "//")) - (goto-char end) - (while (and (looking-at-p "\n[ ]*//") - (not (eobp))) - (search-forward "//") - (backward-char 2) - ;;(message "%S" (point)) - (setq end (next-single-property-change (point) prop)) - (goto-char end) - ;;(message "%S" (point)) - ) ;while - ) ;when - ;;(when end (setq end (1- end))) ;; #1021 - ) ;save-excursion - ;;(message "beg=%S end=%S" beg end) - (if (and beg end) (cons beg end) nil) - )) - -(defun web-mode-uncomment (pos) - (let ((beg pos) (end pos) (sub2 "") comment boundaries) - (save-excursion - (cond - ((and (get-text-property pos 'block-side) - (intern-soft (concat "web-mode-uncomment-" web-mode-engine "-block"))) - (funcall (intern (concat "web-mode-uncomment-" web-mode-engine "-block")) pos)) - ((and (setq boundaries (web-mode-comment-boundaries pos)) - (setq beg (car boundaries)) - (setq end (1+ (cdr boundaries))) - (> (- end beg) 4)) - (message "%S" boundaries) - ;;(message "beg(%S) end(%S)" beg end) - (setq comment (buffer-substring-no-properties beg end)) - (setq sub2 (substring comment 0 2)) - (cond - ((member sub2 '("$\\)" "" comment))) - ((string= sub2 "{#") - (setq comment (replace-regexp-in-string "\\(^{#[ ]?\\|[ ]?#}$\\)" "" comment))) - ((string= sub2 "{/") ;jsx comments - (setq comment (replace-regexp-in-string "\\(^{/\\*[ ]?\\|[ ]?\\*/}$\\)" "" comment))) - ((string= sub2 "/*") - ;;(message "%S" comment) - ;;(setq comment (replace-regexp-in-string "\\(\\*/\\|^/\\*[ ]?\\|^[ \t]*\\*\\)" "" comment)) - (setq comment (replace-regexp-in-string "\\([ ]?\\*/$\\|^/\\*[ ]?\\)" "" comment)) - (setq comment (replace-regexp-in-string "\\(^[ \t]*\\*\\)" "" comment)) - ;;(message "%S" comment) - ) - ((string= sub2 "//") - (setq comment (replace-regexp-in-string "^ *//" "" comment))) - ) ;cond - (delete-region beg end) - (web-mode-insert-and-indent comment) - (goto-char beg) - ) - ) ;cond - (indent-according-to-mode) - ))) - -(defun web-mode-uncomment-erb-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (cond - ((string= (buffer-substring-no-properties beg (+ beg 4)) "<%#=") - (web-mode-remove-text-at-pos 1 (+ beg 2))) - ((string-match-p "<[%[:alpha:]]" (buffer-substring-no-properties (+ beg 2) (- end 2))) - (web-mode-remove-text-at-pos 2 (1- end)) - (web-mode-remove-text-at-pos 3 beg)) - (t - (web-mode-remove-text-at-pos 1 (+ beg 2))) - ) ;cond - ) - ) - -(defun web-mode-uncomment-artanis-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (cond - ((string= (buffer-substring-no-properties beg (+ beg 4)) "<%;=") - (web-mode-remove-text-at-pos 1 (+ beg 2))) - ((string-match-p "<[%[:alpha:]]" (buffer-substring-no-properties (+ beg 2) (- end 2))) - (web-mode-remove-text-at-pos 2 (1- end)) - (web-mode-remove-text-at-pos 3 beg)) - (t - (web-mode-remove-text-at-pos 1 (+ beg 2))) - ) ;cond - ) - ) - -(defun web-mode-uncomment-ejs-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 1 (+ beg 2)))) - -(defun web-mode-uncomment-django-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (cond - ((web-mode-looking-at-p "{#[{%]" beg) - (web-mode-remove-text-at-pos 1 (1- end)) - (web-mode-remove-text-at-pos 1 (1+ beg)) - ) - (t - (web-mode-remove-text-at-pos 2 (1- end)) - (web-mode-remove-text-at-pos 2 beg)) - ) ;cond - )) - -(defun web-mode-uncomment-ctemplate-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 5 (- end 4)) - (web-mode-remove-text-at-pos 5 beg))) - -(defun web-mode-uncomment-dust-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 1 (1- end)) - (web-mode-remove-text-at-pos 1 (1+ beg)))) - -(defun web-mode-uncomment-aspx-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 1 (1- end)) - (web-mode-remove-text-at-pos 1 (1+ beg)))) - -(defun web-mode-uncomment-jsp-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 2 (+ beg 2)))) - -(defun web-mode-uncomment-go-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 2 (+ beg 2)) - (web-mode-remove-text-at-pos 2 (- end 5)))) - -(defun web-mode-uncomment-svelte-block (pos) - (let (beg end) - (setq beg (web-mode-block-beginning-position pos) - end (web-mode-block-end-position pos)) - (web-mode-remove-text-at-pos 1 (1- end)) - (web-mode-remove-text-at-pos 1 (1+ beg)))) - -(defun web-mode-snippet-names () - (let (codes) - (dolist (snippet web-mode-snippets) - (add-to-list 'codes (car snippet) t)) - codes)) - -(defun web-mode-snippet-insert (code) - "Insert a snippet." - (interactive - (list (completing-read "Snippet: " (web-mode-snippet-names)))) - (let (beg - (continue t) - (counter 0) - end - sel - snippet - (l (length web-mode-snippets)) - pos) - (when mark-active - (setq sel (web-mode-trim (buffer-substring-no-properties - (region-beginning) (region-end)))) - (delete-region (region-beginning) (region-end))) - (while (and continue (< counter l)) - (setq snippet (nth counter web-mode-snippets)) - (when (string= (car snippet) code) - (setq continue nil)) - (setq counter (1+ counter))) - (when snippet - (setq snippet (cdr snippet)) - (setq beg (point-at-bol)) - (insert snippet) - (setq pos (point) - end (point)) - (cond - ((string-match-p "¦" snippet) - (search-backward "¦") - (delete-char 1) - (setq pos (point) - end (1- end))) - ((string-match-p "|" snippet) - (search-backward "|") - (delete-char 1) - (setq pos (point) - end (1- end))) - ) ;cond - (when sel - (insert sel) - (setq pos (point) - end (+ end (length sel)))) - (goto-char end) - (setq end (point-at-eol)) - (unless sel (goto-char pos)) - (indent-region beg end)) - )) - -(defun web-mode-looking-at (regexp pos) - (save-excursion - (goto-char pos) - (looking-at regexp))) - -(defun web-mode-looking-at-p (regexp pos) - (save-excursion - (goto-char pos) - (looking-at-p regexp))) - -(defun web-mode-looking-back (regexp pos &optional limit greedy) - (save-excursion - (goto-char pos) - (if limit - (looking-back regexp limit greedy) - (looking-back regexp (point-min))))) - -(defun web-mode-insert-text-at-pos (text pos) - (let ((mem web-mode-enable-auto-pairing)) - (setq web-mode-enable-auto-pairing nil) - (save-excursion - (goto-char pos) - (insert text) - (setq web-mode-enable-auto-pairing mem) - ))) - -(defun web-mode-remove-text-at-pos (n &optional pos) - (unless pos (setq pos (point))) - (delete-region pos (+ pos n))) - -(defun web-mode-insert-and-indent (text) - (let (beg end) - (setq beg (point-at-bol)) - (insert text) - (setq end (point-at-eol)) - (indent-region beg end) - )) - -(defun web-mode-column-at-pos (pos) - (save-excursion - (goto-char pos) - (current-column))) - -(defun web-mode-indentation-at-pos (pos) - (save-excursion - (goto-char pos) - (current-indentation))) - -(defun web-mode-navigate (&optional pos) - "Move point to the matching opening/closing tag/block." - (interactive) - (unless pos (setq pos (point))) - (let (init) - (goto-char pos) - (setq init (point)) - (when (> (current-indentation) (current-column)) - (back-to-indentation)) - (setq pos (point)) - (cond - ((and (get-text-property pos 'block-side) - (web-mode-block-beginning) - (web-mode-block-controls-get (point))) - (web-mode-block-match)) - ((member (get-text-property pos 'tag-type) '(start end)) - (web-mode-tag-beginning) - (web-mode-tag-match)) - (t - (goto-char init)) - ) - )) - -(defun web-mode-block-match (&optional pos) - (unless pos (setq pos (point))) - (let (pos-ori controls control (counter 1) type (continue t) pair) - (setq pos-ori pos) - (goto-char pos) - (setq controls (web-mode-block-controls-get pos)) - ;;(message "controls=%S" controls) - (cond - (controls - (setq pair (car controls)) - (setq control (cdr pair)) - (setq type (car pair)) - (when (eq type 'inside) (setq type 'close)) - (while continue - (cond - ((and (> pos-ori 1) (bobp)) - (setq continue nil)) - ((or (and (eq type 'open) (not (web-mode-block-next))) - (and (eq type 'close) (not (web-mode-block-previous)))) - (setq continue nil) - ) - ((null (setq controls (web-mode-block-controls-get (point)))) - ) - (t - ;;TODO : est il nécessaire de faire un reverse sur controls si on doit matcher backward - (dolist (pair controls) - (cond - ((not (string= (cdr pair) control)) - ) - ((eq (car pair) 'inside) - ) - ((eq (car pair) type) - (setq counter (1+ counter))) - (t - (setq counter (1- counter))) - ) - ) ;dolist - (when (= counter 0) - (setq continue nil)) - ) ;t - ) ;cond - ) ;while - (if (= counter 0) (point) nil) - ) ;controls - (t - (goto-char pos-ori) - nil - ) ;controls = nul - ) ;conf - )) - -(defun web-mode-tag-match (&optional pos) - "Move point to the matching opening/closing tag." - (interactive) - (unless pos (setq pos (point))) - (let (regexp name) - (cond - ((eq (get-text-property pos 'tag-type) 'void) - (web-mode-tag-beginning)) - ((and (eq (get-text-property pos 'tag-type) 'comment) - (web-mode-looking-at-p " %S %S" pos (get-text-property pos 'jsx-depth)) - ) - ((and blockside - (member (get-text-property pos 'block-token) '(string comment)) - (eq (get-text-property pos 'block-token) (get-text-property (1- pos) 'block-token))) - (setq pos (web-mode-block-token-beginning-position pos))) - ((and (not blockside) - (member (get-text-property pos 'part-token) '(string comment)) - (eq (get-text-property pos 'part-token) (get-text-property (1- pos) 'part-token))) - (setq pos (web-mode-part-token-beginning-position pos))) - ((and (not blockside) - (get-text-property pos 'block-side)) - (when (setq pos (web-mode-block-beginning-position pos)) - (setq pos (1- pos)))) - ((member char '(?\) ?\] ?\})) - (setq pos (web-mode-part-opening-paren-position pos reg-beg)) - (setq pos (1- pos))) - ((and (eq char ?\=) - (web-mode-looking-back "[<>!=]+" pos reg-beg t)) - (setq pos (- pos 1 (length (match-string-no-properties 0))))) - ((member char '(?\( ?\{ ?\[ ?\= ?\< ?\>)) - (web-mode-looking-at ".[ \t\n]*" pos) - (setq continue nil - pos (+ pos (length (match-string-no-properties 0))))) - - ((web-mode-looking-at "\\(return\\)[ \n]" pos) - (setq continue nil - pos (+ pos (length (match-string-no-properties 0))))) - ((and (eq char ?\:) - (web-mode-looking-back "[{,][ \t\n]*[[:alnum:]_]+[ ]*" pos)) - (web-mode-looking-at ".[ \t\n]*" pos) - (setq continue nil - pos (+ pos (length (match-string-no-properties 0))))) - (t - (setq pos (web-mode-rsb-position pos regexp reg-beg)) - (when (not pos) - (cond - (is-jsx - (when (web-mode-looking-at "[ \n]*" reg-beg) - (setq pos (+ reg-beg (length (match-string-no-properties 0))))) - (setq continue nil)) - (t - (message "javascript-statement-beginning-position ** search failure **") - (setq continue nil - pos reg-beg)) - ) ;cond - ) - ) ;t - ) ;cond - ) ;while - ;;(message "%S -------" pos) - pos)) - -(defun web-mode-javascript-args-beginning-position (pos &optional reg-beg) - (unless pos (setq pos (point))) - (setq pos (1- pos)) - (let ((char nil) - (blockside (get-text-property pos 'block-side)) - (i 0) - (continue (not (null pos)))) - (unless reg-beg - (if blockside - (setq reg-beg (web-mode-block-beginning-position pos)) - (setq reg-beg (web-mode-part-beginning-position pos))) - ) - (while continue - (setq char (char-after pos)) - ;;(message "pos(%S) char(%c)" pos char) - (cond - ((> (setq i (1+ i)) 20000) - (message "javascript-args-beginning-position ** warning (%S) **" pos) - (setq continue nil - pos nil)) - ((null pos) - (message "javascript-args-beginning-position ** invalid pos **") - (setq continue nil)) - ((< pos reg-beg) - (message "javascript-args-beginning-position ** failure(position) **") - (setq continue nil - pos reg-beg)) - ((and blockside - (member (get-text-property pos 'block-token) '(string comment)) - (eq (get-text-property pos 'block-token) (get-text-property (1- pos) 'block-token))) - (setq pos (web-mode-block-token-beginning-position pos))) - ((and (not blockside) - (member (get-text-property pos 'part-token) '(string comment)) - (eq (get-text-property pos 'part-token) (get-text-property (1- pos) 'part-token))) - (setq pos (web-mode-part-token-beginning-position pos))) - ((and (not blockside) - (get-text-property pos 'block-side)) - (when (setq pos (web-mode-block-beginning-position pos)) - (setq pos (1- pos))) - ) - ((member char '(?\) ?\] ?\})) - (when (setq pos (web-mode-part-opening-paren-position pos reg-beg)) - (setq pos (1- pos)))) - ((member char '(?\( ?\[ ?\{)) - (web-mode-looking-at ".[ ]*" pos) - (setq pos (+ pos (length (match-string-no-properties 0))) - continue nil) - ) - ((web-mode-looking-at "\\(var\\|let\\|return\\|const\\)[ \n]" pos) - (setq pos (+ pos (length (match-string-no-properties 0))) - continue nil)) - (t - (setq pos (web-mode-rsb-position pos "[\]\[}{)(]\\|\\(var\\|let\\|return\\|const\\)" reg-beg)) - (when (not pos) - (message "javascript-args-beginning-position ** search failure **") - (setq continue nil - pos reg-beg))) - ) ;cond - ) ;while - ;;(message "=%S" pos) - pos)) - -(defun web-mode-javascript-calls-beginning-position (pos &optional reg-beg) - (unless pos (setq pos (point))) - ;;(message "pos=%S" pos) - (let ((char nil) - (dot-pos nil) - (blockside (get-text-property pos 'block-side)) - (i 0) - (continue (not (null pos)))) - (unless reg-beg - (setq reg-beg (if blockside - (web-mode-block-beginning-position pos) - (web-mode-part-beginning-position pos)))) - (while continue - (setq char (char-after pos)) - ;;(message "%S| %S=%c" reg-beg pos char) - (cond - ((> (setq i (1+ i)) 20000) - (message "javascript-calls-beginning-position ** warning (%S) **" pos) - (setq continue nil - pos nil)) - ((null pos) - (message "javascript-calls-beginning-position ** invalid pos **") - (setq continue nil)) - ((< pos reg-beg) - (setq continue nil - pos reg-beg)) - ((and blockside - (member (get-text-property pos 'block-token) '(string comment)) - (eq (get-text-property pos 'block-token) (get-text-property (1- pos) 'block-token))) - (setq pos (web-mode-block-token-beginning-position pos))) - ((and (not blockside) - (member (get-text-property pos 'part-token) '(string comment)) - (eq (get-text-property pos 'part-token) (get-text-property (1- pos) 'part-token))) - (setq pos (web-mode-part-token-beginning-position pos))) - ((and (not blockside) - (get-text-property pos 'block-side)) - (when (setq pos (web-mode-block-beginning-position pos)) - (setq pos (1- pos)))) - ((and (member char '(?\.)) (> i 1)) - (setq dot-pos pos - pos (1- pos))) - ((member char '(?\) ?\])) - (when (setq pos (web-mode-part-opening-paren-position pos reg-beg)) - (setq pos (1- pos))) - ) - ((member char '(?\( ?\{ ?\} ?\[ ?\= ?\? ?\: ?\; ?\, ?\& ?\| ?\>)) - (web-mode-looking-at ".[ \t\n]*" pos) - (setq pos (+ pos (length (match-string-no-properties 0))) - continue nil)) - ((web-mode-looking-at "\\(return\\|else\\|const\\)[ \n]" pos) - (setq pos (+ pos (length (match-string-no-properties 0))) - continue nil)) - (t - (setq pos (web-mode-rsb-position pos "[\]\[}{)(=?:;,&|>.]\\|\\(return\\|else\\|const\\)" reg-beg)) - (when (not pos) - (message "javascript-calls-beginning-position ** search failure **") - (setq pos reg-beg - continue nil)) - ) ;t - ) ;cond - ) ;while - ;;(message "pos=%S dot-pos=%S" pos dot-pos) - (if (null pos) pos (cons pos dot-pos)) - )) - -(defun web-mode-part-token-beginning-position (&optional pos) - (unless pos (setq pos (point))) - (cond - ((not (get-text-property pos 'part-token)) - nil) - ((or (= pos (point-min)) - (and (> pos (point-min)) - (not (get-text-property (1- pos) 'part-token)))) - pos) - (t - (setq pos (previous-single-property-change pos 'part-token)) - (if (and pos (> pos (point-min))) pos (point-min))) - )) - -(defun web-mode-part-token-end-position (&optional pos) - (unless pos (setq pos (point))) - (cond - ((not (get-text-property pos 'part-token)) - nil) - ((or (= pos (point-max)) - (not (get-text-property (1+ pos) 'part-token))) - pos) - (t - (1- (next-single-property-change pos 'part-token))) - )) - -(defun web-mode-block-token-beginning-position (&optional pos) - (unless pos (setq pos (point))) - (cond - ((not (get-text-property pos 'block-token)) - nil) - ((or (= pos (point-min)) - (and (> pos (point-min)) - (not (get-text-property (1- pos) 'block-token)))) - pos) - (t - (setq pos (previous-single-property-change pos 'block-token)) - (if (and pos (> pos (point-min))) pos (point-min))) - )) - -(defun web-mode-block-token-end-position (&optional pos) - (unless pos (setq pos (point))) - (cond - ((not (get-text-property pos 'block-token)) - nil) - ((or (= pos (point-max)) - (not (get-text-property (1+ pos) 'block-token))) - pos) - (t - (1- (next-single-property-change pos 'block-token))) - )) - -(defun web-mode-block-code-end-position (&optional pos) - (unless pos (setq pos (point))) - (setq pos (web-mode-block-end-position pos)) - (cond - ((not pos) - nil) - ((and (eq (get-text-property pos 'block-token) 'delimiter-end) - (eq (get-text-property (1- pos) 'block-token) 'delimiter-end)) - (previous-single-property-change pos 'block-token)) - ((= pos (1- (point-max))) ;; TODO: comparer plutot avec line-end-position - (point-max)) - (t - pos) - )) - -(defun web-mode-block-end-position (&optional pos) - (unless pos (setq pos (point))) - (cond - ((get-text-property pos 'block-end) - pos) - ((get-text-property pos 'block-side) - (or (next-single-property-change pos 'block-end) - (point-max))) - (t - nil) - )) - -(defun web-mode-block-previous-position (&optional pos) - (unless pos (setq pos (point))) - (cond - ((= pos (point-min)) - (setq pos nil)) - ((get-text-property pos 'block-side) - (setq pos (web-mode-block-beginning-position pos)) - (cond - ((or (null pos) (= pos (point-min))) - (setq pos nil) - ) - ((and (setq pos (previous-single-property-change pos 'block-beg)) - (> pos (point-min))) - (setq pos (1- pos)) - ) - ) - ) ;block-side - ((get-text-property (1- pos) 'block-side) - (setq pos (web-mode-block-beginning-position (1- pos))) - ) - (t - (setq pos (previous-single-property-change pos 'block-side)) - (cond - ((and (null pos) (get-text-property (point-min) 'block-beg)) - (setq pos (point-min))) - ((and pos (> pos (point-min))) - (setq pos (web-mode-block-beginning-position (1- pos)))) - ) - ) - ) ;conf - pos) - -(defun web-mode-block-next-position (&optional pos limit) - (unless pos (setq pos (point))) - (unless limit (setq limit (point-max))) - (cond - ((and (get-text-property pos 'block-side) - (setq pos (web-mode-block-end-position pos)) - (< pos (point-max)) - (setq pos (1+ pos))) - (unless (get-text-property pos 'block-beg) - (setq pos (next-single-property-change pos 'block-side))) - ) - (t - (setq pos (next-single-property-change pos 'block-side))) - ) ;cond - (if (and pos (<= pos limit)) pos nil)) - -(defun web-mode-is-css-string (pos) - (let (beg) - (cond - ((and (setq beg (web-mode-part-token-beginning-position pos)) - (web-mode-looking-at-p "`" beg) - (web-mode-looking-back "\\(styled[[:alnum:].]+\\|css\\)" beg)) - beg) - (t - nil) - ) ;cond - )) - -;; Relay.QL , gql, graphql -(defun web-mode-is-ql-string (pos prefix-regexp) - (let (beg) - (cond - ((and (setq beg (web-mode-part-token-beginning-position pos)) - (web-mode-looking-back prefix-regexp beg)) - beg) - (t - nil) - ) ;cond - )) - -(defun web-mode-is-html-string (pos) - (let (beg) - (cond - ((and (setq beg (web-mode-part-token-beginning-position pos)) - (web-mode-looking-at-p "`[ \t\n]*<[a-zA-Z]" beg) - (web-mode-looking-back "\\(template\\|html\\)\\([ ]*[=:][ ]*\\)?" beg)) - beg) - (t - nil) - ) ;cond - )) - -;;---- EXCURSION --------------------------------------------------------------- - -(defun web-mode-backward-sexp (n) - (interactive "p") - (if (< n 0) (web-mode-forward-sexp (- n)) - (let (pos) - (dotimes (_ n) - (skip-chars-backward "[:space:]") - (setq pos (point)) - (cond - ((bobp) nil) - ((get-text-property (1- pos) 'block-end) - (backward-char 1) - (web-mode-block-beginning)) - ((get-text-property (1- pos) 'block-token) - (backward-char 1) - (web-mode-block-token-beginning)) - ((get-text-property (1- pos) 'part-token) - (backward-char 1) - (web-mode-part-token-beginning)) - ((get-text-property (1- pos) 'tag-end) - (backward-char 1) - (web-mode-element-beginning)) - ((get-text-property (1- pos) 'tag-attr) - (backward-char 1) - (web-mode-attribute-beginning)) - ((get-text-property (1- pos) 'tag-type) - (backward-char 1) - (web-mode-tag-beginning)) - ((get-text-property (1- pos) 'jsx-end) - (backward-char 1) - (web-mode-jsx-beginning)) - (t - (let ((forward-sexp-function nil)) - (backward-sexp)) - ) ;case t - ) ;cond - ) ;dotimes - ))) ;let if defun - -(defun web-mode-forward-sexp (n) - (interactive "p") - (if (< n 0) (web-mode-backward-sexp (- n)) - (let (pos) - (dotimes (_ n) - (skip-chars-forward "[:space:]") - (setq pos (point)) - (cond - ((eobp) nil) - ((get-text-property pos 'block-beg) - (web-mode-block-end)) - ((get-text-property pos 'block-token) - (web-mode-block-token-end)) - ((get-text-property pos 'part-token) - (web-mode-part-token-end)) - ((get-text-property pos 'tag-beg) - (web-mode-element-end)) - ((get-text-property pos 'tag-attr) - (web-mode-attribute-end)) - ((get-text-property pos 'tag-type) - (web-mode-tag-end)) - ((get-text-property pos 'jsx-beg) - (web-mode-jsx-end)) - (t - (let ((forward-sexp-function nil)) - (forward-sexp)) - ) ;case t - ) ;cond - ) ;dotimes - ))) ;let if defun - -(defun web-mode-comment-beginning () - "Fetch current comment beg." - (interactive) - (web-mode-go (web-mode-comment-beginning-position (point)))) - -(defun web-mode-comment-end () - "Fetch current comment end." - (interactive) - (web-mode-go (web-mode-comment-end-position (point)) 1)) - -(defun web-mode-tag-beginning () - "Fetch current html tag beg." - (interactive) - (web-mode-go (web-mode-tag-beginning-position (point)))) - -(defun web-mode-tag-end () - "Fetch current html tag end." - (interactive) - (web-mode-go (web-mode-tag-end-position (point)) 1)) - -(defun web-mode-tag-previous () - "Fetch previous tag." - (interactive) - (web-mode-go (web-mode-tag-previous-position (point)))) - -(defun web-mode-tag-next () - "Fetch next tag. Might be html comment or server tag (e.g. jsp)." - (interactive) - (web-mode-go (web-mode-tag-next-position (point)))) - -(defun web-mode-attribute-beginning () - "Fetch html attribute beginning." - (interactive) - (web-mode-go (web-mode-attribute-beginning-position (point)))) - -(defun web-mode-attribute-end () - "Fetch html attribute end." - (interactive) - (web-mode-go (web-mode-attribute-end-position (point)) 1)) - -(defun web-mode-attribute-next (&optional arg) - "Fetch next attribute." - (interactive "p") - (unless arg (setq arg 1)) - (cond - ((= arg 1) (web-mode-go (web-mode-attribute-next-position (point)))) - ((< arg 1) (web-mode-element-previous (* arg -1))) - (t - (while (>= arg 1) - (setq arg (1- arg)) - (web-mode-go (web-mode-attribute-next-position (point))) - ) - ) - ) - ) - -(defun web-mode-attribute-previous (&optional arg) - "Fetch previous attribute." - (interactive "p") - (unless arg (setq arg 1)) - (unless arg (setq arg 1)) - (cond - ((= arg 1) (web-mode-go (web-mode-attribute-previous-position (point)))) - ((< arg 1) (web-mode-element-next (* arg -1))) - (t - (while (>= arg 1) - (setq arg (1- arg)) - (web-mode-go (web-mode-attribute-previous-position (point))) - ) - ) - ) - ) - -(defun web-mode-element-previous (&optional arg) - "Fetch previous element." - (interactive "p") - (unless arg (setq arg 1)) - (cond - ((= arg 1) (web-mode-go (web-mode-element-previous-position (point)))) - ((< arg 1) (web-mode-element-next (* arg -1))) - (t - (while (>= arg 1) - (setq arg (1- arg)) - (web-mode-go (web-mode-element-previous-position (point))) - ) ;while - ) ;t - ) ;cond - ) - -(defun web-mode-element-next (&optional arg) - "Fetch next element." - (interactive "p") - (unless arg (setq arg 1)) - (cond - ((= arg 1) (web-mode-go (web-mode-element-next-position (point)))) - ((< arg 1) (web-mode-element-previous (* arg -1))) - (t - (while (>= arg 1) - (setq arg (1- arg)) - (web-mode-go (web-mode-element-next-position (point))) - ) ;while - ) ;t - ) ;cond - ) - -(defun web-mode-element-sibling-next () - "Fetch next sibling element." - (interactive) - (let ((pos (point))) - (save-excursion - (cond - ((not (get-text-property pos 'tag-type)) - (if (and (web-mode-element-parent) - (web-mode-tag-match) - (web-mode-tag-next) - (member (get-text-property (point) 'tag-type) '(start void comment))) - (setq pos (point)) - (setq pos nil)) - ) - ((member (get-text-property pos 'tag-type) '(start void)) - (if (and (web-mode-tag-match) - (web-mode-tag-next) - (member (get-text-property (point) 'tag-type) '(start void comment))) - (setq pos (point)) - (setq pos nil)) - ) - ((and (web-mode-tag-next) - (member (get-text-property (point) 'tag-type) '(start void comment))) - (setq pos (point))) - (t - (setq pos nil)) - ) ;cond - ) ;save-excursion - (web-mode-go pos))) - -(defun web-mode-element-sibling-previous () - "Fetch previous sibling element." - (interactive) - (let ((pos (point))) - (save-excursion - (cond - ((not (get-text-property pos 'tag-type)) - (if (and (web-mode-element-parent) - (web-mode-tag-previous) - (web-mode-element-beginning)) - (setq pos (point)) - (setq pos nil)) - ) - ((eq (get-text-property pos 'tag-type) 'start) - (if (and (web-mode-tag-beginning) - (web-mode-tag-previous) - (web-mode-element-beginning)) - (setq pos (point)) - (setq pos nil)) - ) - ((and (web-mode-element-beginning) - (web-mode-tag-previous) - (web-mode-element-beginning)) - (setq pos (point))) - (t - (setq pos nil)) - ) ;cond - ) ;save-excursion - (web-mode-go pos))) - -(defun web-mode-element-beginning () - "Move to beginning of element." - (interactive) - (web-mode-go (web-mode-element-beginning-position (point)))) - -(defun web-mode-element-end () - "Move to end of element." - (interactive) - (web-mode-go (web-mode-element-end-position (point)) 1)) - -(defun web-mode-element-parent () - "Fetch parent element." - (interactive) - (web-mode-go (web-mode-element-parent-position (point)))) - -(defun web-mode-element-child () - "Fetch child element." - (interactive) - (web-mode-go (web-mode-element-child-position (point)))) - -(defun web-mode-dom-traverse () - "Traverse html dom tree." - (interactive) - (cond - ((web-mode-element-child) - ) - ((web-mode-element-sibling-next) - ) - ((and (web-mode-element-parent) - (not (web-mode-element-sibling-next))) - (goto-char (point-min))) - (t - (goto-char (point-min))) - ) ;cond - ) - -(defun web-mode-closing-paren (limit) - (let ((pos (web-mode-closing-paren-position (point) limit))) - (if (or (null pos) (> pos limit)) - nil - (goto-char pos) - pos) - )) - -(defun web-mode-part-next () - "Move point to the beginning of the next part." - (interactive) - (web-mode-go (web-mode-part-next-position (point)))) - -(defun web-mode-part-beginning () - "Move point to the beginning of the current part." - (interactive) - (web-mode-go (web-mode-part-beginning-position (point)))) - -(defun web-mode-part-end () - "Move point to the end of the current part." - (interactive) - (web-mode-go (web-mode-part-end-position (point)) 1)) - -(defun web-mode-block-previous () - "Move point to the beginning of the previous block." - (interactive) - (web-mode-go (web-mode-block-previous-position (point)))) - -(defun web-mode-block-next () - "Move point to the beginning of the next block." - (interactive) - (web-mode-go (web-mode-block-next-position (point)))) - -(defun web-mode-block-beginning () - "Move point to the beginning of the current block." - (interactive) - (web-mode-go (web-mode-block-beginning-position (point)))) - -(defun web-mode-block-end () - "Move point to the end of the current block." - (interactive) - (web-mode-go (web-mode-block-end-position (point)) 1)) - -(defun web-mode-block-token-beginning () - (web-mode-go (web-mode-block-token-beginning-position (point)))) - -(defun web-mode-block-token-end () - (web-mode-go (web-mode-block-token-end-position (point)) 1)) - -(defun web-mode-part-token-beginning () - (web-mode-go (web-mode-part-token-beginning-position (point)))) - -(defun web-mode-part-token-end () - (web-mode-go (web-mode-part-token-end-position (point)) 1)) - -(defun web-mode-block-opening-paren (limit) - (web-mode-go (web-mode-block-opening-paren-position (point) limit))) - -(defun web-mode-block-string-beginning (&optional pos block-beg) - (unless pos (setq pos (point))) - (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) - (web-mode-go (web-mode-block-string-beginning-position pos block-beg))) - -(defun web-mode-block-statement-beginning (pos block-beg is-ternary) - (unless pos (setq pos (point))) - (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) - (web-mode-go (web-mode-block-statement-beginning-position pos block-beg is-ternary))) - -(defun web-mode-block-args-beginning (&optional pos block-beg) - (unless pos (setq pos (point))) - (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) - (web-mode-go (web-mode-block-args-beginning-position pos block-beg))) - -(defun web-mode-block-calls-beginning (&optional pos block-beg) - (unless pos (setq pos (point))) - (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) - (web-mode-go (web-mode-block-calls-beginning-position pos block-beg))) - -(defun web-mode-javascript-string-beginning (&optional pos reg-beg) - (unless pos (setq pos (point))) - (unless reg-beg - (if (get-text-property pos 'block-side) - (setq reg-beg (web-mode-block-beginning-position pos)) - (setq reg-beg (web-mode-part-beginning-position pos)))) - (web-mode-go (web-mode-javascript-string-beginning-position pos reg-beg))) - -(defun web-mode-javascript-statement-beginning (pos reg-beg is-ternary) - (unless pos (setq pos (point))) - (unless reg-beg - (if (get-text-property pos 'block-side) - (setq reg-beg (web-mode-block-beginning-position pos)) - (setq reg-beg (web-mode-part-beginning-position pos)))) - (web-mode-go (web-mode-javascript-statement-beginning-position pos reg-beg is-ternary))) - -(defun web-mode-javascript-args-beginning (&optional pos reg-beg) - (unless pos (setq pos (point))) - (unless reg-beg - (setq reg-beg (if (get-text-property pos 'block-side) - (web-mode-block-beginning-position pos) - (web-mode-part-beginning-position pos)))) - ;;(message "reg-beg%S" reg-beg) - (web-mode-go (web-mode-javascript-args-beginning-position pos reg-beg))) - -(defun web-mode-javascript-calls-beginning (&optional pos reg-beg) - (unless pos (setq pos (point))) - (unless reg-beg - (if (get-text-property pos 'block-side) - (setq reg-beg (web-mode-block-beginning-position pos)) - (setq reg-beg (web-mode-part-beginning-position pos)))) - (let (pair) - (setq pair (web-mode-javascript-calls-beginning-position pos reg-beg)) - (when pair (web-mode-go (car pair))) - )) - -(defun web-mode-go (pos &optional offset) - (unless offset (setq offset 0)) - (when pos - (cond - ((and (> offset 0) (<= (+ pos offset) (point-max))) - (setq pos (+ pos offset))) - ((and (< offset 0) (>= (+ pos offset) (point-min))) - (setq pos (+ pos offset))) - ) ;cond - (goto-char pos)) - pos) - -;;---- SEARCH ------------------------------------------------------------------ - -(defun web-mode-rsf-balanced (regexp-open regexp-close &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) - (level 1) - (pos (point)) - ret - (regexp (concat regexp-open "\\|" regexp-close))) - (while continue - (setq ret (re-search-forward regexp limit noerror)) - (cond - ((null ret) - (setq continue nil) - ) - (t - (if (string-match-p regexp-open (match-string-no-properties 0)) - (setq level (1+ level)) - (setq level (1- level))) - (when (< level 1) - (setq continue nil) - ) - ) ;t - ) ;cond - ) ;while - (when (not (= level 0)) (goto-char pos)) - ret)) - -(defun web-mode-block-sb (expr &optional limit noerror) - (unless limit (setq limit (web-mode-block-beginning-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-backward expr limit noerror)) - (when (or (null ret) - (not (get-text-property (point) 'block-token))) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-block-sf (expr &optional limit noerror) - (unless limit (setq limit (web-mode-block-end-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-forward expr limit noerror)) - (when (or (null ret) - (not (get-text-property (point) 'block-token))) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-block-rsb (regexp &optional limit noerror) - (unless limit (setq limit (web-mode-block-beginning-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-backward regexp limit noerror)) - (when (or (null ret) - (not (get-text-property (point) 'block-token))) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-block-rsf (regexp &optional limit noerror) - (unless limit (setq limit (web-mode-block-end-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-forward regexp limit noerror)) - (when (or (null ret) - (not (get-text-property (point) 'block-token))) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-part-sb (expr &optional limit noerror) - (unless limit (setq limit (web-mode-part-beginning-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-backward expr limit noerror)) - (when (or (null ret) - (and (not (get-text-property (point) 'part-token)) - (not (get-text-property (point) 'block-side))) - ) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-part-sf (expr &optional limit noerror) - (unless limit (setq limit (web-mode-part-end-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-forward expr limit noerror)) - (when (or (null ret) - (and (not (get-text-property (point) 'part-token)) - (not (get-text-property (point) 'block-side))) - ) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-part-rsb (regexp &optional limit noerror) - (unless limit (setq limit (web-mode-part-beginning-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-backward regexp limit noerror)) - (when (or (null ret) - (and (not (get-text-property (point) 'part-token)) - (not (get-text-property (point) 'block-side))) - ) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-part-rsf (regexp &optional limit noerror) - (unless limit (setq limit (web-mode-part-end-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-forward regexp limit t)) - (when (or (null ret) - (and (not (get-text-property (point) 'part-token)) - (not (get-text-property (point) 'block-side))) - ) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-javascript-rsb (regexp &optional limit noerror) - (unless limit (setq limit (web-mode-part-beginning-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-backward regexp limit noerror)) - (when (or (null ret) - (and (not (get-text-property (point) 'part-token)) - (not (get-text-property (point) 'block-side)) - (not (get-text-property (point) 'jsx-depth))) - ) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-javascript-rsf (regexp &optional limit noerror) - (unless limit (setq limit (web-mode-part-end-position (point)))) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-forward regexp limit t)) - (when (or (null ret) - (and (not (get-text-property (point) 'part-token)) - (not (get-text-property (point) 'block-side)) - (not (get-text-property (point) 'jsx-depth))) - ) - (setq continue nil) - ) ;when - ) ;while - ret)) - -(defun web-mode-dom-sf (expr &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-forward expr limit noerror)) - (if (or (null ret) - (not (get-text-property (- (point) (length expr)) 'block-side))) - (setq continue nil)) - ) - ret)) - -(defun web-mode-dom-rsf (regexp &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) (ret nil)) - (while continue - (setq ret (re-search-forward regexp limit noerror)) - ;; (message "ret=%S point=%S limit=%S i=%S" ret (point) limit 0) - (cond - ((null ret) - (setq continue nil)) - ((or (get-text-property (match-beginning 0) 'block-side) - (get-text-property (match-beginning 0) 'part-token)) - ) - (t - (setq continue nil)) - ) ;cond - ) ;while - ret)) - -(defun web-mode-rsb-position (pos regexp &optional limit noerror) - (unless noerror (setq noerror t)) - (save-excursion - (goto-char pos) - (if (re-search-backward regexp limit noerror) (point) nil) - )) - -(defun web-mode-rsb (regexp &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-backward regexp limit noerror)) - (if (or (null ret) - (not (web-mode-is-comment-or-string))) - (setq continue nil))) - ret)) - -(defun web-mode-rsf (regexp &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (re-search-forward regexp limit noerror)) - (if (or (null ret) - (not (web-mode-is-comment-or-string))) - (setq continue nil)) - ) - ret)) - -(defun web-mode-sb (expr &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-backward expr limit noerror)) - (if (or (null ret) - (not (web-mode-is-comment-or-string))) - (setq continue nil))) - ret)) - -(defun web-mode-sf (expr &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) ret) - (while continue - (setq ret (search-forward expr limit noerror)) - (if (or (null ret) - (not (web-mode-is-comment-or-string))) - (setq continue nil))) - ret)) - -(defun web-mode-content-rsf (regexp &optional limit noerror) - (unless noerror (setq noerror t)) - (let ((continue t) ret beg end) - (while continue - (setq ret (re-search-forward regexp limit noerror) - beg (if (null ret) (point) (match-beginning 0)) - end (if (null ret) (point) (1- (match-end 0)))) - (if (or (null ret) - (and (web-mode-is-content beg) - (web-mode-is-content end))) - (setq continue nil))) - ret)) - -;;---- ADVICES ----------------------------------------------------------------- - -(defadvice ac-start (before web-mode-set-up-ac-sources activate) - "Set `ac-sources' based on current language before running auto-complete." - (when (equal major-mode 'web-mode) - ;; set ignore each time to nil. User has to implement a hook to change it - ;; for each completion - (setq web-mode-ignore-ac-start-advice nil) - (run-hooks 'web-mode-before-auto-complete-hooks) - (unless web-mode-ignore-ac-start-advice - (when web-mode-ac-sources-alist - (let ((new-web-mode-ac-sources - (assoc (web-mode-language-at-pos) - web-mode-ac-sources-alist))) - (setq ac-sources (cdr new-web-mode-ac-sources))))))) - -;;---- MINOR MODE ADDONS ------------------------------------------------------- - -(defun web-mode-yasnippet-exit-hook () - "Yasnippet exit hook" - (when (and (boundp 'yas-snippet-beg) (boundp 'yas-snippet-end)) - (indent-region yas-snippet-beg yas-snippet-end))) - -(defun web-mode-imenu-index () - (interactive) - "Returns imenu items." - (let (toc-index - line) - (save-excursion - (goto-char (point-min)) - (while (not (eobp)) - (setq line (buffer-substring-no-properties - (line-beginning-position) - (line-end-position))) - (let (found - (i 0) - item - regexp - type - type-idx - content - content-idx - content-regexp - close-tag-regexp - concat-str - jumpto - str) - (while (and (not found ) (< i (length web-mode-imenu-regexp-list))) - (setq item (nth i web-mode-imenu-regexp-list)) - (setq regexp (nth 0 item)) - (setq type-idx (nth 1 item)) - (setq content-idx (nth 2 item)) - (setq concat-str (nth 3 item)) - (when (not (numberp content-idx)) - (setq content-regexp (nth 2 item) - close-tag-regexp (nth 4 item) - content-idx nil)) - - (when (string-match regexp line) - - (cond - (content-idx - (setq type (match-string type-idx line)) - (setq content (match-string content-idx line)) - (setq str (concat type concat-str content)) - (setq jumpto (line-beginning-position))) - (t - (let (limit) - (setq type (match-string type-idx line)) - (goto-char (line-beginning-position)) - (save-excursion - (setq limit (re-search-forward close-tag-regexp (point-max) t))) - - (when limit - (when (re-search-forward content-regexp limit t) - (setq content (match-string 1)) - (setq str (concat type concat-str content)) - (setq jumpto (line-beginning-position)) - ) - ))) - ) - (when str (setq toc-index - (cons (cons str jumpto) - toc-index) - ) - (setq found t)) - ) - (setq i (1+ i)))) - (forward-line) - (goto-char (line-end-position)) ;; make sure we are at eobp - )) - (nreverse toc-index))) - -;;---- UNIT TESTING ------------------------------------------------------------ - -(defun web-mode-test () - "Executes web-mode unit tests. See `web-mode-tests-directory'." - (interactive) - (let (files ret regexp) - (setq regexp "^[[:alnum:]][[:alnum:]._]+\\'") - (setq files (directory-files web-mode-tests-directory t regexp)) - (dolist (file files) - (cond - ((eq (string-to-char (file-name-nondirectory file)) ?\_) - (delete-file file)) - (t - (setq ret (web-mode-test-process file))) - ) ;cond - ) ;dolist - )) - -(defun web-mode-test-process (file) - (with-temp-buffer - (let (out sig1 sig2 success err) - (setq-default indent-tabs-mode nil) - (if (string-match-p "sql" file) - (setq web-mode-enable-sql-detection t) - (setq web-mode-enable-sql-detection nil)) - (insert-file-contents file) - (set-visited-file-name file) - (web-mode) - (setq sig1 (md5 (current-buffer))) - (delete-horizontal-space) - (while (not (eobp)) - (forward-line) - (delete-horizontal-space) - (end-of-line)) - (web-mode-buffer-indent) - (setq sig2 (md5 (current-buffer))) - (setq success (string= sig1 sig2)) - (setq out (concat (if success "ok" "ko") " : " (file-name-nondirectory file) "\n")) - (princ out) - (setq err (concat (file-name-directory file) "_err." (file-name-nondirectory file))) - (if success - (when (file-readable-p err) - (delete-file err)) - (write-file err) - (message "[%s]" (buffer-string)) - ) ;if - out))) - -;;---- MISC -------------------------------------------------------------------- - -(defun web-mode-set-engine (engine) - "Set the engine for the current buffer." - (interactive - (list (completing-read - "Engine: " - (let (engines) - (dolist (elt web-mode-engines) - (setq engines (append engines (list (car elt))))) - engines)))) - (setq web-mode-content-type "html" - web-mode-engine (web-mode-engine-canonical-name engine) - web-mode-minor-engine engine) - (web-mode-on-engine-setted) - (web-mode-buffer-fontify)) - -(defun web-mode-set-content-type (content-type) - "Set the content-type for the current buffer" - (interactive (list (completing-read "Content-type: " web-mode-part-content-types))) - (setq web-mode-content-type content-type) - (when (called-interactively-p 'any) - ) - (web-mode-buffer-fontify)) - -(defun web-mode-on-engine-setted () - (let (elt elts engines) - - (when (string= web-mode-engine "razor") (setq web-mode-enable-block-face t)) - ;;(setq web-mode-engine-attr-regexp (cdr (assoc web-mode-engine web-mode-engine-attr-regexps))) - (setq web-mode-engine-token-regexp (cdr (assoc web-mode-engine web-mode-engine-token-regexps))) - - ;;(message "%S %S %S" web-mode-engine web-mode-engine-attr-regexp web-mode-engine-token-regexp) - - (when (null web-mode-minor-engine) - (setq web-mode-minor-engine "none")) - - (setq elt (assoc web-mode-engine web-mode-engine-open-delimiter-regexps)) - (cond - (elt - (setq web-mode-block-regexp (cdr elt))) - ((string= web-mode-engine "archibus") - (setq web-mode-block-regexp nil)) - (t - (setq web-mode-engine "none")) - ) - - (unless (boundp 'web-mode-extra-auto-pairs) - (setq web-mode-extra-auto-pairs nil)) - - (setq web-mode-auto-pairs - (append - (cdr (assoc web-mode-engine web-mode-engines-auto-pairs)) - (cdr (assoc nil web-mode-engines-auto-pairs)) - (cdr (assoc web-mode-engine web-mode-extra-auto-pairs)) - (cdr (assoc nil web-mode-extra-auto-pairs)))) - - (unless (boundp 'web-mode-extra-snippets) - (setq web-mode-extra-snippets nil)) - - (setq elts - (append - (cdr (assoc web-mode-engine web-mode-extra-snippets)) - (cdr (assoc nil web-mode-extra-snippets)) - (cdr (assoc web-mode-engine web-mode-engines-snippets)) - (cdr (assoc nil web-mode-engines-snippets)))) - - ;;(message "%S" elts) - - (dolist (elt elts) - (unless (assoc (car elt) web-mode-snippets) - (setq web-mode-snippets (append (list elt) web-mode-snippets))) - ) - - (setq web-mode-engine-font-lock-keywords - (symbol-value (cdr (assoc web-mode-engine web-mode-engines-font-lock-keywords)))) - - (when (and (string= web-mode-minor-engine "jinja") - (not (member "endtrans" web-mode-django-control-blocks))) - (add-to-list 'web-mode-django-control-blocks "endtrans") - (setq web-mode-django-control-blocks-regexp - (regexp-opt web-mode-django-control-blocks t)) - ) - - (when (string= web-mode-engine "spip") - (modify-syntax-entry ?# "w" (syntax-table))) - -;; (message "%S" (symbol-value (cdr (assoc web-mode-engine web-mode-engines-font-lock-keywords)))) - - )) - -(defun web-mode-detect-engine () - (save-excursion - (goto-char (point-min)) - (when (re-search-forward "-\\*- engine:[ ]*\\([[:alnum:]-]+\\)[ ]*-\\*-" web-mode-chunk-length t) - (setq web-mode-minor-engine (match-string-no-properties 1)) - (setq web-mode-engine (web-mode-engine-canonical-name web-mode-minor-engine))) - web-mode-minor-engine)) - -(defun web-mode-guess-engine-and-content-type () - (let (buff-name elt found) - - (setq buff-name (buffer-file-name)) - (unless buff-name (setq buff-name (buffer-name))) - (setq web-mode-is-scratch (string= buff-name "*scratch*")) - (setq web-mode-content-type nil) - - (when (boundp 'web-mode-content-types-alist) - (setq found nil) - (dolist (elt web-mode-content-types-alist) - (when (and (not found) (string-match-p (cdr elt) buff-name)) - (setq web-mode-content-type (car elt) - found t)) - ) ;dolist - ) ;when - - (unless web-mode-content-type - (setq found nil) - (dolist (elt web-mode-content-types) - (when (and (not found) (string-match-p (cdr elt) buff-name)) - (setq web-mode-content-type (car elt) - found t) - ;;(message "%S" web-mode-content-type) - ) ;when - ) ;dolist - ) ;unless - - (when (boundp 'web-mode-engines-alist) - (setq found nil) - (dolist (elt web-mode-engines-alist) - (cond - ((stringp (cdr elt)) - (when (string-match-p (cdr elt) buff-name) - (setq web-mode-engine (car elt)))) - ((functionp (cdr elt)) - (when (funcall (cdr elt)) - (setq web-mode-engine (car elt)))) - ) ;cond - ) ;dolist - ) ;when - - (unless web-mode-engine - (setq found nil) - (dolist (elt web-mode-engine-file-regexps) - ;;(message "%S %S" (cdr elt) buff-name) - (when (and (not found) (string-match-p (cdr elt) buff-name)) - (setq web-mode-engine (car elt) - found t)) - ) - ) - - (when (and (or (null web-mode-engine) (string= web-mode-engine "none")) - (string-match-p "php" (buffer-substring-no-properties - (line-beginning-position) - (line-end-position)))) - (setq web-mode-engine "php")) - - (when (and (string= web-mode-content-type "javascript") - (string-match-p "@jsx" - (buffer-substring-no-properties - (point-min) - (if (< (point-max) web-mode-chunk-length) - (point-max) - web-mode-chunk-length) - ))) - (setq web-mode-content-type "jsx")) - - (when web-mode-engine - (setq web-mode-minor-engine web-mode-engine - web-mode-engine (web-mode-engine-canonical-name web-mode-engine)) - ) - - (when (and (or (null web-mode-engine) - (string= web-mode-engine "none")) - web-mode-enable-engine-detection) - (web-mode-detect-engine)) - - (web-mode-on-engine-setted) - - )) - -(defun web-mode-engine-canonical-name (name) - (let (engine) - (cond - ((null name) - nil) - ((assoc name web-mode-engines) - name) - (t - (dolist (elt web-mode-engines) - (when (and (null engine) (member name (cdr elt))) - (setq engine (car elt))) - ) ;dolist - engine) - ))) - -(defun web-mode-on-after-save () - (when web-mode-is-scratch - (web-mode-guess-engine-and-content-type) - (web-mode-buffer-fontify)) - nil) - -(defun web-mode-on-exit () - (web-mode-with-silent-modifications - (put-text-property (point-min) (point-max) 'invisible nil) - (remove-overlays) - (remove-hook 'change-major-mode-hook 'web-mode-on-exit t) - )) - -(defun web-mode-file-link (file) - "Insert a link to a file in html document. This function can be -extended to support more filetypes by customizing -`web-mode-links'." - (interactive - (list (file-relative-name (read-file-name "Link file: ")))) - (let ((matched nil) - (point-line (line-number-at-pos)) - (point-column (current-column))) - (dolist (type web-mode-links) - (when (string-match (car type) file) - (setq matched t) - (when (nth 2 type) - (goto-char (point-min)) - (search-forward "") - (backward-char 7) - (open-line 1)) - (insert (format (cadr type) file)) - (indent-for-tab-command) - (when (nth 2 type) - ;; return point where it was and fix indentation - (forward-line) - (indent-for-tab-command) - (if (> point-line (- (line-number-at-pos) 2)) - (forward-line (+ (- point-line (line-number-at-pos)) 1)) - (forward-line (- point-line (line-number-at-pos)))) - (move-to-column point-column)) - ;; move point back if needed - (backward-char (nth 3 type)))) - (when (not matched) - (user-error "Unknown file type")))) - -(defun web-mode-reload () - "Reload web-mode." - (interactive) - (web-mode-with-silent-modifications - (put-text-property (point-min) (point-max) 'invisible nil) - (remove-overlays) - (setq font-lock-unfontify-region-function 'font-lock-default-unfontify-region) - (load "web-mode.el") - (setq web-mode-change-beg nil - web-mode-change-end nil) - (web-mode) - )) - -(defun web-mode-trace (msg) - (let (sub) - (when (null web-mode-time) (setq web-mode-time (current-time))) - (setq sub (time-subtract (current-time) web-mode-time)) - (when nil - (save-excursion - (let ((n 0)) - (goto-char (point-min)) - (while (web-mode-tag-next) - (setq n (1+ n)) - ) - (message "%S tags found" n) - ))) - (message "%18s: time elapsed = %Ss %9Sµs" msg (nth 1 sub) (nth 2 sub)) - )) - -(defun web-mode-reveal () - "Display text properties at point." - (interactive) - (let (symbols out) - (setq out (format - "[point=%S engine=%S minor=%S content-type=%S language-at-pos=%S]\n" - (point) - web-mode-engine - web-mode-minor-engine - web-mode-content-type - (web-mode-language-at-pos (point)))) - (setq symbols (append web-mode-scan-properties '(font-lock-face face))) - (dolist (symbol symbols) - (when symbol - (setq out (concat out (format "%s(%S) " (symbol-name symbol) (get-text-property (point) symbol))))) - ) - (message "%s\n" out) - ;;(message "syntax-class=%S" (syntax-class (syntax-after (point)))) - (message nil))) - -(defun web-mode-debug () - "Display informations useful for debugging." - (interactive) - (let ((modes nil) - (customs '(web-mode-enable-current-column-highlight web-mode-enable-current-element-highlight indent-tabs-mode)) - (ignore '(abbrev-mode auto-composition-mode auto-compression-mode auto-encryption-mode auto-insert-mode blink-cursor-mode column-number-mode delete-selection-mode display-time-mode electric-indent-mode file-name-shadow-mode font-lock-mode global-font-lock-mode global-hl-line-mode line-number-mode menu-bar-mode mouse-wheel-mode recentf-mode show-point-mode tool-bar-mode tooltip-mode transient-mark-mode))) - (message "\n") - (message "--- WEB-MODE DEBUG BEG ---") - (message "versions: emacs(%S.%S) web-mode(%S)" - emacs-major-version emacs-minor-version web-mode-version) - (message "vars: engine(%S) minor(%S) content-type(%S) file(%S)" - web-mode-engine - web-mode-minor-engine - web-mode-content-type - (or (buffer-file-name) (buffer-name))) - (message "system: window(%S) config(%S)" window-system system-configuration) - (message "colors: fg(%S) bg(%S) " - (cdr (assoc 'foreground-color default-frame-alist)) - (cdr (assoc 'background-color default-frame-alist))) - (mapc (lambda (mode) - (condition-case nil - (if (and (symbolp mode) (symbol-value mode) (not (member mode ignore))) - (add-to-list 'modes mode)) - (error nil)) - ) ;lambda - minor-mode-list) - (message "minor modes: %S" modes) - (message "vars:") - (dolist (custom customs) - (message (format "%s=%S " (symbol-name custom) (symbol-value custom)))) - (message "--- WEB-MODE DEBUG END ---") - (switch-to-buffer "*Messages*") - (goto-char (point-max)) - (recenter) - )) - -(provide 'web-mode) - -;;; web-mode.el ends here - -;; Local Variables: -;; coding: utf-8 -;; indent-tabs-mode: nil -;; End: diff --git a/elpa/web-mode-20200612.1038/web-mode.elc b/elpa/web-mode-20200612.1038/web-mode.elc deleted file mode 100644 index e32e49b..0000000 Binary files a/elpa/web-mode-20200612.1038/web-mode.elc and /dev/null differ diff --git a/elpa/web-mode-readme.txt b/elpa/web-mode-readme.txt deleted file mode 100644 index d9c6290..0000000 --- a/elpa/web-mode-readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -============================================================================== -WEB-MODE is sponsored by ** Kernix ** Best Digital Factory & Data Lab (Paris) -============================================================================== diff --git a/init.el b/init.el index 22bf3fa..0c02bd3 100644 --- a/init.el +++ b/init.el @@ -51,7 +51,7 @@ '(magit-diff-use-overlays nil) '(package-selected-packages (quote - (spacemacs-theme flycheck ac-emmet web-mode ac-html markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f evil dash-functional))) + (multi-web-mode spacemacs-theme flycheck ac-emmet markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f evil dash-functional))) '(pdf-view-midnight-colors (quote ("#b2b2b2" . "#292b2e"))) '(pos-tip-background-color "#FFFACE") '(pos-tip-foreground-color "#272822") @@ -137,19 +137,19 @@ (global-set-key (kbd "C-S-d") 'mc/mark-all-like-this) ;Seleccionar todos como el actual (global-set-key (kbd "C-S-") 'mc/add-cursor-on-click) ;Añadir cursor con clics (Shift+CTRL+Clic) -(require 'web-mode) -(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) -(setq web-mode-css-indent-offset 2 - web-mode-code-indent-offset 2 - web-mode-sql-indent-offset 2 - web-mode-script-padding 2 - web-mode-markup-indent-offset 2) +; Cambiar de modos en un archivo que tiene php, html, css y js a la vez. +(require 'multi-web-mode) +(setq mweb-default-major-mode 'html-mode) +(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>") + (js-mode "") + (css-mode ""))) +(setq mweb-filename-extensions '("php" "htm" "html")) +(multi-web-global-mode 1) + +;Habilitar siempre auto-complete-mode en html-mode +(add-hook 'html-mode-hook #'(lambda() + (auto-complete-mode) + )) (powerline-default-theme); Habilitar powerline (esa línea bonita de abajo del editor) @@ -159,4 +159,3 @@ (setq c-basic-offset 2) ; Cambio los tabs por 2 espacios (PSR recomienda 4, pero editores como atom y VScode al momento de que configuro esto usan 2 y prefiero mantener esa compatibilidad entre editores) ; (web-mode) ;Pongo PHP siempre en webmode en caso de tener php-mode )) -
Newlines in title should be taken into account,like this example.