{"id":13646508,"url":"https://github.com/Wilfred/elisp-refs","last_synced_at":"2025-04-21T21:30:51.546Z","repository":{"id":43736635,"uuid":"64889537","full_name":"Wilfred/elisp-refs","owner":"Wilfred","description":"semantic code search for emacs lisp","archived":false,"fork":false,"pushed_at":"2023-09-20T02:01:52.000Z","size":480,"stargazers_count":113,"open_issues_count":14,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-15T01:15:47.208Z","etag":null,"topics":["code-search","emacs-lisp","find-references"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wilfred.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-04T00:49:40.000Z","updated_at":"2023-12-17T18:08:33.000Z","dependencies_parsed_at":"2024-01-13T17:09:46.659Z","dependency_job_id":"51f60349-93b9-4e1c-b2bc-e4713ee27415","html_url":"https://github.com/Wilfred/elisp-refs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wilfred%2Felisp-refs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wilfred%2Felisp-refs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wilfred%2Felisp-refs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wilfred%2Felisp-refs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wilfred","download_url":"https://codeload.github.com/Wilfred/elisp-refs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250136632,"owners_count":21380870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-search","emacs-lisp","find-references"],"created_at":"2024-08-02T01:02:57.700Z","updated_at":"2025-04-21T21:30:51.254Z","avatar_url":"https://github.com/Wilfred.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"# elisp-refs\n[![Coverage Status](https://coveralls.io/repos/github/Wilfred/elisp-refs/badge.svg?branch=master)](https://coveralls.io/github/Wilfred/elisp-refs?branch=master)\n[![MELPA](http://melpa.org/packages/elisp-refs-badge.svg)](http://melpa.org/#/elisp-refs)\n\nelisp-refs is an intelligent code search for Emacs lisp.\n\nIt can find references to functions, macros or variables. Unlike a\ndumb text search, elisp-refs actually parses the code, so it's never\nconfused by comments or variables with the same name as functions.\n\n![screenshot](refs_screenshot.png)\n\nThis is particularly useful for finding all the places a function is\nused, or finding examples of usage.\n\nInterested readers may enjoy my blog post:\n[Searching A Million Lines Of Lisp](http://www.wilfred.me.uk/blog/2016/09/30/searching-a-million-lines-of-lisp/).\n\n## Installation\n\nInstall from MELPA (recommended) or just add elisp-refs to your `load-path`.\n\n## Commands available\n\n* `elisp-refs-function` (find function calls)\n* `elisp-refs-macro` (find macro calls)\n* `elisp-refs-variable` (find variable references)\n* `elisp-refs-special` (find special form calls)\n* `elisp-refs-symbol` (find all references to a symbol)\n\nThese command search all the files currently loaded in your Emacs\ninstance.\n\nIf called with a prefix, you can limit search results to specific\ndirectories. For example:\n\n`C-u M-x elisp-refs-macro RET pcase RET ~/.emacs.d/elpa/magit-20160927.510 RET`\n\nwill search for uses of `pcase` in magit:\n\n![filtering screenshot](refs_filtered.png)\n\n## Semantic analysis\n\nelisp-refs has *street smarts*: given `(defun foo (bar) (baz))`, it\nunderstands that `bar` is a variable and `baz` is a function.\n\nelisp-refs understands the following forms:\n\n* `defun` `defsubst` `defmacro` `cl-defun`\n* `lambda`\n* `let` `let*`\n* `funcall` `apply`\n* sharp quoted expressions (e.g. `#'some-func`)\n\n## Limitations\n\nelisp-refs understands elisp special forms, and a few common\nmacros. However, it **cannot understand arbitrary macros**.\n\nTherefore elisp-refs will assume that `(other-macro (foo bar))` is a\nfunction call to `foo`. If this is incorrect, you may wish to use the\ncommand `elisp-refs-symbol` to find all references to the `foo` symbol.\n\nIf `other-macro` is a common macro, please consider submitting a patch\nto `elisp-refs--function-p` to make elisp-refs smarter.\n\nelisp-refs also does not support **indirect calls**.\n\n``` emacs-lisp\n;; Since we do a simple syntax tree walk, this isn't treated as a\n;; call to foo.\n(let ((x (symbol-function 'foo)))\n  (funcall x))\n\n;; Similarly, indirect function calls are not treated as\n;; function calls.\n(defun call-func (x)\n  (funcall x))\n(call-func 'foo)\n\n;; However, if you use sharp quoting, elisp-refs knows it's a function\nreference!\n(call-func #'foo)\n```\n\n## Running tests\n\nYou can run the tests with:\n\n```\n$ cask install\n$ cask exec ert-runner\n```\n\n## Performance\n\nelisp-refs is CPU-intensive elisp and has been carefully optimised. You\ncan run the benchmark script with:\n\n```\n$ cask install\n$ ./bench.sh\n```\n\nNew features are carefully measured to ensure performance does not get\nworse.\n\nSee elisp-refs-bench.el for more details.\n\n## Alternative Projects\n\n**xref-find-references**: This command is included in Emacs 25.1, but\nit's based on a text search. It is confused by comments and strings,\nand cannot distinguish between functions and variables.\n\nxrefs-find-references is also line oriented, so it does not show the\nwhole sexp that matched your search. Since it requires text files,\nit doesn't search built-in .el.gz files.\n\n**TAGS**: It is possible to record function references in TAGS\nfiles. Whilst [universal-ctags](https://github.com/universal-ctags/ctags) (formerly\nknown as exuberant-ctags) does provide the ability to find references,\nit is not supported in its lisp parser.\n\netags, the TAGS implementation shipped with Emacs, cannot find\nreferences (to my knowledge).\n\n**[el-search](https://elpa.gnu.org/packages/el-search.html)** allows\nyou to search for arbitrary forms in elisp files. It's slower, but a\nmuch more general tool. Its design greatly influenced elisp-refs.\n\n**[elisp-slime-nav](https://github.com/purcell/elisp-slime-nav)**\nfinds definitions, not references. It's a great complementary tool.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWilfred%2Felisp-refs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWilfred%2Felisp-refs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWilfred%2Felisp-refs/lists"}