[Top][All Lists]

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

Re: Why can't I use xargs emacs?

From: Ivan Shmakov
Subject: Re: Why can't I use xargs emacs?
Date: Wed, 03 Feb 2010 09:40:06 +0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hash: SHA1

>>>>> "PJB" == Pascal J Bourguignon <address@hidden> writes:
>>>>> "AF" == Adam Funk <address@hidden> 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
Version: GnuPG v1.4.9 (GNU/Linux)


reply via email to

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