Skip to content

Winnow search results from ag/grep by matching/excluding lines

Notifications You must be signed in to change notification settings

dgtized/winnow.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-2021 Charles L.G. Comstock

Distributed under the GNU General Public License, version 3

About

Winnow search results from ag/grep by matching/excluding lines

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published