              (delete-region beg end)
              (insert completion)))))
 
-(defun better-pdb-breakpoints ()
+(defun better-pdb ()
   (gud-def gud-break  "break %d/%f:%l"  "\C-b" "Set breakpoint at current line.")
   (gud-def gud-remove "clear %d/%f:%l"  "\C-d" "Remove breakpoint at current line")
+  (compilation-shell-minor-mode t)
+  (local-set-key (kbd "<tab>") 'ipython-complete)
+  (setq overlay-arrow-string "")
   )
-(add-hook 'pdb-mode-hook 'better-pdb-breakpoints)
+(add-hook 'pdb-mode-hook 'better-pdb)
+(defvar gud-overlay
+  (let* ((ov (make-overlay (point-min) (point-min))))
+    (overlay-put ov 'face 'secondary-selection)
+    ov)
+  "Overlay variable for GUD highlighting.")
+(defadvice gud-display-line (after my-gud-highlight act)
+  "Highlight current line."
+  (let* ((ov gud-overlay)
+         (bf (gud-find-file true-file)))
+    (save-excursion
+      (set-buffer bf)
+      (move-overlay ov (line-beginning-position) (line-beginning-position 2)
+                    (current-buffer)))))
+(defun gud-kill-buffer ()
+  (if (eq major-mode 'gud-mode)
+      (delete-overlay gud-overlay)))
+(add-hook 'kill-buffer-hook 'gud-kill-buffer)
 ;; (defun ipython-shell-hook ()
 ;;       ;; the following is to synchronize dir-changes
 ;;       (make-local-variable 'shell-dirstack)

(defun flymake-get-tex-args (file-name)
(list "pdflatex"
(list "-file-line-error" "-interaction=nonstopmode" file-name)))
 
(add-hook 'LaTeX-mode-hook 'flymake-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)

;;       (setq shell-dirtrackp t)
;;       (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)

;;       (define-key python-shell-map [tab] 'ipython-complete)
;;       ;; Add this so that tab-completion works both in X11 frames and inside
;;       ;; terminals (such as when emacs is called with -nw).
