summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Simeonov2017-01-30 20:14:44 +0100
committerSimeon Simeonov2017-01-30 20:14:44 +0100
commit4534f929d50c580ebe1341f8ea7b56c85a9c66e4 (patch)
tree2a808f3b6e4921b910e73bcd5eba0215796f7b43
parent30436a90f50cc2dea0dc0dfcd4df46b8003d1c0a (diff)
yasnippet update
-rw-r--r--.emacs.d/lisp/yasnippet.el66
1 files changed, 33 insertions, 33 deletions
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el
index e0333bb..7b01599 100644
--- a/.emacs.d/lisp/yasnippet.el
+++ b/.emacs.d/lisp/yasnippet.el
@@ -2006,7 +2006,7 @@ static in the menu."
2006 ;; higher passes. 2006 ;; higher passes.
2007 ;; 2007 ;;
2008 (mapc #'(lambda (item) 2008 (mapc #'(lambda (item)
2009 (when (and (listp (cdr item)) 2009 (when (and (consp (cdr-safe item))
2010 (keymapp (nth 2 (cdr item)))) 2010 (keymapp (nth 2 (cdr item))))
2011 (yas--delete-from-keymap (nth 2 (cdr item)) uuid))) 2011 (yas--delete-from-keymap (nth 2 (cdr item)) uuid)))
2012 (cdr keymap)) 2012 (cdr keymap))
@@ -2016,9 +2016,10 @@ static in the menu."
2016 ;; Destructively modify keymap 2016 ;; Destructively modify keymap
2017 ;; 2017 ;;
2018 (setcdr keymap (cl-delete-if (lambda (item) 2018 (setcdr keymap (cl-delete-if (lambda (item)
2019 (or (null (cdr item)) 2019 (cond ((not (listp item)) nil)
2020 (and (keymapp (nth 2 (cdr item))) 2020 ((null (cdr item)))
2021 (null (cdr (nth 2 (cdr item))))))) 2021 ((and (keymapp (nth 2 (cdr item)))
2022 (null (cdr (nth 2 (cdr item))))))))
2022 (cdr keymap)))) 2023 (cdr keymap))))
2023 2024
2024(defun yas-define-menu (mode menu &optional omit-items) 2025(defun yas-define-menu (mode menu &optional omit-items)
@@ -2056,35 +2057,34 @@ omitted from MODE's menu, even if they're manually loaded."
2056 "Helper for `yas-define-menu'." 2057 "Helper for `yas-define-menu'."
2057 (cl-loop 2058 (cl-loop
2058 for (type name submenu) in (reverse menu) 2059 for (type name submenu) in (reverse menu)
2059 if (or (eq type 'yas-item) 2060 collect (cond
2060 (and yas-alias-to-yas/prefix-p 2061 ((or (eq type 'yas-item)
2061 (eq type 'yas/item))) 2062 (and yas-alias-to-yas/prefix-p
2062 do (let ((template (or (gethash name uuidhash) 2063 (eq type 'yas/item)))
2063 (puthash name 2064 (let ((template (or (gethash name uuidhash)
2064 (yas--make-template 2065 (puthash name
2065 :table table 2066 (yas--make-template
2066 :perm-group group-list 2067 :table table
2067 :uuid name) 2068 :perm-group group-list
2068 uuidhash)))) 2069 :uuid name)
2069 (define-key menu-keymap (vector (cl-gensym)) 2070 uuidhash))))
2070 (car (yas--template-menu-binding-pair-get-create template :stay)))) 2071 (car (yas--template-menu-binding-pair-get-create
2071 else if (or (eq type 'yas-submenu) 2072 template :stay))))
2072 (and yas-alias-to-yas/prefix-p 2073 ((or (eq type 'yas-submenu)
2073 (eq type 'yas/submenu))) 2074 (and yas-alias-to-yas/prefix-p
2074 do (let ((subkeymap (make-sparse-keymap))) 2075 (eq type 'yas/submenu)))
2075 (define-key menu-keymap (vector (cl-gensym)) 2076 (let ((subkeymap (make-sparse-keymap)))
2076 `(menu-item ,name ,subkeymap)) 2077 (yas--define-menu-1 table subkeymap submenu uuidhash
2077 (yas--define-menu-1 table 2078 (append group-list (list name)))
2078 subkeymap 2079 `(menu-item ,name ,subkeymap)))
2079 submenu 2080 ((or (eq type 'yas-separator)
2080 uuidhash 2081 (and yas-alias-to-yas/prefix-p
2081 (append group-list (list name)))) 2082 (eq type 'yas/separator)))
2082 else if (or (eq type 'yas-separator) 2083 '(menu-item "----"))
2083 (and yas-alias-to-yas/prefix-p 2084 (t (yas--message 1 "Don't know anything about menu entry %s" type)
2084 (eq type 'yas/separator))) 2085 nil))
2085 do (define-key menu-keymap (vector (cl-gensym)) 2086 into menu-entries
2086 '(menu-item "----")) 2087 finally do (push (apply #'vector menu-entries) (cdr menu-keymap))))
2087 else do (yas--message 1 "Don't know anything about menu entry %s" type)))
2088 2088
2089(defun yas--define (mode key template &optional name condition group) 2089(defun yas--define (mode key template &optional name condition group)
2090 "Define a snippet. Expanding KEY into TEMPLATE. 2090 "Define a snippet. Expanding KEY into TEMPLATE.