emacs-devel
[Top][All Lists]
Advanced

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

Re: M-x compile for different file extensions


From: Ehud Karni
Subject: Re: M-x compile for different file extensions
Date: Tue, 22 Oct 2002 20:23:06 +0200

On Mon, 21 Oct 2002 23:12:29 -0400, Richard Stallman <address@hidden> wrote:
> 
>     2. We use the compile command on many type of files which are not
>        real "programs" - shell scripts (run with arguments), sql queries,
>        reports (printed by the `compile') and many, many others.
> 
> Ok, but if you do that, is it really the case that the command you want
> to run follows from the current visited file?

Yes, because we have our "standard" extensions for this kind of files.

>     >     5. Run some commands with interactive input to them (when needed) 
> in a
>     >        compilation window, with an option to kill the compilation 
> buffer.
>     >        (`compile-commands', read the help carefully).
>     > 
>     > Why is this better than using a single shell command string, with `;'
>     > and `sleep N' used as needed between the individual shell commands?
> 
>     This is really used for programs that use /dev/tty (and not standard
>     input), for security (programs that need pass words) or dynamic
>     answers. It also has the added advantage of running multiple processes,
>     each with its own buffer and different name automatically. 
> 
> I don't see the connection--would you please explain?
> These programs would relate to the other feature, having a way to send
> input to the compilation process, but I don't see how they relate
> to this feature.

An example may clarify it:
 (compile-commands '(("cd\n" 0)       ;; work in home dir
                     (". Xoper\n" 3)  ;; run this script (wait 3 seconds)
                     ("oper-pw\n" 3)) ;; send oper password (must read from 
/dev/tty)
       "Oper Xterm" 1))               ;; name of compilation buffer,
                                      ;; kill the compilation buffer after the 
process ends

The sending of the pass word uses the fact that the compilation buffer
make a pseudo terminal that connects with the sub shell.

Ehud.


-- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:address@hidden                  Better  Safe  Than  Sorry




reply via email to

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