Skip to content

Instantly share code, notes, and snippets.

@nibrahim
Created December 14, 2011 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nibrahim/1475626 to your computer and use it in GitHub Desktop.
Save nibrahim/1475626 to your computer and use it in GitHub Desktop.
Creating pdb breaks in a python file
(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