help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does grep add /dev/null the first time?


From: guido
Subject: Why does grep add /dev/null the first time?
Date: Thu, 14 Aug 2014 11:12:07 -0700 (PDT)
User-agent: G2/1.0

The subject is a proxy for a more complex question. I am using Emacs 24.3.1 on 
Mac OS X.; however the same issue occurs with Emacs 22.1.1 (which comes with 
the OS).

I have this in my .emacs:

(defun ack (arg)
  (interactive "sRun ack with arguments: ")
  (grep (concat "ack --noheading " arg)))

Note that "ack" is a grep-like tool which I've installed on my $PATH. Its first 
argument is a search pattern; optional following arguments are files or 
directories, defaulting to the current directory.

I invoke this using ESC-x ack (and then typing a search term).

The (minor) issue with this is that the first time after starting Emacs (and 
only the first time) the shell command actually executed has "/dev/null" 
appended (causing the search to return no results). Any subsequent invocations 
it will work fine.

What am I missing?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]