Skip to content

KarimAziev/elisp-scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elisp-scan

Find unused code and print reports for Emacs Lisp files.

elisp-scan use mixed text search - initial “dumb” searching with ag, then parses the code with elisp.

./demo.gif

Requirements

  • Emacs 28.1
  • ag or find

Installation

with straight-use-package

Put the following in your init file:

(use-package elisp-scan
  :straight (elisp-scan
             :type git
             :host github
             :repo "KarimAziev/elisp-scan"))

Manual

Or download the repository and add it to your load-path.

(add-to-list 'load-path "/path/to/elisp-scan/")

(require 'elisp-scan)

Usage

The most straightforward usage is to invoke transient popup M-x elisp-scan-menu and M-x elisp-scan-list-menu (in report buffers).

  • elisp-scan-file Scan the Elisp file and show the report.
  • elisp-scan-dir Scan elisp files in the directory and show the report.
  • elisp-scan-project Scan project files and show the report.
  • elisp-scan-all-unused-defs Same as elisp-scan-project but with predefined filters to show only unused items.

This command will activate elisp-scan-report-mode with such bindings:

KeyCommand
RETView entry
DRemove marked entries or entry at point
KCancel rendering
mMark entry
uUnmark entry
C-c C-nMove to the next entry start
C-c C-pMove to the previous entry start
C-.Show transient menu
.Show transient menu
?Show transient menu

Other commands

  • elisp-scan-rename-symbol

Rename exact matches of the symbol at the point.

  • elisp-scan-ivy-read-unused-items

Read unused definitions of the current file with ivy. To remove one item without exiting the minibuffer, use C-c C-d. To remove or back up a batch of items, mark them. With the optional prefix arg include only the current file.

Customizations

  • elisp-scan-initial-filters Initial filters in report list mode.
  • elisp-scan-permanent-dirs In which directories always check usage.
  • elisp-scan-types-symbols List of symbols to check.

About

Find unused code in Emacs Lisp files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published