emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog subr.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog subr.el
Date: Wed, 25 Nov 2009 03:59:24 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/11/25 03:59:23

Modified files:
        lisp           : ChangeLog subr.el 

Log message:
        (string-prefix-p): New function.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16725&r2=1.16726
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/subr.el?cvsroot=emacs&r1=1.666&r2=1.667

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16725
retrieving revision 1.16726
diff -u -b -r1.16725 -r1.16726
--- ChangeLog   25 Nov 2009 03:51:00 -0000      1.16725
+++ ChangeLog   25 Nov 2009 03:59:19 -0000      1.16726
@@ -1,5 +1,7 @@
 2009-11-25  Stefan Monnier  <address@hidden>
 
+       * subr.el (string-prefix-p): New function.
+
        * man.el (Man-completion-cache): New var.
        (Man-completion-table): Use it.
 

Index: subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.666
retrieving revision 1.667
diff -u -b -r1.666 -r1.667
--- subr.el     11 Nov 2009 06:36:44 -0000      1.666
+++ subr.el     25 Nov 2009 03:59:23 -0000      1.667
@@ -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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]