~louis77/sourcehut.el

Emacs package to interact with sourcehut services
2 months ago
2 months ago

#Table of Contents

  1. Introduction
    1. Basic setup
    2. Contributions
    3. License

#Introduction

sourcehut.el is an Emacs package that provides commands to interact with Sourcehut service. At the moment the only command is "sourcehut-paste-region" which pastes the active region or the whole buffer (if no region is active) to the paste service.

#Basic setup

To use these commands, you have to create a personal access token on your Sourcehut instance or sr.ht and customize the variable "sourcehut-personal-access-token". You can use the Easy Customization feature and look for the group "sourcehut" or the command will ask you for your token the first time you use it. The token will be stored in your custom config.

Or you can add the following line in your Emacs config:

(setq sourcehut-personal-access-token "abcdefghijkl12345")

To paste something to Sourcehut, mark the text and press M-x sourcehut-paste-region. If you do not mark any text, the whole buffer will be pasted.

The command will ask you for the visibility and the filename and provides sensible defaults.

After the paste was executed successfully, the URL of the paste will be in your clipboard (kill-ring).

#Contributions

Any contribution is greatly appreciated. Drop me an email or find me on Freenode #sr.ht.

#License

Code released under the GPL-3 license.