From a8ed768515e4cf305ba52566f372e096f8ed449a Mon Sep 17 00:00:00 2001 From: TEC Date: Sun, 19 Feb 2023 12:28:31 +0800 Subject: [PATCH 1/6] org-compat: Add ensure-list as org-ensure-list * lisp/org-compat.el (org-ensure-list): Add `ensure-list' from Emacs 28, as `org-ensure-list'. --- lisp/org-compat.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index fadb51df6..e11de3639 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -193,6 +193,18 @@ (defun org-format-prompt (prompt default &rest format-args) default))) ": "))) +(if (fboundp 'ensure-list) + (defalias 'org-ensure-list #'ensure-list) + (defun org-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. + +Compatability substitute for `ensure-list' in Emacs 28." + (if (listp object) + object + (list object)))) + ;;; Emacs < 27.1 compatibility -- 2.39.1