Created
December 14, 2011 07:31
-
-
Save nibrahim/1475626 to your computer and use it in GitHub Desktop.
Creating pdb breaks in a python file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun nkv/stop-here (pos) | |
(interactive "d") | |
(let ( | |
(trace-command "import pdb; pdb.set_trace()") | |
) | |
(save-excursion | |
(save-restriction | |
(widen) | |
(goto-char (point-min)) | |
(search-forward trace-command nil t) | |
(beginning-of-line) | |
(kill-line 1))) | |
(beginning-of-line) | |
(insert (concat trace-command "\n")) | |
(forward-line -1) | |
(indent-for-tab-command))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment