🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4097

Re: Why can't I use xargs emacs?

#4097
From: Ivan Shmakov
Date: Wed, 03 Feb 2010 03:40
61 lines
2777 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "PJB" == Pascal J Bourguignon <pjb@informatimago.com> writes:
>>>>> "AF" == Adam Funk <a24061@ducksburg.com> 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 
...
M-x server-start RET
...
M-! find -name '*.txt' | xargs emacsclient -n & RET

	But one has to use an “asynchronous” (i. e., “background”)
	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.

[...]

- -- 
FSF associate member #7257
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkto8B8ACgkQMBO2oCMOM0oHhACgrkJftA4oYTWHscebcCtUvVj2
YroAn2Yg0f8GXeGQoeYzKQcm90waYytw
=hJo3
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <87eil3rnqh.fsf@violet.siamics.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail
References: <p4em37xiau.ln2@news.ducksburg.com> <87tytzw9b5.fsf@informatimago.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 39ae015015,546aec423372e37b
X-Google-Attributes: gid39ae015015,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,UTF8
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail
From: Ivan Shmakov <ivan@main.uusia.org>
Newsgroups: comp.unix.shell,gnu.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
Lines: 61
Message-ID: <87eil3rnqh.fsf@violet.siamics.net>
References: <p4em37xiau.ln2@news.ducksburg.com> <87tytzw9b5.fsf@informatimago.com>
Reply-To: Ivan Shmakov <oneingray@gmail.com>
NNTP-Posting-Host: bW53KlxYX8sHoP92q6+dpA.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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)