Closes #318: Don't use CL-LABELS for backward compatibility with older emacsen

This commit is contained in:
João Távora 2013-09-02 11:55:55 +01:00
parent a7d40ed14a
commit ce50b3dbfa

View File

@ -696,19 +696,18 @@ defined direct keybindings to the command
(defun yas--modes-to-activate () (defun yas--modes-to-activate ()
"Compute list of mode symbols that are active for `yas-expand' "Compute list of mode symbols that are active for `yas-expand'
and friends." and friends."
(cl-labels (let ((dfs (lambda (mode &optional explored)
((dfs (mode &optional explored) (push mode explored)
(push mode explored) (cons mode
(cons mode (loop for neighbour
(loop for neighbour in (remove nil (cons (get mode
in (remove nil (cons (get mode 'derived-mode-parent)
'derived-mode-parent) (gethash mode yas--parents)))
(gethash mode yas--parents)))
unless (memq neighbour explored) unless (memq neighbour explored)
append (dfs neighbour explored))))) append (funcall dfs neighbour explored))))))
(remove-duplicates (append yas-extra-modes (remove-duplicates (append yas-extra-modes
(dfs major-mode))))) (funcall dfs major-mode)))))
(defvar yas-minor-mode-hook nil (defvar yas-minor-mode-hook nil
"Hook run when `yas-minor-mode' is turned on.") "Hook run when `yas-minor-mode' is turned on.")