emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/leaf cfa1047 32/46: add leaf-find-function-support to c


From: Stefan Monnier
Subject: [elpa] externals/leaf cfa1047 32/46: add leaf-find-function-support to configure find-func integration
Date: Mon, 15 Mar 2021 22:20:46 -0400 (EDT)

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

    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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]