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

    ("Partition Exported Functions"  erl-wrangler-code-inspector-partition-exports)
    ("gen_fsm State Data to Record" erl-refactor-gen-fsm-to-record)
    nil
    ("Skeletons"
      (("gen_refac Skeleton"  tempo-template-gen-refac)
       ("Include wrangler.hrl"    tempo-template-include-wrangler)
       ))
    ("Apply Adhoc Refactoring"  apply-adhoc-refac)
    ("Apply Composite Refactoring" apply-composite-refac)
    nil
    ("Undo" erl-refactor-undo)
    nil
    ("Customize Wrangler" wrangler-customize)
    nil 
    ("Version" erl-refactor-version)))


(defvar inspector-menu-items
  '(nil
    ("Instances of a Variable" erl-wrangler-code-inspector-var-instances) 
      ("Calls to a Function" erl-wrangler-code-inspector-caller-funs)
      ("Dependencies of a Module" erl-wrangler-code-inspector-caller-called-mods)
      ("Nested If Expressions" erl-wrangler-code-inspector-nested-ifs)
      ("Nested Case Expressions" erl-wrangler-code-inspector-nested-cases)
      ("Nested Receive Expression" erl-wrangler-code-inspector-nested-receives)
      ("Long Functions" erl-wrangler-code-inspector-long-funs)
      ("Large Modules" erl-wrangler-code-inspector-large-mods)
      ("Generate Function Callgraph" erl-wrangler-code-inspector-callgraph)
      ("Generate Module Graph" erl-wrangler-code-inspector-module-graph)
      ("Cyclic Module Dependency" erl-wrangler-code-inspector-cyclic-graph)
      ("Module Dependency via Only Internal Functions" erl-wrangler-code-inspector-improper-module-dependency)
      ;;("Component Extraction Suggestion" erl-wrangler-code-component-extraction)
      ("Show Non Tail Recursive Servers" erl-wrangler-code-inspector-non-tail-recursive-servers)
      ("Incomplete Receive Patterns" erl-wrangler-code-inspector-no-flush)
      nil
      ("Apply Adhoc Code Inspection" apply-my-code-inspection)))


(global-set-key (kbd "C-c C-r") 'toggle-erlang-refactor)

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

(defvar refactor-menu-items
  '(("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)
