Merge pull request #1196 from VitoVan/master

(yas--all-parents): delete-dups for fundamental-mode
This commit is contained in:
monnier 2024-04-06 09:14:51 -04:00 committed by GitHub
commit eb5ba2664c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -848,18 +848,19 @@ which decides on the snippet to expand.")
(cons (if (eq mode 'fundamental-mode) () (cons (if (eq mode 'fundamental-mode) ()
(append (cdr ap) '(fundamental-mode))) (append (cdr ap) '(fundamental-mode)))
extras)))) extras))))
(cons mode (delete-dups
(yas--merge-ordered-lists (cons mode
(mapcar #'yas--all-parents (yas--merge-ordered-lists
(remq nil (mapcar #'yas--all-parents
`(,(or (get mode 'derived-mode-parent) (remq nil
;; Consider `fundamental-mode' `(,(or (get mode 'derived-mode-parent)
;; as ultimate ancestor. ;; Consider `fundamental-mode'
'fundamental-mode) ;; as ultimate ancestor.
,(let ((alias (symbol-function mode))) 'fundamental-mode)
(when (symbolp alias) alias)) ,(let ((alias (symbol-function mode)))
,@(get mode 'derived-mode-extra-parents) (when (symbolp alias) alias))
,@(gethash mode yas--parents))))))))) ,@(get mode 'derived-mode-extra-parents)
,@(gethash mode yas--parents))))))))))
(dolist (parent all-parents) (dolist (parent all-parents)
(cl-pushnew mode (get parent 'yas--cached-children))) (cl-pushnew mode (get parent 'yas--cached-children)))
(put mode 'yas--all-parents all-parents))))) (put mode 'yas--all-parents all-parents)))))