wandbox.el
is Wandbox client tool.
README : Japanese / English
Wandbox is online compilation service. Developed by @melponn and @kikairoya.
You can try various programming language such as C, C++, D, Haskell, Perl, Python, Ruby, PHP, Erlang, Java, JavaScript, CoffeeScript Rust, Common Lisp, and more.
- Install wandbox.el into your
load-path
directory. orM-x package-install wandbox
if Emacs 24+. - and put
(require 'wandbox)
into your.emacs
.
;; .emacs sample
(require 'wandbox)
(global-set-key (kbd "C-c w w") 'wandbox)
(global-set-key (kbd "C-c w e") 'wandbox-eval-last-sexp)
(global-set-key (kbd "C-c w i") 'wandbox-insert-template)
(global-set-key (kbd "C-c w l") 'wandbox-list-compilers)
;; prefer Clang to GCC
(custom-set-variables
'(wandbox-user-profiles
'((:lang "C" :compiler "clang-head-c" :ext "c")
(:lang "C++" :compiler "clang-head" :ext "cc")
(:lang "C++" :compiler "clang-head" :ext "cpp"))))
- Open some program source
- Type
M-x wandbox
to compile this buffer - The result are display to "Wandbox Output" buffer
for more details, see following reference.
wandbox
- Alias ofwandbox-compile-buffer
wandbox-compile-file (filename)
- Compile with file contentswandbox-compile-region (from to)
- Compile marked regionwandbox-compile-buffer ()
- Compile with current bufferwandbox-list-compilers ()
- Display available compilerswandbox-insert-template (name)
- Insert template snippetwandbox-select-server (name)
- Switch to selected NAME wandbox server
-
wandbox
- Alias ofwandbox-compile
-
wandbox-compile (&rest profile &key compiler options code stdin compiler-option runtime-option lang name file save)
Run wandbox compile with detailed options. arguments
compiler
,options
,code
,compiler-option
,runtime-option
,save
is based on wandbox API. -
wandbox-add-server (name location)
- Register wandbox server the name asname
wandbox-profiles
- List of wandbox compiler options.wandbox-precompiled-hook
- Hook run before post wandbox. Return value will be merged into the old profile.wandbox-default-server
- Wandbox server name to use by default. (default "melpon")
;; Compile code with compiler name and options
(wandbox :compiler "gcc-head" :options "warning" :code "main(){}")
;; Compile as C source code (use wandbox-profiles)
(wandbox :lang "C" :code "main(){}")
;; Compile local file, and generate permalink
(wandbox :lang "C" :file "/path/to/prog.c" :save t)
;; Use standard-input
(wandbox :lang "Perl" :code "while (<>) { print uc($_); }" :stdin "hello")
;; Multiple compile
(wandbox :profiles [(:name "php HEAD") (:name "php")] :code "<? echo phpversion();")
;; Add user-profile
(add-to-list 'wandbox-profiles '(:name "ANSI C" :compiler "clang-head" :options "warning,c89"))
(wandbox :name "ANSI C" :file "/path/to/prog.c")
;; Compile gist snippet
;; sample: https://gist.github.com/219882
(wandbox :name "CLISP" :gist 219882 :stdin "Uryyb Jbeyq!")
;; Compile any url file (add :url keyword)
(defun* wandbox-option-url (&key url &allow-other-keys)
(if url (plist-put nil :code (wandbox-fetch url))))
(add-to-list 'wandbox-precompiled-hook #'wandbox-option-url)
(wandbox :lang "C" :url "http://localhost/prog.c")
;; Use other server
(wandbox-add-server "fetus" "https://wandbox.fetus.jp")
(wandbox :code "<?php echo phpversion();"
:profiles [(:name "HHVM") (:name "HippyVM") (:name "PHP")]
:server-name "fetus")
;; switch default server
;; or M-x wandbox-select-server fetus
(setq wandbox-default-server-name "fetus")
The compiler list information available in Wandbox is saved as a cache at the time of byte-compile.
If you want to use latest compilers, recompile wandbox.el
and
restart Emacs.
This software is licensed under the MIT-License.