From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: guido@dropbox.com Newsgroups: gmane.emacs.help Subject: Why does grep add /dev/null the first time? Date: Thu, 14 Aug 2014 11:12:07 -0700 (PDT) Message-ID: <9c9b05f0-e060-4c00-a393-aaae65f524be@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1408042683 18181 80.91.229.3 (14 Aug 2014 18:58:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 18:58:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 14 20:57:57 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XI0Db-0001Ki-W6 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2014 20:57:48 +0200 Original-Received: from localhost ([::1]:55698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XI0Db-0006bA-Js for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2014 14:57:47 -0400 X-Received: by 10.236.61.36 with SMTP id v24mr3252216yhc.24.1408039928328; Thu, 14 Aug 2014 11:12:08 -0700 (PDT) X-Received: by 10.50.39.113 with SMTP id o17mr383046igk.14.1408039928216; Thu, 14 Aug 2014 11:12:08 -0700 (PDT) Original-Path: usenet.stanford.edu!j15no7169985qaq.0!news-out.google.com!px9ni588igc.0!nntp.google.com!h18no20305802igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2620:c6:8000:200:19cf:b47b:e5f8:46b6; posting-account=aWiLpQoAAABxw5FS0fvkcLPe4gwpRQU7 Original-NNTP-Posting-Host: 2620:c6:8000:200:19cf:b47b:e5f8:46b6 User-Agent: G2/1.0 Injection-Date: Thu, 14 Aug 2014 18:12:08 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:206939 X-Mailman-Approved-At: Thu, 14 Aug 2014 14:57:30 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99215 Archived-At: 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?