diff options
author | Pierre Courtieu <courtieu@lri.fr> | 2014-12-24 00:57:13 +0000 |
---|---|---|
committer | Pierre Courtieu <courtieu@lri.fr> | 2014-12-24 00:57:13 +0000 |
commit | 5d93450f3556da77dbc70812884a6be207bbfbca (patch) | |
tree | 3f07ee3f3d0ab5dd9747a5cbe7d6d39ab842ff9b /coq/coq-smie.el | |
parent | af9a7086bb182405bc3e738a28d5483afe7d40fb (diff) |
fixed the use of >= 24.4 function string-suffix-p.
Diffstat (limited to 'coq/coq-smie.el')
-rw-r--r-- | coq/coq-smie.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/coq/coq-smie.el b/coq/coq-smie.el index 7c93f392..fcc2ff83 100644 --- a/coq/coq-smie.el +++ b/coq/coq-smie.el @@ -30,6 +30,21 @@ (require 'coq-indent) (require 'smie nil 'noerror) +(defun coq-string-suffix-p (str1 str2 &optional ignore-case) + "Return non-nil if STR1 is a prefix of STR2. +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences." + (let ((begin2 (- (length str2) (length str1))) + (end2 (length str2))) + (when (< begin2 0) (setq begin2 0)) ; to avoid negative begin2 + (eq t (compare-strings str1 nil nil str2 begin2 end2 ignore-case)))) + +;; Replacement for emacs < 24.4, borrowed from sindikat at +;; stackoverflow efficient if bytecompiled, builtin version is +;; probably better when it exists +(unless (fboundp 'string-suffix-p) + (fset 'string-suffix-p 'coq-string-suffix-p)) + ;; As any user defined notation ending with "." will break ;; proofgeneral synchronization anyway, let us consider that any ;; combination of symbols ending with "." is an end of command for |