From cd9fe0a19a5fd5426f21bcc44313afbb56df9f32 Mon Sep 17 00:00:00 2001 From: John Turner Date: Sun, 10 Mar 2024 16:26:13 -0400 Subject: Squashed 'lisp/wgetpaste/' content from commit 1113a01 git-subtree-dir: lisp/wgetpaste git-subtree-split: 1113a017828dbcacb635f337a20298c72989dacd --- README.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 README.org (limited to 'README.org') diff --git a/README.org b/README.org new file mode 100644 index 0000000..7c84957 --- /dev/null +++ b/README.org @@ -0,0 +1,20 @@ +* wgetpaste.el +A small Emacs library to use wgetpaste from inside of Emacs. + +* basic use +Just run the interactive ~wgetpaste~ command in the minibuffer or via keybinding in a buffer of choice, with or without a region selected. The paste's URL will copied to the kill-ring and/or system clipboard if the upload is successful. A minibuffer notification will appear when the upload is ready! + +* customization hooks +Wgetpaste.el hooks can allow you to customize the behaviour of wgetpaste based on the state of your buffer. + +Here is an example to set the syntax highlighting to "Python" on files that have the "py" file extension. + +#+BEGIN_SRC emacs-lisp + (add-hook 'wgetpaste-before-upload-hook (lambda () + (if-let* ((file-name (buffer-file-name)) + (string= (file-name-extension file-name) "py")) + (setq-local wgetpaste-args '("--language" "Python")))) + nil t) +#+END_SRC + +Only some wgetpaste services support syntax highlighting, and some services have different names for the various syntax highlighting modes. -- cgit v1.2.3