all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Running Programs from Inside Emacs
@ 2011-02-17 11:08 haziz
  2011-02-17 11:15 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 7+ messages in thread
From: haziz @ 2011-02-17 11:08 UTC (permalink / raw)
  To: help-gnu-emacs

When using emacs for programming in C, I know how to compile programs from inside emacs using Mx compile to invoke make -k which then compiles using gcc (I am running Linux Mint on a desktop machine at home and also use Mac OS X on a laptop). 

I have so far been unable to figure out how to "run" the resulting binary from inside emacs. I would like to be able to then run the binary file from inside emacs. So far I have had to exit emacs returning to my bash shell to run the binary by for e.g.    ./helloworld

Is it possible to get a shell prompt inside emacs and run the file in a secondary buffer within emacs?

I have tried to do a google search about this but most search results seem to talk only about Mx compile and stop there.

Thanks.

Sincerely,

Hany.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Running Programs from Inside Emacs
  2011-02-17 11:08 Running Programs from Inside Emacs haziz
@ 2011-02-17 11:15 ` Pascal J. Bourguignon
  2011-02-17 15:09   ` despen
  0 siblings, 1 reply; 7+ messages in thread
From: Pascal J. Bourguignon @ 2011-02-17 11:15 UTC (permalink / raw)
  To: help-gnu-emacs

haziz <hsaziz@gmail.com> writes:

> When using emacs for programming in C, I know how to compile programs from inside emacs using Mx compile to invoke make -k which then compiles using gcc (I am running Linux Mint on a desktop machine at home and also use Mac OS X on a laptop). 
>
> I have so far been unable to figure out how to "run" the resulting binary from inside emacs. I would like to be able to then run the binary file from inside emacs. So far I have had to exit emacs returning to my bash shell to run the binary by for e.g.    ./helloworld

For non-interactive programs you can run them after the compilation:

M-x compile RET C-e && ./helloword RET


> Is it possible to get a shell prompt inside emacs and run the file in a secondary buffer within emacs?

M-x shell RET



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Running Programs from Inside Emacs
  2011-02-17 11:15 ` Pascal J. Bourguignon
@ 2011-02-17 15:09   ` despen
  2011-02-19 12:08     ` Oleksandr Gavenko
       [not found]     ` <mailman.4.1298117344.32106.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: despen @ 2011-02-17 15:09 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> haziz <hsaziz@gmail.com> writes:
>
>> When using emacs for programming in C, I know how to compile programs from inside emacs using Mx compile to invoke make -k which then compiles using gcc (I am running Linux Mint on a desktop machine at home and also use Mac OS X on a laptop). 
>>
>> I have so far been unable to figure out how to "run" the resulting binary from inside emacs. I would like to be able to then run the binary file from inside emacs. So far I have had to exit emacs returning to my bash shell to run the binary by for e.g.    ./helloworld
>
> For non-interactive programs you can run them after the compilation:
>
> M-x compile RET C-e && ./helloword RET

IMO, better is to use the Makefile.

all: helloworld.test

helloworld:
        cc helloworld.c -o helloworld

helloworld.test: helloworld
        ./helloworld



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Running Programs from Inside Emacs
  2011-02-17 15:09   ` despen
@ 2011-02-19 12:08     ` Oleksandr Gavenko
  2011-02-19 12:25       ` Peter Dyballa
       [not found]     ` <mailman.4.1298117344.32106.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Oleksandr Gavenko @ 2011-02-19 12:08 UTC (permalink / raw)
  To: help-gnu-emacs

On 2011-02-17 15:09, despen@verizon.net wrote:
> IMO, better is to use the Makefile.
>
> [...]
>
> helloworld.test: helloworld
>          ./helloworld
>
But if your './helloworld' is interactive console app and it ask you
for input you get can not pass input to it.

Or this possible in comiplation-mode?

-- 
Best regards!




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Running Programs from Inside Emacs
  2011-02-19 12:08     ` Oleksandr Gavenko
@ 2011-02-19 12:25       ` Peter Dyballa
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2011-02-19 12:25 UTC (permalink / raw)
  To: Oleksandr Gavenko; +Cc: help-gnu-emacs


Am 19.02.2011 um 13:08 schrieb Oleksandr Gavenko:

> Or this possible in comiplation-mode?


Of course! M-x send-invisible <some input> RET.

--
Greetings

   Pete

There are very few jobs that actually require a penis or vagina. All  
other jobs should be open to everybody.
				– Florynce Kennedy




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Running Programs from Inside Emacs
       [not found]     ` <mailman.4.1298117344.32106.help-gnu-emacs@gnu.org>
@ 2011-02-19 12:28       ` Pascal J. Bourguignon
  2011-02-19 15:48         ` despen
  0 siblings, 1 reply; 7+ messages in thread
From: Pascal J. Bourguignon @ 2011-02-19 12:28 UTC (permalink / raw)
  To: help-gnu-emacs

Oleksandr Gavenko <gavenkoa@gmail.com> writes:

> On 2011-02-17 15:09, despen@verizon.net wrote:
>> IMO, better is to use the Makefile.
>>
>> [...]
>>
>> helloworld.test: helloworld
>>          ./helloworld
>>
> But if your './helloworld' is interactive console app and it ask you
> for input you get can not pass input to it.
>
> Or this possible in comiplation-mode?

No it is not.  For console applications, I advised to use M-x shell in
that case, but there are other ways.  

In emacs, you can use M-x term if the program
uses curses or in general terminal control codes beyond the dumbest
CR-LF.

Or, outside of emacs, you can launch your program via xterm or some
other terminal emulator:

    helloworld.test: helloworld
        xterm -e ./helloworld

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Running Programs from Inside Emacs
  2011-02-19 12:28       ` Pascal J. Bourguignon
@ 2011-02-19 15:48         ` despen
  0 siblings, 0 replies; 7+ messages in thread
From: despen @ 2011-02-19 15:48 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Oleksandr Gavenko <gavenkoa@gmail.com> writes:
>
>> On 2011-02-17 15:09, despen@verizon.net wrote:
>>> IMO, better is to use the Makefile.
>>>
>>> [...]
>>>
>>> helloworld.test: helloworld
>>>          ./helloworld
>>>
>> But if your './helloworld' is interactive console app and it ask you
>> for input you get can not pass input to it.
>>
>> Or this possible in comiplation-mode?
>
> No it is not.  For console applications, I advised to use M-x shell in
> that case, but there are other ways.  
>
> In emacs, you can use M-x term if the program
> uses curses or in general terminal control codes beyond the dumbest
> CR-LF.
>
> Or, outside of emacs, you can launch your program via xterm or some
> other terminal emulator:
>
>     helloworld.test: helloworld
>         xterm -e ./helloworld

Seems to me, that's inside emacs.
It's running under emacs from compilation mode.

You can  probably devise  something with gnuclient  running one  of the
emacs terminals.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-19 15:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 11:08 Running Programs from Inside Emacs haziz
2011-02-17 11:15 ` Pascal J. Bourguignon
2011-02-17 15:09   ` despen
2011-02-19 12:08     ` Oleksandr Gavenko
2011-02-19 12:25       ` Peter Dyballa
     [not found]     ` <mailman.4.1298117344.32106.help-gnu-emacs@gnu.org>
2011-02-19 12:28       ` Pascal J. Bourguignon
2011-02-19 15:48         ` despen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.