Sunday, November 14, 2004

Python program debugging in Emacs

Today I tried to debug my python programs:
C-c C-c was not working from python-mode to execute the programs.
I found a solution from here:
http://www.techietalk.org/emacs_python-mode_questions_C-c_C-c_and_broken_docstring_fill-6007726-1282-a.html
--------------------------------------------------------------------------------------------------------------------------------------------------
;; TBD: a horrible hack, but why create new Custom variables?
(let ((cmd (concat (if (eq shell (quote cpython))
                                                  "python"
                                                 "jython")
                            (if (string-equal py-which-bufname "JPython")
 " -" ""))))
--------------------------------------------------------------------------------------------------------------------------------------------------

And I put this macro to my .emacs file (for jumping to exceptions),
But to jump to last exception just press C-x b OR C-x 4 b
(fset 'goto-exception
"\C-a\C-s\"\C-@\C-s\"\C-[OD\367\C-x4f\C-a\C-y\C-k\C-m\C-xo\C-sline\C-@\C-s,\C-[OD\367\C-xo\370got\C-il\C-i\C-m\C-y\C-m")
(global-set-key "\C-x\C-g" 'goto-exception)