Advertisement
Guest User

Untitled

a guest
May 30th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. (defcustom rsync-command "rsync"
  2. "")
  3.  
  4. (defcustom rsync-command-options "-ar"
  5. "")
  6.  
  7. (defcustom authorized-key nil
  8. "")
  9.  
  10.  
  11. (defun rsync-to-server(server)
  12. (if (not (stringp server))
  13. nil
  14. (let* ((local-dir (directory-file-name (expand-file-name ".")))
  15. (options
  16. (format "%s %s"
  17. (if authorized-key
  18. (concat "-i " authorized-key)
  19. ""
  20. )
  21. rsync-command-options
  22. ))
  23. (command
  24. (format "%s %s %s %s"
  25. rsync-command
  26. options
  27. local-dir
  28. server)
  29. )
  30. )
  31. ;; (shell-command (format "%s &" command))
  32. (message "%s" command)
  33. )
  34. )
  35. )
  36.  
  37. (setq rsync-server-uris
  38. '(("no server" . '())
  39. ("server1" . "/path/to/server")
  40. ("server2" . "/path/to/server2")))
  41.  
  42. (setq helm-rsync-server-uri-sources
  43. `((name . "Helm for repos on Emacs")
  44. (candidates . ,rsync-server-uris)
  45. (action . rsync-to-server)))
  46.  
  47. (defun helm-rsync-server ()
  48. (interactive)
  49. (helm :sources '(helm-rsync-server-uri-sources))
  50. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement