From cb190d7d5f3a63086e3f28981ca175945305a3c0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 25 Nov 2009 03:59:19 +0000 Subject: [PATCH] (string-prefix-p): New function. --- lisp/ChangeLog | 2 ++ lisp/subr.el | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0125c85b73..d02dbadd9ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2009-11-25 Stefan Monnier + * subr.el (string-prefix-p): New function. + * man.el (Man-completion-cache): New var. (Man-completion-table): Use it. diff --git a/lisp/subr.el b/lisp/subr.el index 2bc4c6b2bd2..9cbf4ab9ffc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3193,6 +3193,13 @@ and replace a sub-expression, e.g. (setq matches (cons (substring string start l) matches)) ; leftover (apply #'concat (nreverse matches))))) +(defun string-prefix-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." + (eq t (compare-strings str1 nil nil + str2 0 (length str1) ignore-case))) + ;;;; invisibility specs (defun add-to-invisibility-spec (element) -- 2.39.5