Skip to content

Commit

Permalink
Add a compat defination for ensure-list for emacs before version 28.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
cranej committed Dec 5, 2024
1 parent 9249f7f commit 570f44a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zk.el
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@ Adds zk-id as an Embark target, and adds `zk-id-map' and
(listp list)
(null (cdr list))))

(when (version< emacs-version "28.1")
(defun ensure-list (object)
"Return OBJECT as a list.
If OBJECT is already a list, return OBJECT itself. If it's
not a list, return a one-element list containing OBJECT."
(if (listp object)
object
(list object))))

(defun zk-file-name-regexp ()
"Return the correct regexp matching zk file names.
The regexp captures these groups:
Expand Down

3 comments on commit 570f44a

@localauthor
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can bump the emacs version requirement to 28.1. Would be simpler.

@cranej
Copy link
Contributor Author

@cranej cranej commented on 570f44a Dec 5, 2024 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@localauthor
Copy link
Owner

@localauthor localauthor commented on 570f44a Dec 5, 2024 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.