README.org (2547B)
1 #+title: plumb.el -- interactively choose what to do with a URL 2 #+author: Jamie Beardslee 3 #+email: jdb@jamzattack.xyz 4 5 This packages provides a convenient way to act on a URL in the way of 6 your choosing. 7 8 * Installation 9 10 ** package.el 11 12 1. Download plumb.el 13 2. =M-x package-install-file RET path/to/plumb.el= 14 15 ** straight.el 16 17 Use the following recipe: 18 19 #+begin_src emacs-lisp 20 (plumb :type git 21 :flavor melpa 22 :repo "https://git.jamzattack.xyz/plumb") 23 #+end_src 24 25 ** Manual installation 26 27 1. Download plumb.el 28 2. Put it in =load-path= 29 3. Update autoloads 30 4. (optionally) byte-compile it 31 32 * How is the URL selected? 33 34 The URL is selected from the following, in order: 35 36 - bug-reference link at point 37 - shr link at point 38 - URL at point 39 - Org link at point (only in org-mode) 40 - read from minibuffer 41 42 * What actions are there? 43 44 The main entry point =plumb= prompts you to choose from one of the 45 following actions: 46 47 - Save to register 48 - eww 49 - external browser 50 - View as image 51 - View as pdf 52 - Download and open 53 - Stream 54 - Download video 55 - Download audio 56 57 ** Other entry points 58 59 The following functions are autoloaded, so you can use them in a 60 keybinding (for example, in =eww-mode-map=): 61 62 | =plumb= | Select action from a list | 63 | =plumb-stream= | Stream video or audio | 64 | =plumb-download-video= | Download video | 65 | =plumb-audio= | Download audio | 66 67 * License 68 69 GPL3+ 70 71 * COMMENT Improvement plans [2/5] 72 73 ** DONE Handle org links 74 75 Oddly, there isn't a simple ~org-link-at-point~ function. I need to 76 figure out how all the org regexps should be used. 77 78 ** DONE Use ~defcustom~ 79 80 I don't really use =customize=, but I think it's good practice to 81 allow it where possible. 82 83 ** TODO Use an alist for functions instead of pcase 84 85 See [[https://git.jamzattack.xyz/lilypond-auto-insert][lilypond-auto-insert]] for a possible way to do this. 86 87 Create an alist of =(FUNCTION . DESCRIPTION)=, and use assoc/rassoc 88 and apply. This would require all functions to take the same 89 arguments (currently not an issue, but may hinder further expansion). 90 91 ** TODO Make order of link choice customizable 92 93 Example: A shr link has a url as the text, and a different url as the 94 link. One should be able to choose which is used. 95 96 This could be done with a list of functions, using mapcar or. 97 98 ** TODO Use prefix arg for ~plumb~ 99 100 There are a couple of ways to do this: 101 102 - Pass the arg to the selected function. This would work well with 103 the alist approach. 104 - Prefix arg prompts for URL instead of selecting automatically.