   )
 
 (defcustom org-wiki-server-host "0.0.0.0"
-  "Default address that the server listens."
+  "Default address that the server listens to."
   :type  'string
   :group 'org-wiki
+  )
+
+
+(defcustom org-wiki-clip-jar-path "~/bin/Clip.jar"
+  "Path to Clip.jar utility to paste images from clipboard."
+  :type 'file
+  :group 'org-wiki 
   )
 
 


(defun org-wiki-asset-download-insert2 ()
  "Download a file from a URL in the clibpoard and inserts a link file:<page>/<asset-file>.
Note: This function is synchronous and blocks Emacs. If Emacs is frozen type C-g 
to cancel the download."
  (interactive)
  (org-wiki--asset-download-hof

                (message "Server stopped.")))))



(defun org-wiki-paste-image ()  
  "Paste a image asking the user for the file name."
  (interactive)
  (insert "#+CAPTION: ")
  (save-excursion
    (insert "\n")
    (let* ((dir   (file-name-as-directory
                   (file-name-base
                    (buffer-file-name))))
           (file (read-file-name "Image: " dir)))
      (insert
       (shell-command-to-string
         (mapconcat #'identity
                    `("java"
                      "-jar"
                      ;;,(expand-file-name "~/bin/Clip.jar")
                      ,(expand-file-name  org-wiki-clip-jar-path)
                      "-file"
                      ,(file-relative-name file default-directory)
                      )
                    " "
                    ))))))

(defun org-wiki-paste-image-uuid ()
  "Paste a image with automatic generated name (uuid)."
  (interactive)
  (insert "#+CAPTION: ")
  (save-excursion
    (insert "\n")
    (insert
     (shell-command-to-string
      (mapconcat #'identity
                 `("java"
                   "-jar"
                   ;;,(expand-file-name "~/bin/Clip.jar")
                   ,(expand-file-name  org-wiki-clip-jar-path)
                   "-uuid"
                   ,(format "\"%s\"" (file-name-base (buffer-file-name))))
                 " "
                 )))))


(provide 'org-wiki)
;;; org-wiki.el ends here
