summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Simeonov2016-06-16 09:07:53 +0200
committerSimeon Simeonov2016-06-16 09:07:53 +0200
commit991f8ff925f51fd5598db72885f8cca1a1a79bed (patch)
treef55c97c928d5e7f408ee459f713b2c57af34afdd
parent29f6287f356ef9fc016e2f26861ff9a14443f3ea (diff)
Upgrade all modes, include snippets/html-mode, snippets/nxml-mode and snippets/prog-mode
-rw-r--r--.emacs.d/lisp/php-mode.el5
-rw-r--r--.emacs.d/lisp/yaml-mode.el1
-rw-r--r--.emacs.d/lisp/yasnippet.el290
-rw-r--r--.emacs.d/snippets/html-mode/.yas-parents1
-rw-r--r--.emacs.d/snippets/html-mode/dd5
-rw-r--r--.emacs.d/snippets/html-mode/dl7
-rw-r--r--.emacs.d/snippets/html-mode/doctype4
-rw-r--r--.emacs.d/snippets/html-mode/doctype.html54
-rw-r--r--.emacs.d/snippets/html-mode/doctype.xhtml14
-rw-r--r--.emacs.d/snippets/html-mode/doctype.xhtml1_14
-rw-r--r--.emacs.d/snippets/html-mode/doctype.xhtml1_strict4
-rw-r--r--.emacs.d/snippets/html-mode/doctype.xhtml1_transitional4
-rw-r--r--.emacs.d/snippets/html-mode/dt5
-rw-r--r--.emacs.d/snippets/html-mode/form6
-rw-r--r--.emacs.d/snippets/html-mode/html6
-rw-r--r--.emacs.d/snippets/html-mode/html.xmlns6
-rw-r--r--.emacs.d/snippets/html-mode/link.import4
-rw-r--r--.emacs.d/snippets/html-mode/link.stylesheet4
-rw-r--r--.emacs.d/snippets/html-mode/link.stylesheet-ie6
-rw-r--r--.emacs.d/snippets/html-mode/mailto4
-rw-r--r--.emacs.d/snippets/html-mode/meta5
-rw-r--r--.emacs.d/snippets/html-mode/meta.http-equiv5
-rw-r--r--.emacs.d/snippets/html-mode/script.javascript6
-rw-r--r--.emacs.d/snippets/html-mode/script.javascript-src4
-rw-r--r--.emacs.d/snippets/html-mode/textarea4
-rw-r--r--.emacs.d/snippets/html-mode/th5
-rw-r--r--.emacs.d/snippets/nxml-mode/body6
-rw-r--r--.emacs.d/snippets/nxml-mode/br4
-rw-r--r--.emacs.d/snippets/nxml-mode/doctype5
-rw-r--r--.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict5
-rw-r--r--.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional5
-rw-r--r--.emacs.d/snippets/nxml-mode/form6
-rw-r--r--.emacs.d/snippets/nxml-mode/href5
-rw-r--r--.emacs.d/snippets/nxml-mode/html6
-rw-r--r--.emacs.d/snippets/nxml-mode/img4
-rw-r--r--.emacs.d/snippets/nxml-mode/input4
-rw-r--r--.emacs.d/snippets/nxml-mode/link4
-rw-r--r--.emacs.d/snippets/nxml-mode/meta5
-rw-r--r--.emacs.d/snippets/nxml-mode/name4
-rw-r--r--.emacs.d/snippets/nxml-mode/quote6
-rw-r--r--.emacs.d/snippets/nxml-mode/style6
-rw-r--r--.emacs.d/snippets/nxml-mode/tag5
-rw-r--r--.emacs.d/snippets/prog-mode/.yas-setup.el2
-rw-r--r--.emacs.d/snippets/prog-mode/fixme6
-rw-r--r--.emacs.d/snippets/prog-mode/todo5
-rw-r--r--.emacs.d/snippets/prog-mode/xxx5
-rw-r--r--.emacs.d/snippets/python-mode/.yas-setup.el6
47 files changed, 379 insertions, 128 deletions
diff --git a/.emacs.d/lisp/php-mode.el b/.emacs.d/lisp/php-mode.el
index a7c1985..9aae782 100644
--- a/.emacs.d/lisp/php-mode.el
+++ b/.emacs.d/lisp/php-mode.el
@@ -1061,7 +1061,8 @@ PHP heredoc."
1061 php-beginning-of-defun-regexp) 1061 php-beginning-of-defun-regexp)
1062 1062
1063 (when (>= emacs-major-version 25) 1063 (when (>= emacs-major-version 25)
1064 (php-syntax-propertize-function (point-min) (point-max)))) 1064 (with-silent-modifications
1065 (php-syntax-propertize-function (point-min) (point-max)))))
1065 1066
1066 1067
1067;; Define function name completion function 1068;; Define function name completion function
@@ -1328,7 +1329,7 @@ a completion list."
1328 ("->\\(\\sw+\\)\\s-*(" 1 'default) 1329 ("->\\(\\sw+\\)\\s-*(" 1 'default)
1329 1330
1330 ;; Highlight special variables 1331 ;; Highlight special variables
1331 ("\\$\\(this\\|that\\)" 1 font-lock-constant-face) 1332 ("\\$\\(this\\|that\\)\\_>" 1 font-lock-constant-face)
1332 ("\\(\\$\\|->\\)\\([a-zA-Z0-9_]+\\)" 2 font-lock-variable-name-face) 1333 ("\\(\\$\\|->\\)\\([a-zA-Z0-9_]+\\)" 2 font-lock-variable-name-face)
1333 1334
1334 ;; Highlight function/method names 1335 ;; Highlight function/method names
diff --git a/.emacs.d/lisp/yaml-mode.el b/.emacs.d/lisp/yaml-mode.el
index b8c1ddb..9274a5b 100644
--- a/.emacs.d/lisp/yaml-mode.el
+++ b/.emacs.d/lisp/yaml-mode.el
@@ -78,6 +78,7 @@
78(defcustom yaml-indent-offset 2 78(defcustom yaml-indent-offset 2
79 "*Amount of offset per level of indentation." 79 "*Amount of offset per level of indentation."
80 :type 'integer 80 :type 'integer
81 :safe 'natnump
81 :group 'yaml) 82 :group 'yaml)
82 83
83(defcustom yaml-backspace-function 'backward-delete-char-untabify 84(defcustom yaml-backspace-function 'backward-delete-char-untabify
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index 3446060..5164754 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -5,7 +5,7 @@
5;; João Távora <joaotavora@gmail.com>, 5;; João Távora <joaotavora@gmail.com>,
6;; Noam Postavsky <npostavs@gmail.com> 6;; Noam Postavsky <npostavs@gmail.com>
7;; Maintainer: Noam Postavsky <npostavs@gmail.com> 7;; Maintainer: Noam Postavsky <npostavs@gmail.com>
8;; Version: 0.9.1 8;; Version: 0.10.0
9;; X-URL: http://github.com/capitaomorte/yasnippet 9;; X-URL: http://github.com/capitaomorte/yasnippet
10;; Keywords: convenience, emulation 10;; Keywords: convenience, emulation
11;; URL: http://github.com/capitaomorte/yasnippet 11;; URL: http://github.com/capitaomorte/yasnippet
@@ -202,14 +202,12 @@ created with `yas-new-snippet'. "
202 (t 202 (t
203 (error "[yas] invalid element %s in `yas-snippet-dirs'" e))))) 203 (error "[yas] invalid element %s in `yas-snippet-dirs'" e)))))
204 204
205(defvaralias 'yas/root-directory 'yas-snippet-dirs)
206
207(defcustom yas-new-snippet-default "\ 205(defcustom yas-new-snippet-default "\
208# -*- mode: snippet -*- 206# -*- mode: snippet -*-
209# name: $1 207# name: $1
210# key: ${2:${1:$(yas--key-from-desc yas-text)}} 208# key: ${2:${1:$(yas--key-from-desc yas-text)}}
211# -- 209# --
212$0" 210$0`yas-selected-text`"
213 "Default snippet to use when creating a new snippet. 211 "Default snippet to use when creating a new snippet.
214If nil, don't use any snippet." 212If nil, don't use any snippet."
215 :type 'string 213 :type 'string
@@ -386,6 +384,12 @@ the trigger key itself."
386 :type '(repeat function) 384 :type '(repeat function)
387 :group 'yasnippet) 385 :group 'yasnippet)
388 386
387(defcustom yas-alias-to-yas/prefix-p t
388 "If non-nil make aliases for the old style yas/ prefixed symbols.
389It must be set to nil before loading yasnippet to take effect."
390 :type 'boolean
391 :group 'yasnippet)
392
389;; Only two faces, and one of them shouldn't even be used... 393;; Only two faces, and one of them shouldn't even be used...
390;; 394;;
391(defface yas-field-highlight-face 395(defface yas-field-highlight-face
@@ -530,7 +534,7 @@ snippet itself contains a condition that returns the symbol
530 534
531;;; Internal variables 535;;; Internal variables
532 536
533(defvar yas--version "0.9.1") 537(defconst yas--version "0.10.0")
534 538
535(defvar yas--menu-table (make-hash-table) 539(defvar yas--menu-table (make-hash-table)
536 "A hash table of MAJOR-MODE symbols to menu keymaps.") 540 "A hash table of MAJOR-MODE symbols to menu keymaps.")
@@ -776,7 +780,7 @@ Key bindings:
776 ;; The indicator for the mode line. 780 ;; The indicator for the mode line.
777 " yas" 781 " yas"
778 :group 'yasnippet 782 :group 'yasnippet
779 (cond (yas-minor-mode 783 (cond ((and yas-minor-mode (featurep 'yasnippet))
780 ;; Install the direct keymaps in `emulation-mode-map-alists' 784 ;; Install the direct keymaps in `emulation-mode-map-alists'
781 ;; (we use `add-hook' even though it's not technically a hook, 785 ;; (we use `add-hook' even though it's not technically a hook,
782 ;; but it works). Then define variables named after modes to 786 ;; but it works). Then define variables named after modes to
@@ -884,7 +888,9 @@ Honour `yas-dont-activate-functions', which see."
884(defvar yas--font-lock-keywords 888(defvar yas--font-lock-keywords
885 (append '(("^#.*$" . font-lock-comment-face)) 889 (append '(("^#.*$" . font-lock-comment-face))
886 (with-temp-buffer 890 (with-temp-buffer
887 (ignore-errors (emacs-lisp-mode)) 891 (let ((prog-mode-hook nil)
892 (emacs-lisp-mode-hook nil))
893 (ignore-errors (emacs-lisp-mode)))
888 (font-lock-set-defaults) 894 (font-lock-set-defaults)
889 (if (eq t (car-safe font-lock-keywords)) 895 (if (eq t (car-safe font-lock-keywords))
890 ;; They're "compiled", so extract the source. 896 ;; They're "compiled", so extract the source.
@@ -1362,7 +1368,7 @@ return an expression that when evaluated will issue an error."
1362 (read-kbd-macro keybinding 'need-vector)))) 1368 (read-kbd-macro keybinding 'need-vector))))
1363 res) 1369 res)
1364 (error 1370 (error
1365 (yas--message 3 "warning: keybinding \"%s\" invalid since %s." 1371 (yas--message 2 "warning: keybinding \"%s\" invalid since %s."
1366 keybinding (error-message-string err)) 1372 keybinding (error-message-string err))
1367 nil)))) 1373 nil))))
1368 1374
@@ -1697,14 +1703,14 @@ the current buffers contents."
1697 (or (yas--template-load-file template) 1703 (or (yas--template-load-file template)
1698 (let ((file (yas--template-save-file template))) 1704 (let ((file (yas--template-save-file template)))
1699 (when file 1705 (when file
1700 (yas--message 2 "%s has no load file, use save file, %s, instead." 1706 (yas--message 3 "%s has no load file, using save file, %s, instead."
1701 (yas--template-name template) file)) 1707 (yas--template-name template) file))
1702 file))) 1708 file)))
1703 1709
1704(defun yas--load-yas-setup-file (file) 1710(defun yas--load-yas-setup-file (file)
1705 (if (not yas--creating-compiled-snippets) 1711 (if (not yas--creating-compiled-snippets)
1706 ;; Normal case. 1712 ;; Normal case.
1707 (load file 'noerror (<= yas-verbosity 2)) 1713 (load file 'noerror (<= yas-verbosity 4))
1708 (let ((elfile (concat file ".el"))) 1714 (let ((elfile (concat file ".el")))
1709 (when (file-exists-p elfile) 1715 (when (file-exists-p elfile)
1710 (insert ";;; contents of the .yas-setup.el support file:\n;;;\n") 1716 (insert ";;; contents of the .yas-setup.el support file:\n;;;\n")
@@ -1760,7 +1766,7 @@ With prefix argument USE-JIT do jit-loading of snippets."
1760 (cl-loop for buffer in (buffer-list) 1766 (cl-loop for buffer in (buffer-list)
1761 do (with-current-buffer buffer 1767 do (with-current-buffer buffer
1762 (when (eq major-mode mode-sym) 1768 (when (eq major-mode mode-sym)
1763 (yas--message 3 "Discovered there was already %s in %s" buffer mode-sym) 1769 (yas--message 4 "Discovered there was already %s in %s" buffer mode-sym)
1764 (push buffer impatient-buffers))))))) 1770 (push buffer impatient-buffers)))))))
1765 ;; ...after TOP-LEVEL-DIR has been completely loaded, call 1771 ;; ...after TOP-LEVEL-DIR has been completely loaded, call
1766 ;; `yas--load-pending-jits' in these impatient buffers. 1772 ;; `yas--load-pending-jits' in these impatient buffers.
@@ -1784,8 +1790,8 @@ With prefix argument USE-JIT do jit-loading of snippets."
1784 ;; Normal case. 1790 ;; Normal case.
1785 (unless (file-exists-p (expand-file-name ".yas-skip" directory)) 1791 (unless (file-exists-p (expand-file-name ".yas-skip" directory))
1786 (unless (and (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3)) 1792 (unless (and (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3))
1787 (progn (yas--message 2 "Loaded compiled snippets from %s" directory) t)) 1793 (progn (yas--message 4 "Loaded compiled snippets from %s" directory) t))
1788 (yas--message 2 "Loading snippet files from %s" directory) 1794 (yas--message 4 "Loading snippet files from %s" directory)
1789 (yas--load-directory-2 directory mode-sym))))) 1795 (yas--load-directory-2 directory mode-sym)))))
1790 1796
1791(defun yas--load-directory-2 (directory mode-sym) 1797(defun yas--load-directory-2 (directory mode-sym)
@@ -1799,7 +1805,10 @@ With prefix argument USE-JIT do jit-loading of snippets."
1799 (with-temp-buffer 1805 (with-temp-buffer
1800 (dolist (file (yas--subdirs directory 'no-subdirs-just-files)) 1806 (dolist (file (yas--subdirs directory 'no-subdirs-just-files))
1801 (when (file-readable-p file) 1807 (when (file-readable-p file)
1802 (insert-file-contents file nil nil nil t) 1808 ;; Erase the buffer instead of passing non-nil REPLACE to
1809 ;; `insert-file-contents' (avoids Emacs bug #23659).
1810 (erase-buffer)
1811 (insert-file-contents file)
1803 (push (yas--parse-template file) 1812 (push (yas--parse-template file)
1804 snippet-defs)))) 1813 snippet-defs))))
1805 (when snippet-defs 1814 (when snippet-defs
@@ -1823,8 +1832,8 @@ prompt the user to select one."
1823 (cond ((file-directory-p directory) 1832 (cond ((file-directory-p directory)
1824 (yas-load-directory directory (not nojit)) 1833 (yas-load-directory directory (not nojit))
1825 (if nojit 1834 (if nojit
1826 (yas--message 3 "Loaded %s" directory) 1835 (yas--message 4 "Loaded %s" directory)
1827 (yas--message 3 "Prepared just-in-time loading for %s" directory))) 1836 (yas--message 4 "Prepared just-in-time loading for %s" directory)))
1828 (t 1837 (t
1829 (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors))))) 1838 (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors)))))
1830 errors)) 1839 errors))
@@ -1889,9 +1898,9 @@ prefix argument."
1889 (yas-direct-keymaps-reload) 1898 (yas-direct-keymaps-reload)
1890 1899
1891 (run-hooks 'yas-after-reload-hook) 1900 (run-hooks 'yas-after-reload-hook)
1892 (yas--message 3 "Reloaded everything%s...%s." 1901 (yas--message (if errors 2 3) "Reloaded everything%s...%s."
1893 (if no-jit "" " (snippets will load just-in-time)") 1902 (if no-jit "" " (snippets will load just-in-time)")
1894 (if errors " (some errors, check *Messages*)" ""))))) 1903 (if errors " (some errors, check *Messages*)" "")))))
1895 1904
1896(defvar yas-after-reload-hook nil 1905(defvar yas-after-reload-hook nil
1897 "Hooks run after `yas-reload-all'.") 1906 "Hooks run after `yas-reload-all'.")
@@ -1901,7 +1910,7 @@ prefix argument."
1901 (let ((funs (reverse (gethash mode yas--scheduled-jit-loads)))) 1910 (let ((funs (reverse (gethash mode yas--scheduled-jit-loads))))
1902 ;; must reverse to maintain coherence with `yas-snippet-dirs' 1911 ;; must reverse to maintain coherence with `yas-snippet-dirs'
1903 (dolist (fun funs) 1912 (dolist (fun funs)
1904 (yas--message 3 "Loading for `%s', just-in-time: %s!" mode fun) 1913 (yas--message 4 "Loading for `%s', just-in-time: %s!" mode fun)
1905 (funcall fun)) 1914 (funcall fun))
1906 (remhash mode yas--scheduled-jit-loads)))) 1915 (remhash mode yas--scheduled-jit-loads))))
1907 1916
@@ -2096,7 +2105,7 @@ omitted from MODE's menu, even if they're manually loaded."
2096 (define-key menu-keymap (vector (gensym)) 2105 (define-key menu-keymap (vector (gensym))
2097 '(menu-item "----"))) 2106 '(menu-item "----")))
2098 (t 2107 (t
2099 (yas--message 3 "Don't know anything about menu entry %s" (first e)))))) 2108 (yas--message 1 "Don't know anything about menu entry %s" (first e))))))
2100 2109
2101(defun yas--define (mode key template &optional name condition group) 2110(defun yas--define (mode key template &optional name condition group)
2102 "Define a snippet. Expanding KEY into TEMPLATE. 2111 "Define a snippet. Expanding KEY into TEMPLATE.
@@ -2359,7 +2368,7 @@ by condition."
2359 (car where) 2368 (car where)
2360 (cdr where) 2369 (cdr where)
2361 (yas--template-expand-env yas--current-template)) 2370 (yas--template-expand-env yas--current-template))
2362 (yas--message 3 "No snippets can be inserted here!")))) 2371 (yas--message 1 "No snippets can be inserted here!"))))
2363 2372
2364(defun yas-visit-snippet-file () 2373(defun yas-visit-snippet-file ()
2365 "Choose a snippet to edit, selection like `yas-insert-snippet'. 2374 "Choose a snippet to edit, selection like `yas-insert-snippet'.
@@ -2467,7 +2476,11 @@ where snippets of table might exist."
2467Expands a snippet-writing snippet, unless the optional prefix arg 2476Expands a snippet-writing snippet, unless the optional prefix arg
2468NO-TEMPLATE is non-nil." 2477NO-TEMPLATE is non-nil."
2469 (interactive "P") 2478 (interactive "P")
2470 (let ((guessed-directories (yas--guess-snippet-directories))) 2479 (let ((guessed-directories (yas--guess-snippet-directories))
2480 (yas-selected-text (or yas-selected-text
2481 (and (region-active-p)
2482 (buffer-substring-no-properties
2483 (region-beginning) (region-end))))))
2471 2484
2472 (switch-to-buffer "*new snippet*") 2485 (switch-to-buffer "*new snippet*")
2473 (erase-buffer) 2486 (erase-buffer)
@@ -2542,10 +2555,8 @@ neither do the elements of PARENTS."
2542 2555
2543(defun yas-load-snippet-buffer (table &optional interactive) 2556(defun yas-load-snippet-buffer (table &optional interactive)
2544 "Parse and load current buffer's snippet definition into TABLE. 2557 "Parse and load current buffer's snippet definition into TABLE.
2545 2558TABLE is a symbol name passed to `yas--table-get-create'. When
2546TABLE is a symbol naming a passed to `yas--table-get-create'. 2559called interactively, prompt for the table name."
2547
2548When called interactively, prompt for the table name."
2549 (interactive (list (yas--read-table) t)) 2560 (interactive (list (yas--read-table) t))
2550 (cond 2561 (cond
2551 ;; We have `yas--editing-template', this buffer's content comes from a 2562 ;; We have `yas--editing-template', this buffer's content comes from a
@@ -2570,11 +2581,10 @@ When called interactively, prompt for the table name."
2570 (yas--table-name (yas--template-table yas--editing-template))))) 2581 (yas--table-name (yas--template-table yas--editing-template)))))
2571 2582
2572(defun yas-load-snippet-buffer-and-close (table &optional kill) 2583(defun yas-load-snippet-buffer-and-close (table &optional kill)
2573 "Load the snippet with `yas-load-snippet-buffer', possibly 2584 "Load and save the snippet, then `quit-window' if saved.
2574 save, then `quit-window' if saved. 2585Loading is performed by `yas-load-snippet-buffer'. If the
2575 2586snippet is new, ask the user whether (and where) to save it. If
2576If the snippet is new, ask the user whether (and where) to save 2587the snippet already has a file, just save it.
2577it. If the snippet already has a file, just save it.
2578 2588
2579The prefix argument KILL is passed to `quit-window'. 2589The prefix argument KILL is passed to `quit-window'.
2580 2590
@@ -2642,7 +2652,7 @@ and `kill-buffer' instead."
2642 (require 'yasnippet-debug nil t)) 2652 (require 'yasnippet-debug nil t))
2643 (add-hook 'post-command-hook 'yas-debug-snippet-vars nil t)))) 2653 (add-hook 'post-command-hook 'yas-debug-snippet-vars nil t))))
2644 (t 2654 (t
2645 (yas--message 3 "Cannot test snippet for unknown major mode"))))) 2655 (yas--message 1 "Cannot test snippet for unknown major mode")))))
2646 2656
2647(defun yas-active-keys () 2657(defun yas-active-keys ()
2648 "Return all active trigger keys for current buffer and point." 2658 "Return all active trigger keys for current buffer and point."
@@ -2654,58 +2664,49 @@ and `kill-buffer' instead."
2654 (car (last (or (yas--template-group template) 2664 (car (last (or (yas--template-group template)
2655 (yas--template-perm-group template))))) 2665 (yas--template-perm-group template)))))
2656 2666
2657(defun yas-describe-tables (&optional choose) 2667(defun yas-describe-table-by-namehash ()
2668 "Display snippet tables by NAMEHASH."
2669 (interactive)
2670 (with-current-buffer (get-buffer-create "*YASnippet Tables by NAMEHASH*")
2671 (let ((inhibit-read-only t))
2672 (erase-buffer)
2673 (insert "YASnippet tables by NAMEHASH: \n")
2674 (maphash
2675 (lambda (_mode table)
2676 (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table)))
2677 (maphash
2678 (lambda (key _v)
2679 (insert (format " key %s maps snippets: %s\n" key
2680 (let ((names))
2681 (maphash #'(lambda (k _v)
2682 (push k names))
2683 (gethash key (yas--table-hash table)))
2684 names))))
2685 (yas--table-hash table)))
2686 yas--tables))
2687 (view-mode +1)
2688 (goto-char 1)
2689 (display-buffer (current-buffer))))
2690
2691(defun yas-describe-tables (&optional with-nonactive)
2658 "Display snippets for each table." 2692 "Display snippets for each table."
2659 (interactive "P") 2693 (interactive "P")
2660 (let* ((by-name-hash (and choose 2694 (let ((original-buffer (current-buffer))
2661 (y-or-n-p "Show by namehash? "))) 2695 (tables (yas--get-snippet-tables)))
2662 (buffer (get-buffer-create "*YASnippet tables*")) 2696 (with-current-buffer (get-buffer-create "*YASnippet Tables*")
2663 (active-tables (yas--get-snippet-tables)) 2697 (let ((inhibit-read-only t))
2664 (remain-tables (let ((all)) 2698 (when with-nonactive
2665 (maphash #'(lambda (_k v) 2699 (maphash #'(lambda (_k v)
2666 (unless (find v active-tables) 2700 (cl-pushnew v tables))
2667 (push v all))) 2701 yas--tables))
2668 yas--tables) 2702 (erase-buffer)
2669 all)) 2703 (insert "YASnippet tables:\n")
2670 (table-lists (list active-tables remain-tables)) 2704 (dolist (table tables)
2671 (original-buffer (current-buffer)) 2705 (yas--describe-pretty-table table original-buffer))
2672 (continue t) 2706 (yas--create-snippet-xrefs))
2673 (yas--condition-cache-timestamp (current-time))) 2707 (help-mode)
2674 (with-current-buffer buffer 2708 (goto-char 1)
2675 (setq buffer-read-only nil) 2709 (display-buffer (current-buffer)))))
2676 (erase-buffer)
2677 (cond ((not by-name-hash)
2678 (insert "YASnippet tables:\n")
2679 (while (and table-lists
2680 continue)
2681 (dolist (table (car table-lists))
2682 (yas--describe-pretty-table table original-buffer))
2683 (setq table-lists (cdr table-lists))
2684 (when table-lists
2685 (yas--create-snippet-xrefs)
2686 (display-buffer buffer)
2687 (setq continue (and choose (y-or-n-p "Show also non-active tables? ")))))
2688 (yas--create-snippet-xrefs)
2689 (help-mode)
2690 (goto-char 1))
2691 (t
2692 (insert "\n\nYASnippet tables by NAMEHASH: \n")
2693 (dolist (table (append active-tables remain-tables))
2694 (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table)))
2695 (let ((keys))
2696 (maphash #'(lambda (k _v)
2697 (push k keys))
2698 (yas--table-hash table))
2699 (dolist (key keys)
2700 (insert (format " key %s maps snippets: %s\n" key
2701 (let ((names))
2702 (maphash #'(lambda (k _v)
2703 (push k names))
2704 (gethash key (yas--table-hash table)))
2705 names))))))))
2706 (goto-char 1)
2707 (setq buffer-read-only t))
2708 (display-buffer buffer)))
2709 2710
2710(defun yas--describe-pretty-table (table &optional original-buffer) 2711(defun yas--describe-pretty-table (table &optional original-buffer)
2711 (insert (format "\nSnippet table `%s'" 2712 (insert (format "\nSnippet table `%s'"
@@ -2969,7 +2970,6 @@ If there is a transform but it returns nil, return the empty
2969string iff EMPTY-ON-NIL-P is true." 2970string iff EMPTY-ON-NIL-P is true."
2970 (let* ((yas-text (yas--field-text-for-display field)) 2971 (let* ((yas-text (yas--field-text-for-display field))
2971 (yas-modified-p (yas--field-modified-p field)) 2972 (yas-modified-p (yas--field-modified-p field))
2972 (yas-moving-away-p nil)
2973 (transform (if (yas--mirror-p field-or-mirror) 2973 (transform (if (yas--mirror-p field-or-mirror)
2974 (yas--mirror-transform field-or-mirror) 2974 (yas--mirror-transform field-or-mirror)
2975 (yas--field-transform field-or-mirror))) 2975 (yas--field-transform field-or-mirror)))
@@ -3098,13 +3098,11 @@ If there's none, exit the snippet."
3098 (let* ((snippet (car (yas--snippets-at-point))) 3098 (let* ((snippet (car (yas--snippets-at-point)))
3099 (active-field (overlay-get yas--active-field-overlay 'yas--field)) 3099 (active-field (overlay-get yas--active-field-overlay 'yas--field))
3100 (target-field (yas--find-next-field arg snippet active-field))) 3100 (target-field (yas--find-next-field arg snippet active-field)))
3101 ;; First check if we're moving out of a field with a transform. 3101 ;; Apply transform to active field.
3102 (when (and active-field (yas--field-transform active-field)) 3102 (when active-field
3103 (let* ((yas-moving-away-p t) 3103 (let ((yas-moving-away-p t))
3104 (yas-text (yas--field-text-for-display active-field)) 3104 (when (yas--field-update-display active-field)
3105 (yas-modified-p (yas--field-modified-p active-field))) 3105 (yas--update-mirrors snippet))))
3106 ;; primary field transform: exit call to field-transform
3107 (yas--eval-lisp (yas--field-transform active-field))))
3108 ;; Now actually move... 3106 ;; Now actually move...
3109 (if target-field 3107 (if target-field
3110 (yas--move-to-field snippet target-field) 3108 (yas--move-to-field snippet target-field)
@@ -3225,7 +3223,7 @@ This renders the snippet as ordinary text."
3225 (condition-case error 3223 (condition-case error
3226 (run-hooks hook-var) 3224 (run-hooks hook-var)
3227 (error 3225 (error
3228 (yas--message 3 "%s error: %s" hook-var (error-message-string error))))) 3226 (yas--message 2 "%s error: %s" hook-var (error-message-string error)))))
3229 3227
3230 3228
3231(defun yas--check-commit-snippet () 3229(defun yas--check-commit-snippet ()
@@ -3483,7 +3481,7 @@ Move the overlays, or create them if they do not exit."
3483 (= length (- end beg)) ; deletion or insertion 3481 (= length (- end beg)) ; deletion or insertion
3484 (yas--undo-in-progress)) 3482 (yas--undo-in-progress))
3485 (let ((snippets (yas--snippets-at-point))) 3483 (let ((snippets (yas--snippets-at-point)))
3486 (yas--message 3 "Comitting snippets. Action would destroy a protection overlay.") 3484 (yas--message 2 "Committing snippets. Action would destroy a protection overlay.")
3487 (cl-loop for snippet in snippets 3485 (cl-loop for snippet in snippets
3488 do (yas--commit-snippet snippet))))) 3486 do (yas--commit-snippet snippet)))))
3489 3487
@@ -3572,14 +3570,21 @@ considered when expanding the snippet."
3572 ;; them mostly to make the undo information 3570 ;; them mostly to make the undo information
3573 ;; 3571 ;;
3574 (setq yas--start-column (current-column)) 3572 (setq yas--start-column (current-column))
3575 (let ((yas--inhibit-overlay-hooks t)) 3573 (let ((yas--inhibit-overlay-hooks t)
3574 ;; Avoid major-mode's syntax propertizing function,
3575 ;; since we mess with the syntax-table and also
3576 ;; insert things that are not valid in the
3577 ;; major-mode language syntax anyway.
3578 (syntax-propertize-function nil))
3576 (setq snippet 3579 (setq snippet
3577 (if expand-env 3580 (if expand-env
3578 (eval `(let* ,expand-env 3581 (eval `(let* ,expand-env
3579 (insert content) 3582 (insert content)
3580 (yas--snippet-create start (point)))) 3583 (yas--snippet-create start (point))))
3581 (insert content) 3584 (insert content)
3582 (yas--snippet-create start (point)))))) 3585 (yas--snippet-create start (point)))))
3586 ;; Invalidate any syntax-propertizing done while `syntax-propertize-function' was nil
3587 (syntax-ppss-flush-cache start))
3583 3588
3584 ;; stacked-expansion: This checks for stacked expansion, save the 3589 ;; stacked-expansion: This checks for stacked expansion, save the
3585 ;; `yas--previous-active-field' and advance its boundary. 3590 ;; `yas--previous-active-field' and advance its boundary.
@@ -3619,7 +3624,7 @@ considered when expanding the snippet."
3619 (when first-field 3624 (when first-field
3620 (sit-for 0) ;; fix issue 125 3625 (sit-for 0) ;; fix issue 125
3621 (yas--move-to-field snippet first-field))) 3626 (yas--move-to-field snippet first-field)))
3622 (yas--message 3 "snippet expanded.") 3627 (yas--message 4 "snippet expanded.")
3623 t)))) 3628 t))))
3624 3629
3625(defun yas--take-care-of-redo (_beg _end snippet) 3630(defun yas--take-care-of-redo (_beg _end snippet)
@@ -3826,6 +3831,9 @@ cons cells to this var.")
3826backquoted Lisp expressions should be inserted at the end of 3831backquoted Lisp expressions should be inserted at the end of
3827expansion.") 3832expansion.")
3828 3833
3834(defvar yas--indent-markers nil
3835 "List of markers for manual indentation.")
3836
3829(defun yas--snippet-parse-create (snippet) 3837(defun yas--snippet-parse-create (snippet)
3830 "Parse a recently inserted snippet template, creating all 3838 "Parse a recently inserted snippet template, creating all
3831necessary fields, mirrors and exit points. 3839necessary fields, mirrors and exit points.
@@ -3845,6 +3853,9 @@ Meant to be called in a narrowed buffer, does various passes"
3845 ;; protect escaped characters 3853 ;; protect escaped characters
3846 ;; 3854 ;;
3847 (yas--protect-escapes) 3855 (yas--protect-escapes)
3856 ;; Parse indent markers: `$>'.
3857 (goto-char parse-start)
3858 (yas--indent-parse-create snippet)
3848 ;; parse fields with {} 3859 ;; parse fields with {}
3849 ;; 3860 ;;
3850 (goto-char parse-start) 3861 (goto-char parse-start)
@@ -3918,7 +3929,8 @@ The SNIPPET's markers are preserved."
3918 (goto-char from) 3929 (goto-char from)
3919 (save-restriction 3930 (save-restriction
3920 (widen) 3931 (widen)
3921 (cl-loop do 3932 ;; Indent each non-empty line.
3933 (cl-loop if (/= (line-beginning-position) (line-end-position)) do
3922 (back-to-indentation) 3934 (back-to-indentation)
3923 (let ((trouble-markers ; The markers at (point). 3935 (let ((trouble-markers ; The markers at (point).
3924 (cl-remove (point) snippet-markers :test #'/=))) 3936 (cl-remove (point) snippet-markers :test #'/=)))
@@ -3931,14 +3943,17 @@ The SNIPPET's markers are preserved."
3931 3943
3932(defvar yas--indent-original-column nil) 3944(defvar yas--indent-original-column nil)
3933(defun yas--indent (snippet) 3945(defun yas--indent (snippet)
3934 ;; Look for those `$>'. 3946 ;; Indent lines that had indent markers (`$>') on them.
3935 (save-excursion 3947 (save-excursion
3936 (while (re-search-forward "$>" nil t) 3948 (dolist (marker yas--indent-markers)
3937 (delete-region (match-beginning 0) (match-end 0))
3938 (unless (eq yas-indent-line 'auto) 3949 (unless (eq yas-indent-line 'auto)
3950 (goto-char marker)
3939 (yas--indent-region (line-beginning-position) 3951 (yas--indent-region (line-beginning-position)
3940 (line-end-position) 3952 (line-end-position)
3941 snippet)))) 3953 snippet))
3954 ;; Finished with this marker.
3955 (set-marker marker nil))
3956 (setq yas--indent-markers nil))
3942 ;; Now do stuff for `fixed' and `auto'. 3957 ;; Now do stuff for `fixed' and `auto'.
3943 (save-excursion 3958 (save-excursion
3944 (cond ((eq yas-indent-line 'fixed) 3959 (cond ((eq yas-indent-line 'fixed)
@@ -4002,20 +4017,34 @@ With optional string TEXT do it in string instead of the buffer."
4002(defun yas--save-backquotes () 4017(defun yas--save-backquotes ()
4003 "Save all the \"`(lisp-expression)`\"-style expressions 4018 "Save all the \"`(lisp-expression)`\"-style expressions
4004with their evaluated value into `yas--backquote-markers-and-strings'." 4019with their evaluated value into `yas--backquote-markers-and-strings'."
4005 (while (re-search-forward yas--backquote-lisp-expression-regexp nil t) 4020 ;; Gather `(lisp-expression)`s.
4006 (let ((current-string (match-string-no-properties 1)) transformed) 4021 (let ((end (point-max)))
4007 (save-restriction (widen) 4022 (save-restriction
4008 (delete-region (match-beginning 0) (match-end 0))) 4023 (widen)
4009 (setq transformed (yas--eval-lisp (yas--read-lisp (yas--restore-escapes current-string '(?`))))) 4024 (while (re-search-forward yas--backquote-lisp-expression-regexp end t)
4010 (goto-char (match-beginning 0)) 4025 (let ((expr (yas--read-lisp (yas--restore-escapes
4011 (when transformed 4026 (match-string-no-properties 1))))
4012 (let ((marker (make-marker))) 4027 (marker (make-marker)))
4013 (save-restriction 4028 (delete-region (match-beginning 0) (match-end 0))
4014 (widen) 4029 (insert "Y") ;; quite horrendous, I love it :)
4015 (insert "Y") ;; quite horrendous, I love it :) 4030 (set-marker marker (point))
4016 (set-marker marker (point)) 4031 (insert "Y")
4017 (insert "Y")) 4032 (push (cons marker expr) yas--backquote-markers-and-strings)))))
4018 (push (cons marker transformed) yas--backquote-markers-and-strings)))))) 4033 ;; Evaluate them.
4034 (dolist (m-e yas--backquote-markers-and-strings)
4035 (let* ((marker (car m-e))
4036 (expr (cdr m-e))
4037 (result (save-excursion
4038 (goto-char marker)
4039 (yas--eval-lisp expr))))
4040 (setcdr m-e result)
4041 (unless result
4042 (save-restriction (widen)
4043 (delete-region (1- marker) (1+ marker)))
4044 (set-marker marker nil))))
4045 ;; Drop the nil results.
4046 (setq yas--backquote-markers-and-strings
4047 (cl-delete-if-not #'cdr yas--backquote-markers-and-strings)))
4019 4048
4020(defun yas--restore-backquotes () 4049(defun yas--restore-backquotes ()
4021 "Replace markers in `yas--backquote-markers-and-strings' with their values." 4050 "Replace markers in `yas--backquote-markers-and-strings' with their values."
@@ -4044,6 +4073,16 @@ with their evaluated value into `yas--backquote-markers-and-strings'."
4044 (set-marker-insertion-type marker nil) 4073 (set-marker-insertion-type marker nil)
4045 marker)) 4074 marker))
4046 4075
4076(defun yas--indent-parse-create (snippet)
4077 "Parse the \"$>\" indentation markers in SNIPPET."
4078 (setq yas--indent-markers ())
4079 (while (search-forward "$>" nil t)
4080 (delete-region (match-beginning 0) (match-end 0))
4081 ;; Mark the beginning of the line.
4082 (push (yas--make-marker (line-beginning-position))
4083 yas--indent-markers))
4084 (setq yas--indent-markers (nreverse yas--indent-markers)))
4085
4047(defun yas--field-parse-create (snippet &optional parent-field) 4086(defun yas--field-parse-create (snippet &optional parent-field)
4048 "Parse most field expressions in SNIPPET, except for the simple one \"$n\". 4087 "Parse most field expressions in SNIPPET, except for the simple one \"$n\".
4049 4088
@@ -4384,7 +4423,7 @@ object satisfying `yas--field-p' to restrict the expansion to.")))
4384 4423
4385;;; Utils 4424;;; Utils
4386 4425
4387(defvar yas-verbosity 4 4426(defvar yas-verbosity 3
4388 "Log level for `yas--message' 4 means trace most anything, 0 means nothing.") 4427 "Log level for `yas--message' 4 means trace most anything, 0 means nothing.")
4389 4428
4390(defun yas--message (level message &rest args) 4429(defun yas--message (level message &rest args)
@@ -4575,14 +4614,17 @@ and return the directory. Return nil if not found."
4575 4614
4576They are mapped to \"yas/*\" variants.") 4615They are mapped to \"yas/*\" variants.")
4577 4616
4578(dolist (sym yas--backported-syms) 4617(when yas-alias-to-yas/prefix-p
4579 (let ((backported (intern (replace-regexp-in-string "\\`yas-" "yas/" (symbol-name sym))))) 4618 (dolist (sym yas--backported-syms)
4580 (when (boundp sym) 4619 (let ((backported (intern (replace-regexp-in-string "\\`yas-" "yas/" (symbol-name sym)))))
4581 (make-obsolete-variable backported sym "yasnippet 0.8") 4620 (when (boundp sym)
4582 (defvaralias backported sym)) 4621 (make-obsolete-variable backported sym "yasnippet 0.8")
4583 (when (fboundp sym) 4622 (defvaralias backported sym))
4584 (make-obsolete backported sym "yasnippet 0.8") 4623 (when (fboundp sym)
4585 (defalias backported sym)))) 4624 (make-obsolete backported sym "yasnippet 0.8")
4625 (defalias backported sym))))
4626 (make-obsolete 'yas/root-directory 'yas-snippet-dirs "yasnippet 0.8")
4627 (defvaralias 'yas/root-directory 'yas-snippet-dirs))
4586 4628
4587(defvar yas--exported-syms 4629(defvar yas--exported-syms
4588 (let (exported) 4630 (let (exported)
diff --git a/.emacs.d/snippets/html-mode/.yas-parents b/.emacs.d/snippets/html-mode/.yas-parents
new file mode 100644
index 0000000..74c3dd5
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/.yas-parents
@@ -0,0 +1 @@
nxml-mode
diff --git a/.emacs.d/snippets/html-mode/dd b/.emacs.d/snippets/html-mode/dd
new file mode 100644
index 0000000..8120b13
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/dd
@@ -0,0 +1,5 @@
1#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
2#name : <dd> ... </dd>
3#group : list
4# --
5<dd>$1</dd> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/dl b/.emacs.d/snippets/html-mode/dl
new file mode 100644
index 0000000..be11bb5
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/dl
@@ -0,0 +1,7 @@
1#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
2#name : <dl> ... </dl>
3#group : list
4# --
5<dl>
6 $0
7</dl>
diff --git a/.emacs.d/snippets/html-mode/doctype b/.emacs.d/snippets/html-mode/doctype
new file mode 100644
index 0000000..a60dfb6
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/doctype
@@ -0,0 +1,4 @@
1#name : Doctype HTML 4.01 Strict
2#group : meta
3# --
4<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/doctype.html5 b/.emacs.d/snippets/html-mode/doctype.html5
new file mode 100644
index 0000000..a892472
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/doctype.html5
@@ -0,0 +1,4 @@
1#name : Doctype HTML 5
2#group : meta
3# --
4<!DOCTYPE html>
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1 b/.emacs.d/snippets/html-mode/doctype.xhtml1
new file mode 100644
index 0000000..5d95e07
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/doctype.xhtml1
@@ -0,0 +1,4 @@
1#name : DocType XHTML 1.0 frameset
2#group : meta
3# --
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1_1 b/.emacs.d/snippets/html-mode/doctype.xhtml1_1
new file mode 100644
index 0000000..fec46d7
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/doctype.xhtml1_1
@@ -0,0 +1,4 @@
1#name : DocType XHTML 1.1
2#group : meta
3# --
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1_strict b/.emacs.d/snippets/html-mode/doctype.xhtml1_strict
new file mode 100644
index 0000000..20d95d3
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/doctype.xhtml1_strict
@@ -0,0 +1,4 @@
1#name : DocType XHTML 1.0 Strict
2#group : meta
3# --
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/doctype.xhtml1_transitional b/.emacs.d/snippets/html-mode/doctype.xhtml1_transitional
new file mode 100644
index 0000000..c5255fc
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/doctype.xhtml1_transitional
@@ -0,0 +1,4 @@
1#name : DocType XHTML 1.0 Transitional
2#group : meta
3# --
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/dt b/.emacs.d/snippets/html-mode/dt
new file mode 100644
index 0000000..f385cec
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/dt
@@ -0,0 +1,5 @@
1#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
2#name : <dt> ... </dt>
3#group : list
4# --
5<dt>$1</dt> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/form b/.emacs.d/snippets/html-mode/form
new file mode 100644
index 0000000..f1c066d
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/form
@@ -0,0 +1,6 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name :<form method="..." id="..." action="..."></form>
3# --
4<form method="$1" id="$2" action="$3">
5 $0
6</form> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/html b/.emacs.d/snippets/html-mode/html
new file mode 100644
index 0000000..958aa6d
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/html
@@ -0,0 +1,6 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <html>...</html>
3# --
4<html>
5 $0
6</html>
diff --git a/.emacs.d/snippets/html-mode/html.xmlns b/.emacs.d/snippets/html-mode/html.xmlns
new file mode 100644
index 0000000..7dd7ee4
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/html.xmlns
@@ -0,0 +1,6 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <html xmlns="...">...</html>
3# --
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}">
5 $0
6</html>
diff --git a/.emacs.d/snippets/html-mode/link.import b/.emacs.d/snippets/html-mode/link.import
new file mode 100644
index 0000000..30b8fd3
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/link.import
@@ -0,0 +1,4 @@
1#contributor : Vikrant Rathore <vikrant@vyomtech.com>
2#name : <link rel="import" />
3# --
4<link rel="import" href="${1:url}" />
diff --git a/.emacs.d/snippets/html-mode/link.stylesheet b/.emacs.d/snippets/html-mode/link.stylesheet
new file mode 100644
index 0000000..6c9de74
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/link.stylesheet
@@ -0,0 +1,4 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <link stylesheet="..." />
3# --
4<link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" /> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/link.stylesheet-ie b/.emacs.d/snippets/html-mode/link.stylesheet-ie
new file mode 100644
index 0000000..4f6a776
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/link.stylesheet-ie
@@ -0,0 +1,6 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <!--[if IE]><link stylesheet="..." /><![endif]-->
3# --
4<!--[if IE]>
5<link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" />
6<![endif]--> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/mailto b/.emacs.d/snippets/html-mode/mailto
new file mode 100644
index 0000000..419f2a5
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/mailto
@@ -0,0 +1,4 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <a href="mailto:...@...">...</a>
3# --
4<a href="mailto:$1@$2">$0</a> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/meta b/.emacs.d/snippets/html-mode/meta
new file mode 100644
index 0000000..30319ef
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/meta
@@ -0,0 +1,5 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#group : meta
3#name : <meta name="..." content="..." />
4# --
5<meta name="${1:generator}" content="${2:content}" /> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/meta.http-equiv b/.emacs.d/snippets/html-mode/meta.http-equiv
new file mode 100644
index 0000000..9913652
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/meta.http-equiv
@@ -0,0 +1,5 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <meta http-equiv="..." content="..." />
3#group : meta
4# --
5<meta http-equiv="${1:Content-Type}" content="${2:text/html; charset=UTF-8}" />
diff --git a/.emacs.d/snippets/html-mode/script.javascript b/.emacs.d/snippets/html-mode/script.javascript
new file mode 100644
index 0000000..bf0c3b5
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/script.javascript
@@ -0,0 +1,6 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name :<script type="text/javascript">...</script>
3# --
4<script type="text/javascript">
5 $0
6</script> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/script.javascript-src b/.emacs.d/snippets/html-mode/script.javascript-src
new file mode 100644
index 0000000..b64c4dc
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/script.javascript-src
@@ -0,0 +1,4 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name :<script type="text/javascript" src="..."></script>
3# --
4<script type="text/javascript" src="$1"></script> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/textarea b/.emacs.d/snippets/html-mode/textarea
new file mode 100644
index 0000000..058498f
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/textarea
@@ -0,0 +1,4 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <textarea ...></textarea>
3# --
4<textarea name="$1" id="$2" rows="$3" cols="$4" tabindex="$5"></textarea> \ No newline at end of file
diff --git a/.emacs.d/snippets/html-mode/th b/.emacs.d/snippets/html-mode/th
new file mode 100644
index 0000000..3b5fab1
--- /dev/null
+++ b/.emacs.d/snippets/html-mode/th
@@ -0,0 +1,5 @@
1#contributor : Jimmy Wu <frozenthrone88@gmail.com>
2#name : <th>...</th>
3#group : table
4# --
5<th$1>$2</th> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/body b/.emacs.d/snippets/nxml-mode/body
new file mode 100644
index 0000000..ddcf0cf
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/body
@@ -0,0 +1,6 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <body>...</body>
3# --
4<body$1>
5 $0
6</body> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/br b/.emacs.d/snippets/nxml-mode/br
new file mode 100644
index 0000000..ba35773
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/br
@@ -0,0 +1,4 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <br />
3# --
4<br /> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/doctype b/.emacs.d/snippets/nxml-mode/doctype
new file mode 100644
index 0000000..3fdcf17
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/doctype
@@ -0,0 +1,5 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : DocType XHTML 1.1
3#group : meta
4# --
5<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict
new file mode 100644
index 0000000..eca5860
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_strict
@@ -0,0 +1,5 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : DocType XHTML 1.0 Strict
3#group : meta
4# --
5<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional
new file mode 100644
index 0000000..fba232a
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/doctype_xhtml1_transitional
@@ -0,0 +1,5 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : DocType XHTML 1.0 Transitional
3#group : meta
4# --
5<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/form b/.emacs.d/snippets/nxml-mode/form
new file mode 100644
index 0000000..252253e
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/form
@@ -0,0 +1,6 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name :<form method="..." action="..."></form>
3# --
4<form method="$1" action="$2">
5 $0
6</form> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/href b/.emacs.d/snippets/nxml-mode/href
new file mode 100644
index 0000000..47cb84a
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/href
@@ -0,0 +1,5 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <a href="...">...</a>
3#key: a
4# --
5<a href="$1">$2</a> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/html b/.emacs.d/snippets/nxml-mode/html
new file mode 100644
index 0000000..85e09f7
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/html
@@ -0,0 +1,6 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <html xmlns="...">...</html>
3# --
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}">
5 $0
6</html>
diff --git a/.emacs.d/snippets/nxml-mode/img b/.emacs.d/snippets/nxml-mode/img
new file mode 100644
index 0000000..1f4382b
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/img
@@ -0,0 +1,4 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <img src="..." alt="..." />
3# --
4<img src="$1" alt="$2" /> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/input b/.emacs.d/snippets/nxml-mode/input
new file mode 100644
index 0000000..80c3503
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/input
@@ -0,0 +1,4 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <input ... />
3# --
4<input type="$1" name="$2" value="$3" /> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/link b/.emacs.d/snippets/nxml-mode/link
new file mode 100644
index 0000000..d93b7a5
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/link
@@ -0,0 +1,4 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <link stylesheet="..." />
3# --
4<link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" /> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/meta b/.emacs.d/snippets/nxml-mode/meta
new file mode 100644
index 0000000..dfee1f2
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/meta
@@ -0,0 +1,5 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <meta name="..." content="..." />
3#group : meta
4# --
5<meta name="${1:generator}" content="${2:content}" /> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/name b/.emacs.d/snippets/nxml-mode/name
new file mode 100644
index 0000000..592d0da
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/name
@@ -0,0 +1,4 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <a name="..."></a>
3# --
4<a name="$1"></a> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/quote b/.emacs.d/snippets/nxml-mode/quote
new file mode 100644
index 0000000..20fed1e
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/quote
@@ -0,0 +1,6 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <blockquote>...</blockquote>
3# --
4<blockquote>
5 $1
6</blockquote> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/style b/.emacs.d/snippets/nxml-mode/style
new file mode 100644
index 0000000..b80be1c
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/style
@@ -0,0 +1,6 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <style type="text/css" media="...">...</style>
3# --
4<style type="text/css" media="${1:screen}">
5 $0
6</style> \ No newline at end of file
diff --git a/.emacs.d/snippets/nxml-mode/tag b/.emacs.d/snippets/nxml-mode/tag
new file mode 100644
index 0000000..7c6a766
--- /dev/null
+++ b/.emacs.d/snippets/nxml-mode/tag
@@ -0,0 +1,5 @@
1#contributor : Anders Bach Nielsen <abachn@abachn.net>
2#name : <tag>...</tag>
3#key: t
4# --
5<${1:tag}>$2</$1>$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/prog-mode/.yas-setup.el b/.emacs.d/snippets/prog-mode/.yas-setup.el
new file mode 100644
index 0000000..03d07cf
--- /dev/null
+++ b/.emacs.d/snippets/prog-mode/.yas-setup.el
@@ -0,0 +1,2 @@
1(defun yas-with-comment (str)
2 (format "%s%s%s" comment-start str comment-end))
diff --git a/.emacs.d/snippets/prog-mode/fixme b/.emacs.d/snippets/prog-mode/fixme
new file mode 100644
index 0000000..146db8b
--- /dev/null
+++ b/.emacs.d/snippets/prog-mode/fixme
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: fixme
3# key: fi
4# condition: (not (eq major-mode 'sh-mode))
5# --
6`(yas-with-comment "FIXME: ")` \ No newline at end of file
diff --git a/.emacs.d/snippets/prog-mode/todo b/.emacs.d/snippets/prog-mode/todo
new file mode 100644
index 0000000..973151f
--- /dev/null
+++ b/.emacs.d/snippets/prog-mode/todo
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: todo
3# key: t
4# --
5`(yas-with-comment "TODO: ")` \ No newline at end of file
diff --git a/.emacs.d/snippets/prog-mode/xxx b/.emacs.d/snippets/prog-mode/xxx
new file mode 100644
index 0000000..09df18b
--- /dev/null
+++ b/.emacs.d/snippets/prog-mode/xxx
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: xxx
3# key: x
4# --
5`(yas-with-comment "XXX: ")` \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/.yas-setup.el b/.emacs.d/snippets/python-mode/.yas-setup.el
index 864cbce..3f57d15 100644
--- a/.emacs.d/snippets/python-mode/.yas-setup.el
+++ b/.emacs.d/snippets/python-mode/.yas-setup.el
@@ -1,3 +1,5 @@
1(defvar yas-text)
2
1(defun python-split-args (arg-string) 3(defun python-split-args (arg-string)
2 "Split a python argument string into ((name, default)..) tuples" 4 "Split a python argument string into ((name, default)..) tuples"
3 (mapcar (lambda (x) 5 (mapcar (lambda (x)
@@ -11,12 +13,12 @@
11 (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) 13 (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0))
12 (formatted-args (mapconcat 14 (formatted-args (mapconcat
13 (lambda (x) 15 (lambda (x)
14 (concat ":param " (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) ": " 16 (concat (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) " -- "
15 (if (nth 1 x) (concat "\(default " (nth 1 x) "\)")))) 17 (if (nth 1 x) (concat "\(default " (nth 1 x) "\)"))))
16 args 18 args
17 indent))) 19 indent)))
18 (unless (string= formatted-args "") 20 (unless (string= formatted-args "")
19 (mapconcat 'identity (list "Keyword arguments:" formatted-args) indent)))) 21 (mapconcat 'identity (list "Keyword Arguments:" formatted-args) indent))))
20 22
21(add-hook 'python-mode-hook 23(add-hook 'python-mode-hook
22 '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed))) 24 '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed)))