note
stefp
<!-- Node text goes above. Div tags should contain sig only -->
I am afraid not. emacs shines and sucks in the same way perl5
does. Does the job. Too old, too much history.<p/>
But it is not so daunting.
Here is a quick 101 to use emacs for debugging and light editing.<p/>
Until recently, I think that emacs did not include
the last version of cperl.
This resulted in haphazard hightlighting.
Once a perl file is loaded, one can check the cperl version by typing <code>C-h v cperl-version</code>.
It must be the same that the most recent file in
http://www.cpan.org/modules/by-module/CPAN/ILYAZ/cperl-mode.
Currently it is 7.32.
If one is root he can adds it to his site specific directory A common place is /usr/share/emacs/site-lisp.
Other wise he can add it to a personal elisp directory and he will load it by adding <code>(load-file "elisp/cperl.el")</code>
in in <code>.emacs</code> file<p>
Perl debugging is part of the grand unified debugger scheme gud.el written by
the inevitable esr. This is used to debug with gdb too.
In my system the file is at /usr/share/emacs/21.3/lisp/gud.el where
one can find the perl specific stuff by grepping "perldb".<p>
You run a session with the command<br>
<pre>
M-x perldb RET your_filename
</pre>
You get two buffers in your frame. One is the file currently
debugged. The other is the debugging session where you get to use all
the commands described in the <code>perldebug</code> pod file.
So that's known territory. <p>
You can also interact directly in the perl file buffer thanks to
gud-minor-mode. A minor mode adds
functionalities to the major mode by adding key-bindings.<p>
You can get all the bindings of the said buffer using <code>C-h C-b</code>.
I paste the binding concerning the gud minor mode.
Using the minor binding of the perl file avoid to clutter the debug window
by explicit commands.<p>
<pre>
C-x SPC gud-break
C-x C-a C-p gud-print
C-x C-a C-r gud-cont
C-x C-a C-n gud-next
C-x C-a C-s gud-step
C-x C-a C-d gud-remove
C-x C-a C-b gud-break
C-x C-a C-l gud-refresh
</pre>
One can scroll a buffer using the mouse.<p>
Here is a list of minimal keybindings for people that want to use emacs for
debbugging and minor edition while wanting to go mouseless.<p>
<pre>
C-x o allows to cycle the caret thru all the buffers
C-x b list all the buffer in the meacs session.
In that buffer ENTER selects a file
C-x w write the current file
C-x q toggle the read-only mode. Because so many binding do
something it can be a good stopping gap.
^H i gets to the info files
</pre>
Here is a chart for moving in progressively coarser granularity
from the current position.<br>
In the vertical axis : char, word, begin/end of line<br>
In the horizontal axis : line, begin/end of subroutine<br>
<pre>
^
|
C-M-a
|
C-p
C-a <--- M-b <-- C-b <-- . --> C-f --> M-f --> C-e
|
C-n
|
C-M-e
|
v
</pre>
<code>M-x woman</code> is nicer the <code>M-x man</code> but slower to start :)<br>
...because it compiles the list of man files to provide completion.
<div class="pmsig"><div class="pmsig-31579">
<p> -- <a href="/index.pl?node=stefp&lastnode_id=1072">
stefp</a> <br>
</div></div>
441686
442550