From d10daef008ffdc010116a4958f6a91394306f77a Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Sat, 21 Dec 2024 18:48:27 +0100 Subject: [PATCH] Add verb-url --- CHANGELOG.md | 2 +- README.md | 1 + verb.el | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3353f49..e2802e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ New features / improvements: - URLs can now span multiple lines, place '\\' at the end of the URL line to continue it in the next one. Leading whitespace in the additional lines will be skipped. - Added new function `verb-body-lf-to-crlf` designed for use with requests sending multipart data. - Added new `Verb-Prelude` heading property, which can be used to specify an Emacs Lisp or JSON file to load variables from, before performing requests. -- Added `verb-shell` and `verb-unix-epoch` utility functions. +- Added `verb-shell`, `verb-url` and `verb-unix-epoch` utility functions. - Allow using Org [hyperlinks](https://orgmode.org/guide/Hyperlinks.html) in URLs, for example: `get [[http://example.com][my example]]`. ## **2.16.0** - 2024-03-02 (MELPA Stable) diff --git a/README.md b/README.md index 5bfe66d..f5fc837 100644 --- a/README.md +++ b/README.md @@ -389,6 +389,7 @@ Note that the point must be surrounded by the code tag delimiters (e.g. `{{` and Verb offers some utility functions to be used within code tags, such as: - `verb-shell`: Currently, just an alias to `shell-command-to-string`. +- `verb-url`: Currently, just an alias to `url-encode-url`. - `verb-unix-epoch`: Returns the current UNIX epoch (seconds) as an integer. - `verb-json-get`: Retrieves a value from within a JSON value. - `verb-read-file`: Reads the contents of a file (following some additional Verb-specific behaviour). diff --git a/verb.el b/verb.el index cb45e4c..2f7ea4a 100644 --- a/verb.el +++ b/verb.el @@ -721,6 +721,9 @@ an error." (defalias 'verb-shell #'shell-command-to-string "Alias to `shell-command-to-string'.") +(defalias 'verb-url #'url-encode-url + "Alias to `url-encode-url'.") + (defun verb-unix-epoch () "Return the current time as an integer number of seconds since the epoch." (floor (time-to-seconds)))