summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-08-26 15:36:49 -0400
committerKyle Meyer <kyle@kyleam.com>2019-01-13 12:43:04 -0500
commitda31714c10f67a0c7250b98eb41a395398e45ddd (patch)
tree1bb028c0efe6adeaf95c7031207eb8fe028113ee
parentede0d19feb9e3ec3a263b4a6c2c3c1dcf713dbc7 (diff)
downloadorg-mode-da31714c10f67a0c7250b98eb41a395398e45ddd.tar.gz
org-compat: Define proper-list-p
* lisp/org-compat.el (proper-list-p): New function for compatibility with Emacsen before 27.1. This is a follow-up to the backport of Emacs's 2fde6275b.
-rw-r--r--lisp/org-compat.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index b47b4cc..3c9321c 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -598,6 +598,15 @@ attention to case differences."
(eq t (compare-strings suffix nil nil
string start-pos nil ignore-case))))))
+(unless (fboundp 'proper-list-p)
+ ;; `proper-list-p' was added in Emacs 27.1. The function below is
+ ;; taken from Emacs subr.el 200195e824b^.
+ (defun proper-list-p (object)
+ "Return OBJECT's length if it is a proper list, nil otherwise.
+A proper list is neither circular nor dotted (i.e., its last cdr
+is nil)."
+ (and (listp object) (ignore-errors (length object)))))
+
;;; Integration with and fixes for other packages