포인트의 기호의 정의로 이동하십시오. 글로벌 정의, 로컬 정의, 심지어 거시적 인 코드를 지원합니다!

elisp-def 코드를 정적으로 분석하고 불가능한 곳에서 휴리스틱으로 돌아갑니다. 시간의 99%가 작동해야하므로 코드의 정의를 찾을 수없는 경우 버그를 제출하십시오.
Melpa에서 설치 한 다음 EMACS 구성에 다음을 추가하십시오.
( dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook))
( add-hook hook # 'elisp-def-mode )) elisp-def 글로벌 기능과 글로벌 변수의 정의를 찾을 수 있습니다.
( defun demo/foo ()
1 )
( defun demo/bar ()
; ; M-x eval-buffer, then elisp-def on this:
(demo/foo))또한 Edebug 정보를 사용하여 기능 정의를 찾으므로 XREF보다 정의를 더 자주 찾습니다.
elisp-def 기호와 함수의 차이점을 이해하고 올바른 정의로 이동합니다.
( require 'cc-mode )
; ; `c-version' is both a variable and a function.
( defun demo/foo ()
; ; `elisp-def` will find the function here.
( c-version ))
( defun demo/foo ()
; ; `elisp-def` will find the variable here.
( setq c-version t )) elisp-def 매크로를 이해하므로 기능 참조를 정확하게 감지 할 수 있습니다.
( require 'dash )
( defvar demo/foo nil )
( defun demo/foo ( x )
x)
( defun demo/bar ()
(-> > 123
; ; `elisp-def' knows that this is a function, even though there are
; ; no parens.
demo/foo))또한 함수 또는 변수를 정의하는 매크로를 이해할 수 있습니다.
( define-derived-mode demo/foo-mode fundamental-mode " demo " )
; ; `elisp-def' will expand macros to discover where major mode hooks
; ; are defined.
demo/foo-mode-hook
( cl-defstruct demo/point x y)
; ; `elisp-def' can find this function even though the defstruct
; ; call doesn't contain this symbol name.
(make-demo/point 1 2 ) elisp-def 라이브러리를 찾을 수 있으며 가능한 경우 provide 선언을 표시합니다.
; ; `elisp-def' will open python.el here.
( require 'python )
; ; Unlike `xref-find-definition' , `elisp-def' will not confuse this
; ; library name with the macro named `use-package' .
( require 'use-package )
; ; `elisp-def' will even find python.el here, because the macro
; ; expands to a call to `require' .
( use-package python
:config
( setq python-indent-guess-indent-offset-verbose nil )) elisp-def 로컬 바인딩 및 매개 변수를 이해합니다.
( defun demo/foo ( bar )
( let ((foo 1 ))
; ; `elisp-def' on the FOO below will move point to the let
; ; binding.
( setq foo 2 )
; ; `elisp-def' on the BAR below will move point to the function
; ; parameters line.
( setq bar 3 )))
( defun demo/bar ()
( let* ((foo 1 )
(bar 2 )
(foo 3 )
; ; `elisp-def' on the second FOO on the following line will
; ; move point to the relevant binding, which is the line
; ; immediately above.
(foo ( + foo 1 ))
(foo 5 ))
nil ))이것은 바인딩을 도입하는 매크로에서도 작동합니다.
( require 'dash )
( eval-when-compile
( require 'cl-lib ))
( defun demo/foo ( items )
( cl-destructuring-bind ( first second) items
; ; `elisp-def' knowns that FIRST is bound on line above.
( message " first is %s " first))
(-let [( first . rest) items]
; ; `elisp-def' knowns that FIRST is bound on line above.
( message " first is %s " first))) elisp-def 사용하면 인용 된 기호, docstring 기호 또는 백 크기 기호에 포인트를 넣을 수 있습니다.
( defun demo/foo ( x )
; ; `elisp-def' on X in the docstring will find the parameter.
" Adds one to X and returns it. "
( 1+ x))
( defun demo/bar ()
; ; `elisp-def' can find demo/foo even when point is on the #.
( funcall # 'demo/foo 1 )
; ; `elisp-def' on demo/foo below will find the function.
; ;
; ; See `demo/foo' for more information.
nil )
( defun demo/baz ( foo )
; ; `elisp-def' understands that @ is not part of foo here.
`(blah ,@foo ))기호를 찾으면 ELISP-DEF는 가시성을 위해 일시적으로이를 강조합니다.
elisp-def 인용 된 기호를 분석하는 능력이 제한되어 있습니다.
; ; `elisp-def' is able to find these quoted symbols because they're
; ; only globally bound in one namespace.
( mapcar 'symbol-name '(foo bar baz))
( add-to-list 'auto-mode-alist '( " \ .java \ ' " . java-mode))
( require 'cc-mode )
( defun demo/calls-fn ( sym )
( funcall sym))
; ; Since `c-version' is both a function and a variable, and we're not
; ; using a sharp-quote #'c-version, we have to prompt the user.
(demo/calls-fn 'c-version )
( defun demo/foo ( c-version )
; ; Here we have no idea whether we're using `c-version' as a
; ; function (e.g. funcall), as a variable (e.g. set) or as a
; ; parameter (e.g. eval).
(bar 'c-version nil )) elisp-def let* 시맨틱 및 복제 변수가있는 매크로에서 정의를 찾을 수 없습니다.
( require 'dash )
( defun demo/foo ()
(-let ((x 1 )
(x 2 ))
; ; `elisp-def' on X below will move to the first X binding, rather
; ; than the second.
x)) elisp-def 또한 기호가 완전히 사라지도록 양식을 다시 작성하는 매크로를 처리 할 수 없습니다.
( eval-when-compile ( require 'cl-lib ))
( cl-labels ((foo (x y) ( + x y)))
; ; `cl-labels' completely rewrites this body to (--cl-foo-- 1 2), so
; ; `elisp-def' can't find the definition of FOO.
(foo 1 2 ))elisp-slime-nav-find-elisp-thing-at-pointemacs-lisp-mode 의 xref-find-definitions (EMACS Core의 일부)semantic/ia.el 의 semantic-ia-fast-jump (EMACS 포함) Elisp EsoTica, 특히 Wasamasa에 대한 나의 질문에 대답 한 #emacs 의 훌륭한 사람들.
Clojure 완료를위한 칭찬 라이브러리에는 ELISP-DEF가 추출하고 분석하는 방식과 매우 유사한 컨텍스트 개념이 있습니다.
Hacklang은 코드의 한 지점에서 완료를 분석하기위한 자리 표시 자와 비슷한 개념을 가지고 있습니다.
gplv3+.
오픈 소스 라이센스에 따라 저장소에 코드를 제공하고 있습니다. 이것은 나의 개인 저장소이기 때문에, 내 코드에받는 라이센스는 내 고용주가 아니라 나에게서 왔습니다.