Winnow search results from ag/grep by matching/excluding lines
Emacs Lisp Makefile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
test
.gitignore
Cask
Makefile
README.org
winnow.el
winnow.gif

README.org

winnow.el

https://melpa.org/packages/winnow-badge.svg https://circleci.com/gh/dgtized/winnow.el.svg?style=svg

Winnow - verb

  1. Blow a current of air through (grain) in order to remove the chaff.

1.1. Remove (chaff) from grain.

1.2. Remove (people or things) from a group until only the best ones are left.

1.3. Find or identify (a valuable or useful part of something)

winnow.gif

Usage

Winnow the results from compilation-mode buffers by matching or excluding lines from the results.

This was written to enhance ag.el, by filtering ag-mode results buffers by iteratively applying match and exclude, winnowing the results.

The following key bindings are enabled:

KeyFunction
xwinnow-exclude-lines
mwinnow-match-lines

The builtin highlight-regexp (M-s h r) can be used to show interesting matches in the set.

Basic workflow is to run an ag search (through say projectile-ag), and then use winnow-exclude-lines and winnow-match-lines to keep/flush matching lines in the search results. If it’s too filtered, just recompile.

Install

Using the MELPA package archive,

M-x package-install [RET] winnow [RET]

And then add the following somewhere in your emacs initialization

(add-hook 'ag-mode-hook 'winnow-mode)

Broadly it should work anything that derives from compilation-mode so

(add-hook 'compilation-mode-hook 'winnow-mode)

will enable it everywhere. That should definitely work on grep-mode, and may be applicable to other compilation modes. Unfortunately it is not applicable for rspec-mode as it currently stands.

License

Copyright © 2017 Charles L.G. Comstock

Distributed under the GNU General Public License, version 3