diff options
Diffstat (limited to 'lisp/org/org-compat.el')
-rw-r--r-- | lisp/org/org-compat.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index da544a567d8..085e32d6774 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -39,7 +39,7 @@ (declare-function org-calendar-goto-agenda "org-agenda" ()) (declare-function org-align-tags "org" (&optional all)) (declare-function org-at-heading-p "org" (&optional ignored)) -(declare-function org-at-table.el-p "org" ()) +(declare-function org-at-table.el-p "org-table" ()) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-context "org-element" (&optional element)) (declare-function org-element-lineage "org-element" (blob &optional types with-self)) @@ -204,8 +204,7 @@ extension beyond end of line was not controllable." (defsubst file-attribute-modification-time (attributes) "The modification time in ATTRIBUTES returned by `file-attributes'. This is the time of the last change to the file's contents, and -is a list of integers (HIGH LOW USEC PSEC) in the same style -as (current-time)." +is a Lisp timestamp in the same style as `current-time'." (nth 5 attributes))) (unless (fboundp 'file-attribute-size) @@ -244,7 +243,7 @@ This is a floating point number if the size is too large for an integer." (if (fboundp 'string-collate-lessp) (defalias 'org-string-collate-lessp 'string-collate-lessp) - (defun org-string-collate-lessp (s1 s2 &rest _) + (defun org-string-collate-lessp (s1 s2 &optional _ _) "Return non-nil if STRING1 is less than STRING2 in lexicographic order. Case is significant." (string< s1 s2))) @@ -935,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) @@ -1126,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) |