 
 (defun erlang-refactor-on()
   (interactive)
+  (message "starting Wrangler...")
   (if   (get-buffer "*Wrangler-Erl-Shell*")
       (erlang-refactor-off-1)
     t)

(add-hook 'ediff-quit-hook 'my-ediff-qh)

(defvar refactor-menu-items
  '(nil
    ("Rename Variable Name" erl-refactor-rename-var)
    ("Rename Function Name" erl-refactor-rename-fun)
    ("Rename Module Name" erl-refactor-rename-mod)
    ("Generalise Function Definition" erl-refactor-generalisation)

  (define-key erlang-mode-map "\C-c\C-wfm"  'erl-refactor-fold-against-macro)
  (define-key erlang-mode-map "\C-c\C-ws"  'erl-refactor-similar-expression-search)
  (define-key erlang-mode-map "\C-c\C-wcb"  'erl-refactor-inc-sim-code-detection-in-buffer)
  (define-key erlang-mode-map "\C-c\C-wcd"  'erl-refactor-inc-sim-code-detection-in-dirs)
  (erlang-menu-install "Wrangler" wrangler-menu-items erlang-mode-map t)
  )

(defun wrangler-menu-remove()
  "Remove Wrangler menus."
  (define-key erlang-mode-map "\C-c\C-w\C-_"  nil)
  (define-key erlang-mode-map  "\C-c\C-w\C-b" nil)
  (define-key erlang-mode-map "\C-c\C-w\C-e"  nil)
  (cond (erlang-xemacs-p
         (erlang-menu-uninstall '("Wrangler") wrangler-menu-items erlang-mode-map t))
        (t
         (erlang-menu-uninstall "Wrangler" wrangler-menu-items erlang-mode-map t))
        ))

(defun erlang-menu-uninstall (name items keymap &optional popup)
  "UnInstall a menu in Emacs or XEmacs based on an abstract description."
