mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Merge remote-tracking branch 'rolandwalker/flet'
Conflicts: yasnippet.el
This commit is contained in:
commit
880767e669
36
yasnippet.el
36
yasnippet.el
@ -147,6 +147,14 @@
|
|||||||
(defvar yas-selected-text)
|
(defvar yas-selected-text)
|
||||||
(defvar yas-verbosity))
|
(defvar yas-verbosity))
|
||||||
|
|
||||||
|
;; Future-proof against obsoleting flet, see github #324
|
||||||
|
;;
|
||||||
|
(eval-and-compile
|
||||||
|
(unless (fboundp 'cl-flet)
|
||||||
|
(defalias 'cl-flet 'flet)
|
||||||
|
(put 'cl-flet 'lisp-indent-function 1)
|
||||||
|
(put 'cl-flet 'edebug-form-spec '((&rest (defun*)) cl-declarations body))))
|
||||||
|
|
||||||
|
|
||||||
;;; User customizable variables
|
;;; User customizable variables
|
||||||
|
|
||||||
@ -1776,7 +1784,7 @@ foo\"bar\\! -> \"foo\\\"bar\\\\!\""
|
|||||||
This works by stubbing a few functions, then calling
|
This works by stubbing a few functions, then calling
|
||||||
`yas-load-directory'."
|
`yas-load-directory'."
|
||||||
(interactive "DTop level snippet directory?")
|
(interactive "DTop level snippet directory?")
|
||||||
(flet ((yas--load-yas-setup-file
|
(cl-flet ((yas--load-yas-setup-file
|
||||||
(file)
|
(file)
|
||||||
(let ((elfile (concat file ".el")))
|
(let ((elfile (concat file ".el")))
|
||||||
(when (file-exists-p elfile)
|
(when (file-exists-p elfile)
|
||||||
@ -3638,19 +3646,19 @@ Returns the newly created snippet."
|
|||||||
|
|
||||||
This is according to their relative positions in the buffer, and
|
This is according to their relative positions in the buffer, and
|
||||||
has to be called before the $-constructs are deleted."
|
has to be called before the $-constructs are deleted."
|
||||||
(flet ((yas--fom-set-next-fom (fom nextfom)
|
(cl-flet ((yas--fom-set-next-fom (fom nextfom)
|
||||||
(cond ((yas--field-p fom)
|
(cond ((yas--field-p fom)
|
||||||
(setf (yas--field-next fom) nextfom))
|
(setf (yas--field-next fom) nextfom))
|
||||||
((yas--mirror-p fom)
|
((yas--mirror-p fom)
|
||||||
(setf (yas--mirror-next fom) nextfom))
|
(setf (yas--mirror-next fom) nextfom))
|
||||||
(t
|
(t
|
||||||
(setf (yas--exit-next fom) nextfom))))
|
(setf (yas--exit-next fom) nextfom))))
|
||||||
(yas--compare-fom-begs (fom1 fom2)
|
(yas--compare-fom-begs (fom1 fom2)
|
||||||
(if (= (yas--fom-start fom2) (yas--fom-start fom1))
|
(if (= (yas--fom-start fom2) (yas--fom-start fom1))
|
||||||
(yas--mirror-p fom2)
|
(yas--mirror-p fom2)
|
||||||
(>= (yas--fom-start fom2) (yas--fom-start fom1))))
|
(>= (yas--fom-start fom2) (yas--fom-start fom1))))
|
||||||
(yas--link-foms (fom1 fom2)
|
(yas--link-foms (fom1 fom2)
|
||||||
(yas--fom-set-next-fom fom1 fom2)))
|
(yas--fom-set-next-fom fom1 fom2)))
|
||||||
;; make some yas--field, yas--mirror and yas--exit soup
|
;; make some yas--field, yas--mirror and yas--exit soup
|
||||||
(let ((soup))
|
(let ((soup))
|
||||||
(when (yas--snippet-exit snippet)
|
(when (yas--snippet-exit snippet)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user