summaryrefslogtreecommitdiff
path: root/lisp/org/org-compat.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-compat.el')
-rw-r--r--lisp/org/org-compat.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 3e394fbab1c..085e32d6774 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -113,6 +113,11 @@ the symbol of the calling function, for example."
;;; Emacs < 27.1 compatibility
+(if (version< emacs-version "27.1")
+ (defsubst org-replace-buffer-contents (source &optional _max-secs _max-costs)
+ (replace-buffer-contents source))
+ (defalias 'org-replace-buffer-contents #'replace-buffer-contents))
+
(unless (fboundp 'proper-list-p)
;; `proper-list-p' was added in Emacs 27.1. The function below is
;; taken from Emacs subr.el 200195e824b^.
@@ -929,6 +934,14 @@ Implements `define-error' for older emacsen."
(put name 'error-conditions
(copy-sequence (cons name (get 'error 'error-conditions))))))
+(unless (fboundp 'string-equal-ignore-case)
+ ;; From Emacs subr.el.
+ (defun string-equal-ignore-case (string1 string2)
+ "Like `string-equal', but case-insensitive.
+Upper-case and lower-case letters are treated as equal.
+Unibyte strings are converted to multibyte for comparison."
+ (eq t (compare-strings string1 0 nil string2 0 nil t))))
+
(unless (fboundp 'string-suffix-p)
;; From Emacs subr.el.
(defun string-suffix-p (suffix string &optional ignore-case)
@@ -1120,10 +1133,8 @@ ELEMENT is the element at point."
(and log
(let ((drawer (org-element-lineage element '(drawer))))
(and drawer
- (eq (compare-strings
- log nil nil
- (org-element-property :drawer-name drawer) nil nil t)
- t)))))
+ (string-equal-ignore-case
+ log (org-element-property :drawer-name drawer))))))
nil)
(t
(cl-case (org-element-type element)