branch: externals/csharp-mode commit ba36d6c771e49a3579d91f9efa684ae57a5731fc Author: Vasilij Schneidermann <v.schneiderm...@gmail.com> Commit: Vasilij Schneidermann <v.schneiderm...@gmail.com>
Replace `flet` with `letrec` Closes #39. --- csharp-mode.el | 79 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/csharp-mode.el b/csharp-mode.el index 0a02034..4a2f9b4 100644 --- a/csharp-mode.el +++ b/csharp-mode.el @@ -2647,16 +2647,18 @@ this fn will be something like this: (\"(bottom)\" . 1)) " - (flet ((helper (list new) - (if (null list) new - (let* ((elt (car list)) - (topic (csharp--make-plural (csharp--first-word (car elt)))) - (xelt (assoc topic new))) - (helper (cdr list) - (if xelt - (progn (incf (cdr xelt)) new) - (cons (cons topic 1) new))))))) - (nreverse (helper list nil)))) + (letrec ((helper + (lambda (list new) + (if (null list) new + (let* ((elt (car list)) + (topic (csharp--make-plural + (csharp--first-word(car elt)))) + (xelt (assoc topic new))) + (funcall helper (cdr list) + (if xelt + (progn (incf (cdr xelt)) new) + (cons (cons topic 1) new)))))))) + (nreverse (funcall helper list nil)))) @@ -2914,36 +2916,37 @@ out into multiple submenus. " (let ((counts (csharp--imenu-counts menu-alist))) - (flet ((helper - (list new) - (if (null list) - new - (let* ((elt (car list)) - (topic (csharp--make-plural (csharp--first-word (car elt)))) - (xelt (assoc topic new))) - (helper - (cdr list) - (if xelt - (progn - (rplacd xelt (cons elt (cdr xelt))) - new) - (cons - - (cond - ((> (cdr (assoc topic counts)) - csharp-imenu-max-similar-items-before-extraction) - (cons topic (list elt))) - - ((imenu--subalist-p elt) - (cons (car elt) - (csharp--imenu-reorg-alist-intelligently (cdr elt)))) - (t - elt)) - - new))))))) + (letrec ((helper + (lambda (list new) + (if (null list) + new + (let* ((elt (car list)) + (topic (csharp--make-plural + (csharp--first-word (car elt)))) + (xelt (assoc topic new))) + (funcall + helper (cdr list) + (if xelt + (progn + (rplacd xelt (cons elt (cdr xelt))) + new) + (cons + + (cond + ((> (cdr (assoc topic counts)) + csharp-imenu-max-similar-items-before-extraction) + (cons topic (list elt))) + + ((imenu--subalist-p elt) + (cons (car elt) + (csharp--imenu-reorg-alist-intelligently (cdr elt)))) + (t + elt)) + + new)))))))) (csharp--imenu-break-into-submenus - (nreverse (helper menu-alist nil)))))) + (nreverse (funcall helper menu-alist nil))))))