forked from mirrors/org-mode
org-compat: Assume `string-prefix-p' is defined
* lisp/org-compat.el: `string-prefix-p' was introduced in Emacs 24.1, which is below Org minimal expectations. Only define `string-suffix-p' when necessary.
This commit is contained in:
parent
a94493f5a2
commit
adfa7649e5
|
@ -476,15 +476,6 @@ Implements `define-error' for older emacsen."
|
|||
|
||||
(unless (fboundp 'string-suffix-p)
|
||||
;; From Emacs subr.el.
|
||||
(defun string-prefix-p (prefix string &optional ignore-case)
|
||||
"Return non-nil if PREFIX is a prefix of STRING.
|
||||
If IGNORE-CASE is non-nil, the comparison is done without paying attention
|
||||
to case differences."
|
||||
(let ((prefix-length (length prefix)))
|
||||
(if (> prefix-length (length string)) nil
|
||||
(eq t (compare-strings prefix 0 prefix-length string
|
||||
0 prefix-length ignore-case)))))
|
||||
|
||||
(defun string-suffix-p (suffix string &optional ignore-case)
|
||||
"Return non-nil if SUFFIX is a suffix of STRING.
|
||||
If IGNORE-CASE is non-nil, the comparison is done without paying
|
||||
|
|
Loading…
Reference in a new issue