[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 041821a 22/60: * yasnippet-tests.el (string-suffix-p): Def
From: |
João Távora |
Subject: |
[elpa] master 041821a 22/60: * yasnippet-tests.el (string-suffix-p): Define for older Emacsen. |
Date: |
Thu, 21 Jan 2016 22:35:55 +0000 |
branch: master
commit 041821a21018271189948a6c77cb532017324a3e
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
* yasnippet-tests.el (string-suffix-p): Define for older Emacsen.
---
yasnippet-tests.el | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index a59cdf7..fbf79f8 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -836,6 +836,17 @@ add the snippets associated with the given mode."
;; FIXME: Why provide this default definition here?!?
(defalias 'special-mode 'fundamental))
+(unless (fboundp 'string-suffix-p)
+ ;; introduced in Emacs 24.4
+ (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
+attention to case differences."
+ (let ((start-pos (- (length string) (length suffix))))
+ (and (>= start-pos 0)
+ (eq t (compare-strings suffix nil nil
+ string start-pos nil ignore-case))))))
+
;;; btw to test this in emacs22 mac osx:
;;; curl -L -O
https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert.el
;;; curl -L -O
https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert-x.el
- [elpa] master 7bce1a6 12/60: Add new function yas-lookup-snippet, (continued)
- [elpa] master 7bce1a6 12/60: Add new function yas-lookup-snippet, João Távora, 2016/01/21
- [elpa] master e8934ce 13/60: Merge pull request #596 from npostavs/lookup-snippet, João Távora, 2016/01/21
- [elpa] master 0ada0fc 15/60: Add documentation for snippet compilation, João Távora, 2016/01/21
- [elpa] master 4bd3d98 16/60: Merge pull request #599 from zmwangx/snippet-compilation-doc, João Távora, 2016/01/21
- [elpa] master 2f6cfef 17/60: Closes #601: updated snippets submodule, João Távora, 2016/01/21
- [elpa] master 68b0ab6 20/60: Accept documented snippet list formats, João Távora, 2016/01/21
- [elpa] master cc1c758 18/60: Reorganize snippet construction from list code, João Távora, 2016/01/21
- [elpa] master 01139a2 23/60: * yasnippet.el (yas--define-snippets-2): Use file-name-NONdirectory., João Távora, 2016/01/21
- [elpa] master 8df6a6e 25/60: Fix invalid yas-key-syntaxes element warning, João Távora, 2016/01/21
- [elpa] master 7703a55 24/60: * doc/snippet-organization.org (.yas-skip): Add info., João Távora, 2016/01/21
- [elpa] master 041821a 22/60: * yasnippet-tests.el (string-suffix-p): Define for older Emacsen.,
João Távora <=
- [elpa] master fb6ec67 29/60: Fix #619; find parents for extra-modes too, João Távora, 2016/01/21
- [elpa] master 710ea4d 26/60: Update snippets module, João Távora, 2016/01/21
- [elpa] master 215ad9b 19/60: Fix #597; use SAVE-FILE to visit compiled snippets, João Távora, 2016/01/21
- [elpa] master e3f03ca 21/60: Test visiting compiled snippets, João Távora, 2016/01/21
- [elpa] master e56aa6f 28/60: Build a single `explored' list., João Távora, 2016/01/21
- [elpa] master b6d924c 31/60: * yasnippet.el (yas--scan-sexps): Use ignore-errors., João Távora, 2016/01/21
- [elpa] master 00b84ce 27/60: Add (failing) yas--modes-to-activate test, João Távora, 2016/01/21
- [elpa] master 72c6c4c 32/60: Fix #618; save match data in yas--scan-sexps, João Távora, 2016/01/21
- [elpa] master ac3fe83 30/60: Merge pull request #621 from npostavs/dfs-extra-modes2, João Távora, 2016/01/21
- [elpa] master b8687bb 35/60: Avoid double snippet loading messages, João Távora, 2016/01/21