Skip to content
This repository

wrong guess about filter mode when running inside Emacs (or Vim) #106

Closed
damil opened this Issue December 15, 2009 · 4 comments

5 participants

Laurent Dami Rob Hoelz Torsten Blix Loic Nageleisen jkline-okta
Laurent Dami

ack 1.92 decides to go into filter mode when (-p STDIN) is true. Filter mode means that input is taken from stdin and not from files given on the command line. But when running inside Emacs, the condition is true because it's an inferior process, and then nothing happens because Emacs doesn't pipe anything into ack STDIN.
So in such a case we don't want the filter behaviour, and therefore we need a way to forcefully disable filter mode from a command line option.
[problem occured with Emacs 22.3.1 on win32, running ack.el version 0.4]

Torsten Blix

would be solved with issue 90's --[no]filter option

Loic Nageleisen

Can't believe this is not fixed yet, and that flags like -G get dropped when specified.
Same problem with Gedit external tools.

Workaround: wrap ack in a (python) script that creates a pseudo-terminal on stdin (may not work on non-linux).

#!/usr/bin/env python
import sys, pty
search = sys.stdin.read().strip()
argv = ['ack', search]
pty.spawn(argv)
jkline-okta

I get this same error when running ack remotely with sudo:
$ ssh ahost.sleepycat.com -- sudo ack pattern file
ack: Ignoring 1 argument on the command-line while acting as a filter.

Problems occurs with ahost running versions:
$ ssh ahost.sleepycat.com -- sudo ack --version
ack 1.96
Running under Perl 5.10.1 at /usr/bin/perl

but does not occur when running the same remote command against a different server with ack 1.96 Running under Perl 5.8.8.

Rob Hoelz hoelzro closed this August 28, 2013
Rob Hoelz
Collaborator

Addressed in petdance/ack2#346.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.