Skip to content

Commit

Permalink
Change minimum Emacs version
Browse files Browse the repository at this point in the history
  • Loading branch information
federicotdn committed Aug 25, 2023
1 parent db122b8 commit e1e551f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
strategy:
matrix:
emacs_version:
- '25.3'
- '26.3'
- '27.1'
- '29.1'
- snapshot
os:
- ubuntu-latest
Expand All @@ -31,11 +31,9 @@ jobs:
with:
python-version: '3.10.6'
- name: Setup checks
if: "!startsWith(matrix.emacs_version, '25')"
run: 'make setup-check'
- name: Run checks
run: 'make check'
if: "!startsWith(matrix.emacs_version, '25')"
- name: Setup unit testing
run: 'make setup-tests'
- name: Run ERT unit tests
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ test/server.pid
# autoloads
verb-autoloads.el

# Emacs 25 binary
# Emacs binary
/emacs
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Changed default binding of `verb-send-request-on-point-no-window` to <kbd>C-c C-r C-<return></kbd>.
- Allow using single- or multi-line lambda expressions for `Verb-Map-Request`.
- The `verb-auto-kill-response-buffers` customizable variable can now be set to an integer. This will cause all response buffers to be killed when a request is sent, except the N most recent ones.
- Dropped support for Emacs 25. Emacs 26.3 is now the minimum supported version. Verb may still work partially or completely on Emacs 25, but this may change without prior warning.

## **2.15.0** - 2021-11-03 (MELPA Stable)
- Fixed font locking on indented Babel source blocks.
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

The package introduces a new minor mode, **Verb mode**, which works as an extension to [Org mode](https://orgmode.org/). The core idea is to organize specifications for HTTP requests using Org's tree structure. Properties defined in the child headings extend or sometimes override properties defined in the parent headings - this way, it is easy to define many HTTP request specifications without having to repeat common components as URL hosts, authentication headers, ports, etc. Verb tries to combine the usefulness of Org mode with the common functionality provided by other HTTP clients. However, very little knowledge of Org mode is needed to use Verb.

Verb requires at least Emacs version 25 to work.
Verb requires at least Emacs version 26 to work.

[![CI Status](https://github.com/federicotdn/verb/workflows/CI/badge.svg)](https://github.com/federicotdn/verb/actions)
[![MELPA](https://melpa.org/packages/verb-badge.svg)](https://melpa.org/#/verb)
Expand Down Expand Up @@ -75,7 +75,7 @@ Verb requires at least Emacs version 25 to work.
- [License](#license)

## Installation
### Emacs 25+
### Emacs 26+

You can install Verb by using the `package-install` command (make sure either [MELPA](https://melpa.org/) or [MELPA Stable](https://stable.melpa.org/) are included in your package sources):

Expand Down Expand Up @@ -878,7 +878,6 @@ Verb's functionality can be extended via some related packages, such as:
- Verb uses a tree-like structure to organize request specifications, `restclient` uses a flat one.
- Verb displays HTTP response headers on a separate buffer, `restclient` includes them commented out in the main response buffer.
- Verb correctly handles URLs such as https://api.ipify.org?format=json (400 when using `restclient`, 200 when using Verb and `curl`).
- Verb has only been tested on Emacs 25+, `restclient` was tested on those and older versions as well (which is important if you're using an older Emacs version).
- In Verb, lines starting with `#` can be included in a request body (and `*` as well).
- Licensing (GPLv3 vs. Public domain).
- [walkman](https://github.com/abrochard/walkman): Write HTTP requests in Org mode and send them using `curl`.
Expand Down
2 changes: 1 addition & 1 deletion ob-verb.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; Homepage: https://github.com/federicotdn/verb
;; Keywords: tools
;; Package-Version: 2.15.0
;; Package-Requires: ((emacs "25.1"))
;; Package-Requires: ((emacs "26.3"))

;; This file is NOT part of GNU Emacs.

Expand Down
28 changes: 16 additions & 12 deletions verb.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; Homepage: https://github.com/federicotdn/verb
;; Keywords: tools
;; Package-Version: 2.15.0
;; Package-Requires: ((emacs "25.1"))
;; Package-Requires: ((emacs "26.3"))

;; This file is NOT part of GNU Emacs.

Expand Down Expand Up @@ -861,6 +861,7 @@ Does not use property inheritance. Matching is case-insensitive."
(org-buffer-property-keys)
'())
;; 2) Get the value for each of those properties and return an alist
;; Note: this will respect the value of `org-use-property-inheritance'
(mapcar (lambda (key) (cons key (org-entry-get (point) key 'selective))))
;; 3) Discard all (key . nil) elements in the list
(seq-filter #'cdr)))
Expand Down Expand Up @@ -966,6 +967,18 @@ CLASS must be an EIEIO class."
(condition-case _err (read form)
(end-of-file (user-error "`%s' is a malformed expression" form))))

(defun verb--request-spec-metadata-get (rs key)
"Get the metadata value under KEY for request spec RS.
If no value is found under KEY, return nil. KEY must not
have the prefix `verb--metadata-prefix' included.
If the value associated with KEY is the empty string, return
nil."
(thread-first
(concat verb--metadata-prefix key)
(assoc-string (oref rs metadata) t)
cdr
verb--nonempty-string))

(defun verb--request-spec-post-process (rs)
"Validate and prepare request spec RS to be used.
Expand All @@ -981,11 +994,7 @@ After that, return RS."
(verb-request-spec :headers verb-base-headers)
rs)))
;; Apply the request mapping function, if present
(when-let ((form (thread-first
(concat verb--metadata-prefix "map-request")
(assoc-string (oref rs metadata) t)
cdr
verb--nonempty-string))
(when-let ((form (verb--request-spec-metadata-get rs "map-request"))
(fn (verb--try-read-fn-form form)))
(if (functionp fn)
(setq rs (funcall fn rs))
Expand Down Expand Up @@ -1588,12 +1597,7 @@ CONTENT-TYPE must be the value returned by `verb--headers-content-type'."
"Store RESPONSE depending on its request metadata.
See `verb--stored-responses' for more details."
(when-let ((req (oref response request))
(metadata (oref req metadata))
(val (thread-first
(concat verb--metadata-prefix "store")
(assoc-string metadata t)
cdr
verb--nonempty-string)))
(val (verb--request-spec-metadata-get req "store")))
(setq verb--stored-responses (cl-delete val verb--stored-responses
:key #'car
:test #'equal))
Expand Down

0 comments on commit e1e551f

Please sign in to comment.