 ;;       (setq shell-dirtrackp t)
 ;;       (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
 
-;;       (ansi-color-for-comint-mode-on)
 ;;       (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).

(set-variable 'virtualenv-root-dir "/home/alex/v/")
(defun workon-postactivate (virtualenv)
  (require 'virtualenv)
  (virtualenv-activate-environment virtualenv))

(require 'pymacs)
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport t)

(add-to-list 'load-path "~/.emacs.d/auto-complete-1.3")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete-1.3/dict")
(ac-config-default)
(global-auto-complete-mode 1)

(setq python-check-command "pyflakes")

; ;; Varnish conf support
; (autoload 'vcl-mode "vcl-mode" "Edit Varnish VCL files" t)
; (add-to-list 'auto-mode-alist '("\\.vcl$" . vcl-mode))

             (delete-region beg end)
             (insert completion)))))

(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)
(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)
