unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to edit+compile+debug without leaving GNU/Emacs
@ 2006-02-18  7:05 venk
  2006-02-18 19:36 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: venk @ 2006-02-18  7:05 UTC (permalink / raw)


hello all,

At my work place, policies say sources are to be edited on one
machine(say edit.machine.com) and cimpilation is to be done on another
machine(say build.machine.com) and test run or debug on another machine
(debug.machine.com).

I like to know if it is possible to start Emacs on edit.machi.. and
somehow make M-x compile connect to build.mach..(using ssh. telnet and
rlogin appears to be closed) and show the build messages on *compile*
buffer. Also, similarly, make M-x gdb (through ssh) run the binary on
debug.mac...

If anybody knows how to do this or is already doing something like
this, please let me know how to do it.

$ uname -a says
Linux edit.machine.com 2.4.22-kb0 #1 SMP Fri Sep 5 17:49:32 PDT 2003
i686 unknown

and
M-x emacs-version says
GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of
2003-03-27 on edit.machine.com

My Emacs proficiency is medium. And, I do not know any of lisp or
elisp.

Thanks in advance.

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-18  7:05 how to edit+compile+debug without leaving GNU/Emacs venk
@ 2006-02-18 19:36 ` Peter Dyballa
       [not found] ` <mailman.675.1140291391.2856.help-gnu-emacs@gnu.org>
  2006-02-20 19:09 ` Colin S. Miller
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2006-02-18 19:36 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 18.02.2006 um 08:05 schrieb venk:

> At my work place, policies say sources are to be edited on one
> machine(say edit.machine.com) and cimpilation is to be done on another
> machine(say build.machine.com) and test run or debug on another  
> machine
> (debug.machine.com).

I usually launch on each of these specialists a GNU Emacs to display  
on my workstation. Creating on each of them a .emacs files that  
specifies different fonts and colours (a suite of colours, including  
prompts and more) for every instance of GNU Emacs running makes  
working with them very safe.

         (setq initial-frame-alist '(
           (border-color     . "#4e3832")
           (foreground-color . "grey10")
           (background-color . "PaleTurquoise1")
;         (background-color . "honeydew")
;         (background-color . "AliceBlue")
;         (background-color . "ghost white")
;         (background-color . "antiquewhite1")
;         (background-color . "ivory")
           (font . "fontset-10pt_lucidatypewriter")
           (top . 5) (left . 500) (width . 106) (height . 50))
         )
         (setq default-frame-alist '(
           (background-color     . "LightCyan1")
;         (background-color     . "ivory")
;         (background-color     . "ghost white")
           (cursor-color         . "purple")
           (cursor-type          . box)
           (foreground-color     . "grey10")
           (vertical-scroll-bars . left)
           (active-alpha         . 0.875)
           (inactive-alpha       . 0.75)
           (font . "fontset-11pt_adobe_courier")
           (top . 25) (left . 50) (width . 89) (height . 50))


--
Greetings

   Pete


"Evolution"            o           __o                     _o _
           °\___o      /0~         -\<,              ^\___ /=\\_/-%
oo~_______ /\ /\______/ \_________O/ O_______________o===>-->O--o____
""

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
       [not found] ` <mailman.675.1140291391.2856.help-gnu-emacs@gnu.org>
@ 2006-02-20  8:28   ` venk
  2006-02-20 10:50     ` Peter Dyballa
  2006-02-20 11:30     ` N. Raghavendra
  0 siblings, 2 replies; 9+ messages in thread
From: venk @ 2006-02-20  8:28 UTC (permalink / raw)



Peter Dyballa wrote:
> I usually launch on each of these specialists a GNU Emacs to display
> on my workstation. Creating on each of them a .emacs files that
> specifies different fonts and colours (a suite of colours, including
> prompts and more) for every instance of GNU Emacs running makes
> working with them very safe.
>
This is suggesting to use one .emacs per edit, build, debug terminals.
Have I understood right? Actually, my home directory(the absolute path)
is the same on all these three machines. so wherever I start Emacs
from, the same .emacs gets loaded.

How can I load different .emacs depending on the machine name?

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-20  8:28   ` venk
@ 2006-02-20 10:50     ` Peter Dyballa
  2006-02-20 12:48       ` Venkatesh Pitta
  2006-02-20 11:30     ` N. Raghavendra
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2006-02-20 10:50 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 20.02.2006 um 09:28 schrieb venk:

> This is suggesting to use one .emacs per edit, build, debug terminals.
> Have I understood right?

Yes.

> Actually, my home directory(the absolute path) is the same on all  
> these three machines. so wherever I start Emacs from, the  
> same .emacs gets loaded.

The same for me. I had different .Xdefaults files (.Xdefaults- 
<hostname>) and I had in .emacs portions for each host. HOSTNAME was  
defined in the environment, so I could get its value and use it.

>
> How can I load different .emacs depending on the machine name?

You could create different .emacs-<HOSTNAME> files and then put  
into .emacs:

	(load (format "~/.emacs-%s.el" (getenv "HOST")))

This will retrieve the $HOST environment variable and create a file  
name according to the specified format. The file with this file name  
then will be loaded and its ELisp code executed. You could make each  
of these files start with

	(message ".emacs-<given HOSTNAME> starts here")

and end with

	(message ".emacs-<given HOSTNAME> ends here")

to see that it actually works. (You probably know 'touch ~/.emacs-$ 
{HOST}.el' ?) Then put the *-frame-alist's into them. The default  
type defaults for all GNU Emacs frame (I prefer to start with an  
initial one that's a bit different in order to do experiments with  
some Emacsen in progress).

--
Greetings

   Pete

The human animal differs from the lesser primates in his passion for  
lists of "Ten Best".
-- H. Allen Smith

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-20  8:28   ` venk
  2006-02-20 10:50     ` Peter Dyballa
@ 2006-02-20 11:30     ` N. Raghavendra
  2006-02-22  4:35       ` venk
  1 sibling, 1 reply; 9+ messages in thread
From: N. Raghavendra @ 2006-02-20 11:30 UTC (permalink / raw)


At 2006-02-20T00:28:06-08:00, venk wrote:

> How can I load different .emacs depending on the machine name?

One way is to create one init file named after each host, e.g.,
`edit.el', `build.el', and `debug.el', say in the directory
$HOME/emacs.  Then, use $HOME/.emacs as a wrapper which loads the
relevant init file.  So, `.emacs' would just contain the forms

(defun hostname (domain-name)
  "Return the hostname component of DOMAIN-NAME."
  (if (string-match "\\..*" domain-name)
      (replace-match "" t nil domain-name)
    domain-name))

(load (expand-file-name (hostname system-name) "~/emacs"))

HTH,
Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute   | and OpenPGP details.

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-20 10:50     ` Peter Dyballa
@ 2006-02-20 12:48       ` Venkatesh Pitta
  0 siblings, 0 replies; 9+ messages in thread
From: Venkatesh Pitta @ 2006-02-20 12:48 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 2/20/06, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
>
> You could create different .emacs-<HOSTNAME> files and then put
> into .emacs:
>
>        (load (format "~/.emacs-%s.el" (getenv "HOST")))
>
well, I will take this one. Thanks for the help.

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-18  7:05 how to edit+compile+debug without leaving GNU/Emacs venk
  2006-02-18 19:36 ` Peter Dyballa
       [not found] ` <mailman.675.1140291391.2856.help-gnu-emacs@gnu.org>
@ 2006-02-20 19:09 ` Colin S. Miller
  2006-02-22  4:41   ` venk
  2 siblings, 1 reply; 9+ messages in thread
From: Colin S. Miller @ 2006-02-20 19:09 UTC (permalink / raw)


venk wrote:
> hello all,
> 
> At my work place, policies say sources are to be edited on one
> machine(say edit.machine.com) and cimpilation is to be done on another
> machine(say build.machine.com) and test run or debug on another machine
> (debug.machine.com).
> 
> I like to know if it is possible to start Emacs on edit.machi.. and
> somehow make M-x compile connect to build.mach..(using ssh. telnet and
> rlogin appears to be closed) and show the build messages on *compile*
> buffer. Also, similarly, make M-x gdb (through ssh) run the binary on
> debug.mac...
> 
> If anybody knows how to do this or is already doing something like
> this, please let me know how to do it.
> 
If there's a shared directory that each machine can access,
and they are mounted on the same point on each machine, then

1) run emacs on edit.example.com
2) to build, use
M-x compile RET
ssh build.example.com "cd /remote-home/venk/src/ ; make -k"

3) to debug, use gdbserver.
This means that gdb runs on edit.example.com,
but it controls a debugger on debug.example.com

You then log into debug.example.com and run
gdbserver :9999 /remote-home/venk/build/myprog
This starts gdbserver, and it listens on port 9999

Then in gdb, enter
target remote debug:9999
sym /remote-home/venk/build/myprog

which will connect gdbserver and start debugging.
The port 9999 is arbitrary, you can use any port
that is free.

The sym(bol) function will tell gdb where
the symbol-information is located.

Unfortunately, the 'run' command doesn't work,
use 'continue' to start the debug. To restart the
debug, kill and restart gdbserver.






You said that "ssh appears to be closed", how do you normally
access the build-host?


HTH,
Colin S. Miller

-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-20 11:30     ` N. Raghavendra
@ 2006-02-22  4:35       ` venk
  0 siblings, 0 replies; 9+ messages in thread
From: venk @ 2006-02-22  4:35 UTC (permalink / raw)



N. Raghavendra wrote:
>
> One way is to create one init file named after each host, e.g.,
> `edit.el', `build.el', and `debug.el', say in the directory
> $HOME/emacs.  Then, use $HOME/.emacs as a wrapper which loads the
> relevant init file.  So, `.emacs' would just contain the forms
> 
thanks, i will stash it for now.

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

* Re: how to edit+compile+debug without leaving GNU/Emacs
  2006-02-20 19:09 ` Colin S. Miller
@ 2006-02-22  4:41   ` venk
  0 siblings, 0 replies; 9+ messages in thread
From: venk @ 2006-02-22  4:41 UTC (permalink / raw)



Colin S. Miller wrote:
> If there's a shared directory that each machine can access,
> and they are mounted on the same point on each machine, then
>
all directories are mounted on the same point across these machines.

> 1) run emacs on edit.example.com
> 2) to build, use
> M-x compile RET
> ssh build.example.com "cd /remote-home/venk/src/ ; make -k"
>
> 3) to debug, use gdbserver.
> This means that gdb runs on edit.example.com,
> but it controls a debugger on debug.example.com
>
> You then log into debug.example.com and run
> gdbserver :9999 /remote-home/venk/build/myprog
> This starts gdbserver, and it listens on port 9999
>
> Then in gdb, enter
> target remote debug:9999
> sym /remote-home/venk/build/myprog
>
> which will connect gdbserver and start debugging.
> The port 9999 is arbitrary, you can use any port
> that is free.
>
wow! i never thought this way.. Thank you

> You said that "ssh appears to be closed", how do you normally
> access the build-host?
>
did I? it should have been because of my poor English(it happens to be
the third language I speak). I meant ssh is open and telnet and rlogin
appears to be closed. So, ssh is the way i access these machines.

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

end of thread, other threads:[~2006-02-22  4:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-18  7:05 how to edit+compile+debug without leaving GNU/Emacs venk
2006-02-18 19:36 ` Peter Dyballa
     [not found] ` <mailman.675.1140291391.2856.help-gnu-emacs@gnu.org>
2006-02-20  8:28   ` venk
2006-02-20 10:50     ` Peter Dyballa
2006-02-20 12:48       ` Venkatesh Pitta
2006-02-20 11:30     ` N. Raghavendra
2006-02-22  4:35       ` venk
2006-02-20 19:09 ` Colin S. Miller
2006-02-22  4:41   ` venk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).