From: guido@dropbox.com
To: help-gnu-emacs@gnu.org
Subject: Why does grep add /dev/null the first time?
Date: Thu, 14 Aug 2014 11:12:07 -0700 (PDT) [thread overview]
Message-ID: <9c9b05f0-e060-4c00-a393-aaae65f524be@googlegroups.com> (raw)
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?
next reply other threads:[~2014-08-14 18:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 18:12 guido [this message]
2014-08-14 19:13 ` Why does grep add /dev/null the first time? Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c9b05f0-e060-4c00-a393-aaae65f524be@googlegroups.com \
--to=guido@dropbox.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).