pax_global_header00006660000000000000000000000064133333133130014506gustar00rootroot0000000000000052 comment=b3ae114ef6cf40364c376490aab8f3bdc6cceaf5 e-0.1/000077500000000000000000000000001333331331300115725ustar00rootroot00000000000000e-0.1/LICENSE000066400000000000000000000017771333331331300126130ustar00rootroot00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. e-0.1/README.md000066400000000000000000000016741333331331300130610ustar00rootroot00000000000000All or almost all Unix editors support the syntax of "editor +42 file", to open the given file and start with the cursor at line 42. Alas, the syntax programs that *output* such data use is different: either "file:42: Something" or "file:42:1: Something", :1 being a column number. This wrapper will recognize such references and call your $EDITOR using the + notation. Thus, once you see an error message, you can copy&paste the offending first word of it without having to think. Especially if your mouse selection is configured to allow ':', it's a single triple-click (L+L+M), and still pretty handy if not. If your editor allows multi-open, "e" can also handle pipelines such as: * `git grep MEOW|e -:` * `make 2>&1 >/dev/null|grep error:|e -::` Also, because of its short name, it reduces the typing needed to start the editor by half if you use vi, by 80% if emacs or jstar — and that's by far the most frequent command an Unix user does. e-0.1/e000077500000000000000000000015441333331331300117500ustar00rootroot00000000000000#!/usr/bin/perl -w my @files; my $cut; if (!@ARGV) { exec $ENV{'EDITOR'}//"/usr/bin/sensible-editor"; } if ($ARGV[0] eq '-:') { $cut=1; } elsif ($ARGV[0] eq '-::') { $cut=2; } unless ($cut) { for (@ARGV) { s/:$//; my $line=0; $line=$1 if (s/:(\d+)(?:|:\d+)$//); push @files, "+$line" if $line; push @files, $_; } } else { @files=@ARGV[1..-1]; my $re=($cut==1) ? '^([^:]+)(?:$|:(\d+)[: \t\r\n])' : '^([^:]+):(\d+)(?::\d+)?(?:$|:[ \t\r\n])'; while() { next unless /$re/; my $f=$1; chomp $f; push @files, "+$2" if defined $2; push @files, $f; } open STDIN, "" ] .IR [\fB:\fR\fIline\fR] .RI [ ...] .br .I .B | e -: .RI [ "" ] .br .I .B | e -:: .RI [ "" ] .SH DESCRIPTION Programs that mention line numbers in messages have mostly standardized on "file:line: Message" or "file:line:col: Message". Alas, this is not what editors support, which is almost always "+line" "file". .P .B e takes a list of file names, optionally followed with .BI : line \fR, then possibly with .BI : column and/or an additional colon, and gives to your editor. The line numbers are passed as a separate argument "\fB+\fR\fIline\fR" before the file name which is what editors expect. .P Alternatively, you can provide file names on the standard input, and specify .B -: or .B -:: as the first argument. The former allows file names without line numbers, the latter silently ignores anything not in the expected format. .P Examples: .IP git grep FIXME|e -: .IP make 2>&1 >/dev/null|grep error:|e -:: .P This is roughly a shorthand for "e `pipeline|cut -d: -f1-2`". .P .B e is also handy as a general-purpose smart alias for running the editor. If yours has a long name like "jstar" or "emacs", you save four keystrokes on what for a typical Unix user is the most often issued command. .SH EDITOR SELECTION If the environment variable \fB$EDITOR\fR is set, \fBe\fR will use that. Otherwise, it calls \fBsensible-editor\fR, which asks what editor to use then saves your answer. You can run \fBselect-editor\fR to get asked again.