 
 ) ;; end eval-when (compile load eval)
 
-
-(defvar wandbox-response-keywords
-  '(
-    ;;"compiler_output"
-    ;;"compiler_error"
-    "compiler_message"
-    ;;"program_output"
-    ;;"program_error"
-    "program_message"
-    "status"
-    "signal"
-    ;;"permlink"
-    "url"
-    )
-  "Wandbox compile api response keywords.")
-
-(defvar wandbox-profiles nil
-  "User-defined copmiler settings.")
-
-(defvar wandbox-precompiled-hook nil
-  "Hook run before post wandbox.
-Return value will be merged into the old profile.")
-
-(defvar wandbox-permalink-action #'browse-url
-  "Specify function to execute when you run `wandbox-compile' with permalink option (:save).")
-
-(defvar wandbox-output-buffer "*Wandbox Output*"
-  "Output result buffer name.")
-
 (defvar wandbox-servers
   (list
    (eval-when-compile
      (wandbox-create-server "melpon" "http://melpon.org/wandbox")))
   "Available wandbox server list.")
 
-(defvar wandbox-default-server-name "melpon"
-  "Wandbox server name to use by default.")
+(defcustom wandbox-default-server-name "melpon"
+  "Wandbox server name to use by default."
+  :group 'wandbox
+  :type  'string)
 
 (cl-defun wandbox-find-server (name &key (if-does-not-exist :skip))
   (or (cl-find name wandbox-servers :key #'wandbox-server-name :test #'string=)

;;; wandbox.el --- Wandbox API Library for Emacs

;; Copyright (C) 2013-2016 KOBAYASHI Shigeru

;; Author: KOBAYASHI Shigeru (kosh) <shigeru.kb@gmail.com>
;; URL: https://github.com/kosh04/emacs-wandbox
;; Version: 0.6.0
;; Package-Requires: ((emacs "24") (request "0.2.0") (s "1.10.0"))
;; Keywords: c, programming, tools
;; Created: 2013/11/22
;; License: MIT License (see LICENSE)


                           (server-name wandbox-default-server-name)
                           &allow-other-keys
                           &aux (server (wandbox-find-server server-name :if-does-not-exist :error)))
  "Compile CODE as COMPILER's program code on Wandbox.

URL `http://melpon.org/wandbox' is online compiler service
for multi programming language (C/C++, Python, PHP, Common Lisp, etc).

Options:

* LANG is language name. (e.g. \"Ruby\")
* NAME is select compiler template from `wandbox-profiles' or default compiler settings.
* FILE is file contents instead of CODE.
* SYNC is synchronous mode. (debug)
* SERVER-NAME is server name. (default `wandbox-default-server-name')

List of available server values, see `wandbox-list-compilers'."
  (if (<= 1 (length profiles))
      (wandbox-post* server profile profiles)
      (wandbox-post server profile :sync sync :callback #'request-response-data)))
