branch: externals/leaf
commit cfa10472fe1fb6bd3b8b664726bc71e2449cacb3
Author: Naoya Yamashita <[email protected]>
Commit: Naoya Yamashita <[email protected]>
add leaf-find-function-support to configure find-func integration
---
leaf.el | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/leaf.el b/leaf.el
index 1493072..a974449 100644
--- a/leaf.el
+++ b/leaf.el
@@ -440,6 +440,19 @@ Ref: `lisp-imenu-generic-expression'."
lisp-imenu-generic-expression))))))
:group 'leaf)
+(defcustom leaf-find-function-support t
+ "If non-nil, enable `find-func' integrations.
+Ref: `find-function-regexp-alist'."
+ :type 'boolean
+ :set (lambda (sym value)
+ (set sym value)
+ (eval-after-load 'find-func
+ (if value
+ `(add-to-list 'find-function-regexp-alist '(leaf .
leaf-find-regexp))
+ `(setq find-function-regexp-alist
+ (delete '(leaf . leaf-find-regexp)
find-function-regexp-alist)))))
+ :group 'leaf)
+
;;;; General polyfill
@@ -740,11 +753,6 @@ see `alist-get'."
;;;; find-function
-(eval-after-load 'find-func
- (lambda ()
- (defvar find-function-regexp-alist)
- (add-to-list 'find-function-regexp-alist '(leaf . leaf-find-regexp))))
-
(defun leaf-find (name)
"Find the leaf block of NAME."
(interactive