From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.help Subject: Re: Why can't I use xargs emacs? Date: Wed, 03 Feb 2010 09:40:06 +0600 Organization: Aioe.org NNTP Server Message-ID: <87eil3rnqh.fsf@violet.siamics.net> References: <87tytzw9b5.fsf@informatimago.com> Reply-To: Ivan Shmakov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1265178645 30568 80.91.229.12 (3 Feb 2010 06:30:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2010 06:30:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 03 07:30:43 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NcYl8-0004Mg-AV for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Feb 2010 07:30:42 +0100 Original-Received: from localhost ([127.0.0.1]:44524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcYl7-0003wI-Fn for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Feb 2010 01:30:41 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!not-for-mail Original-Newsgroups: comp.unix.shell,gnu.emacs.help Original-Lines: 61 Original-NNTP-Posting-Host: bW53KlxYX8sHoP92q6+dpA.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:q93MBZkS8CZ7mGIn05lak4FLpzY= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Original-Xref: news.stanford.edu comp.unix.shell:233705 gnu.emacs.help:176566 X-Mailman-Approved-At: Wed, 03 Feb 2010 01:17:52 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71641 Archived-At: =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >>>>> "PJB" =3D=3D Pascal J Bourguignon writes: >>>>> "AF" =3D=3D Adam Funk writes: AF> The emacs command can take a list of filename arguments, so why AF> can't I get xargs to work with it? > $ find -name '*.txt' |xargs emacs -nw > emacs: standard input is not a tty [...] PJB> emacs is an interactive program. It expects its stdin and stdout PJB> to be hooked to the terminal, where it can display a character PJB> matrix, and from which it can read user input. [...] PJB> To open several files in emacs, you could either use emacsclient, PJB> or an emacs lisp script. PJB> Launch emacs in a separate terminal: xterm -e emacs -nw & PJB> In emacs, start the server: M-x server-start RET PJB> In a shell, you can then type: find -name '*.txt' | xargs PJB> emacsclient -n Note that a separate terminal is not necessary, as one can call Shell commands from Emacs, like: $ emacs -nw=20 ... M-x server-start RET ... M-! find -name '*.txt' | xargs emacsclient -n & RET But one has to use an =E2=80=9Casynchronous=E2=80=9D (i. e., =E2=80=9Cback= ground=E2=80=9D) command, as indicated by an ampersand after the command line. PJB> Simplier would be to just open the file in emacs: PJB> Launch emacs: emacs -nw Then type: C-x C-f *.txt RET Though that will not recurse into the directories, as the plain find will. [...] =2D --=20 FSF associate member #7257 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkto8B8ACgkQMBO2oCMOM0oHhACgrkJftA4oYTWHscebcCtUvVj2 YroAn2Yg0f8GXeGQoeYzKQcm90waYytw =3DhJo3 =2D----END PGP SIGNATURE-----