branch: externals/leaf
commit ce10d8437590f8bdda189b0820e8c209d59fbe63
Author: Naoya Yamashita <con...@gmail.com>
Commit: Naoya Yamashita <con...@gmail.com>

    use mapcan for old Emacs<=27.1
---
 leaf.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/leaf.el b/leaf.el
index 8a9df24..46c2398 100644
--- a/leaf.el
+++ b/leaf.el
@@ -743,7 +743,7 @@ see `alist-get'."
        (list (completing-read "Find leaf: " (delete-dups (mapcar #'car 
leaf--paths)))))))
   (require 'find-func)
   (let* ((name (intern name))
-         (paths (flatten-tree (mapcar (lambda (a) (when (eq name (car a)) (cdr 
a))) leaf--paths)))
+         (paths (mapcan (lambda (elm) (when (eq name (car elm)) (list (cdr 
elm)))) leaf--paths))
          (path (if (= (length paths) 1) paths (list (completing-read "Select 
one: " paths))))
          (location (apply #'find-function-search-for-symbol name 'leaf path)))
     (prog1 (pop-to-buffer (car location))

Reply via email to