This repository has been archived on 2021-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
emacs-upload/README.org

44 lines
1.0 KiB
Org Mode
Raw Normal View History

2020-02-15 13:13:49 -05:00
#+TITLE: emacs-upload.el
Upload regions, buffers, and files to various hosts.
* Dependencies
** System
2020-02-15 13:17:32 -05:00
- ~cURL~
2020-02-15 13:13:49 -05:00
** Emacs
2020-02-15 13:16:59 -05:00
- ~cl~
- ~json~
2020-02-15 13:13:49 -05:00
* Usage
Place emacs-upload.el in ~load-path~ and load the package:
2020-02-15 13:36:04 -05:00
#+BEGIN_SRC: emacs-lisp
2020-02-15 13:13:49 -05:00
(require 'emacs-upload)
2020-02-15 13:33:22 -05:00
#+END_SRC
2020-02-15 13:13:49 -05:00
Optionally, bind the interactive function ~emacs-upload~ to some key:
2020-02-15 13:33:22 -05:00
#+BEGIN_SRC: emacs-lisp
2020-02-15 13:13:49 -05:00
(global-set-key (kbd "C-c e") 'emacs-upload)
2020-02-15 13:33:22 -05:00
#+END_SRC
2020-02-15 13:13:49 -05:00
Optionally, set the host upon emacs init:
2020-02-15 13:33:22 -05:00
#+BEGIN_SRC: emacs-lisp
2020-02-15 13:13:49 -05:00
(emacs-upload/set-host "ix")
2020-02-15 13:33:22 -05:00
#+END_SRC
2020-02-15 13:13:49 -05:00
~emacs-upload/set-host~ is also an interactive command, so you can
change your host on the fly.
Alternatively, do all three with ~use-package~:
2020-02-15 13:36:04 -05:00
#+BEGIN_SRC
(use-package emacs-upload
:demand t
:bind
("C-c e" . emacs-upload)
:config
(emacs-upload/set-host "ix"))
#+END_SRC
2020-02-15 13:13:49 -05:00
To upload the region, simply select the region and call
emacs-upload. To upload the whole buffer, have no region selected
and call emacs-upload. For a file, use the universal argument ~C-u~
before calling emacs-upload.