From ad2c6a95c3281c0e74bd2c5fba3e459053723de3 Mon Sep 17 00:00:00 2001 From: chen bin Date: Thu, 1 Dec 2011 13:20:46 +0800 Subject: [PATCH] add missing internal api for emacs 23.1 --- init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.el b/init.el index 2feabb8170..f54c5c6597 100644 --- a/init.el +++ b/init.el @@ -1,3 +1,13 @@ +;make .emacs.d support emacs 23.1 and above + +;only emacs 23.3 and above has string-prefix-p defined +(if (not (fboundp 'string-prefix-p) ) + (defun string-prefix-p (shorter longer) + (let ((n (mismatch shorter longer)) + (l (length shorter))) + (if (or (not n) (= n l)) l nil))) + ) + ;; -*- coding: utf-8 -*- (add-to-list 'load-path (expand-file-name "~/.emacs.d"))