Skip to content

Commit

Permalink
Merge pull request #1196 from VitoVan/master
Browse files Browse the repository at this point in the history
(yas--all-parents): delete-dups for fundamental-mode
  • Loading branch information
monnier committed Apr 6, 2024
2 parents 33587a8 + e23a801 commit eb5ba26
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions yasnippet.el
Expand Up @@ -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)))))
Expand Down

0 comments on commit eb5ba26

Please sign in to comment.