future-proof against obsoleting of `flet'

flet will be marked obsolete starting in Emacs 24.3
This commit is contained in:
Roland Walker 2012-11-05 11:09:25 -05:00
parent 42ed181f4a
commit 32e56098fb

View File

@ -136,6 +136,12 @@
(require 'easymenu) (require 'easymenu)
(require 'help-mode) (require 'help-mode)
(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
@ -1843,7 +1849,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)
@ -3685,7 +3691,7 @@ 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)