Skip to content

Commit

Permalink
Merge pull request #1157 from Sasanidas/add-lisp-search-asdf
Browse files Browse the repository at this point in the history
Add lisp-search-asdf-definition command
  • Loading branch information
cxxxr authored Nov 14, 2023
2 parents 397a6af + 24577a7 commit 06369cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extensions/lisp-mode/apropos-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,12 @@
(completion-symbol-for-search-symbol
query)))))
(display-xref-locations (find-definitions-by-name name))))

(define-command lisp-search-asdf-definition () ()
(check-connection)
(let* ((system (read-asdf-system-name))
(file (read-from-string
(cadr (lisp-eval
`(micros:eval-and-grab-output
,(format nil "(asdf:system-source-file \"~a\")" system)))))))
(find-file file)))
11 changes: 11 additions & 0 deletions extensions/lisp-mode/lisp-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,17 @@
(find string package-names :test #'string=))
:history-symbol 'mh-lisp-package))))

(defun read-asdf-system-name ()
(check-connection)
(let ((system-names (lisp-eval '(micros:list-systems))))
(prompt-for-string
"System: "
:completion-function (lambda (string)
(completion string system-names))
:test-function (lambda (string)
(find string system-names :test #'string=))
:history-symbol 'mh-lisp-system)))

(defun lisp-beginning-of-defun (point n)
(lem-lisp-syntax:beginning-of-defun point (- n)))

Expand Down

0 comments on commit 06369cb

Please sign in to comment.