purcell/emacs.d — Issue #7: got error (void-function string-prefix-p) at emacs 23.1 on centos 6.0
Author: redguardtoo
Created: 2011-12-01 09:10:30+00:00
State: open

Installing emacs 23.3 on centos 6.0 is troublesome, I tried.

Here is the patch,
'''
commit ad2c6a95c3281c0e74bd2c5fba3e459053723de3
Author: chen bin
Date: Thu Dec 1 13:20:46 2011 +0800

add missing internal api for emacs 23.1

diff --git a/init.el b/init.el
index 2feabb8..f54c5c6 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"))

'''