From ff48006f55533fffd8c8c8f2266e8a121d148c59 Mon Sep 17 00:00:00 2001 From: Joao Tavora Date: Thu, 7 Nov 2013 00:46:08 +0000 Subject: [PATCH] fix: sort by nesting depth before initial mirror update this is still incomplete, but should be enough for most cases --- snippet.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snippet.el b/snippet.el index f8c5726..ec6c7f8 100644 --- a/snippet.el +++ b/snippet.el @@ -486,7 +486,11 @@ meaning is not decided yet" ;; (setq snippet--debug nil) (defun snippet--activate-snippet (objects) - (let ((mirrors (cl-remove-if-not #'snippet--mirror-p objects)) + (let ((mirrors (cl-sort (cl-remove-if-not #'snippet--mirror-p objects) + #'(lambda (p1 p2) + (cond ((not p2) t) + ((not p1) nil))) + :key #'snippet--object-parent)) (fields (cl-sort (cl-remove-if-not #'snippet--field-p objects) #'(lambda (n1 n2) (cond ((not (integerp n2)) t)