# HG changeset patch # User Stefan Monnier # Date 1259121559 0 # Node ID f44541b1d13c5379d3cbc09785ba529685cbfdc6 # Parent 7b0de5c2aa2a2761ed4c572916af4ed8b4c1ca9f (string-prefix-p): New function. diff -r 7b0de5c2aa2a -r f44541b1d13c lisp/ChangeLog --- a/lisp/ChangeLog Wed Nov 25 03:51:00 2009 +0000 +++ b/lisp/ChangeLog Wed Nov 25 03:59:19 2009 +0000 @@ -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 -r 7b0de5c2aa2a -r f44541b1d13c lisp/subr.el --- a/lisp/subr.el Wed Nov 25 03:51:00 2009 +0000 +++ b/lisp/subr.el Wed Nov 25 03:59:19 2009 +0000 @@ -3193,6 +3193,13 @@ (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)