[PATCH] Fix confusing and incorrect docstring for regexp-opt

Aidan Kehoe kehoea at parhasard.net
Mon Jan 7 07:33:42 EST 2008


Yes, my version is a bit long-winded. I think it’s clearer than the old
version, though; in a strict sense the old version was incorrect, too,
because every string that doesn’t use regexp special characters is a regexp.

2008-01-07  Aidan Kehoe  <kehoea at parhasard.net>

	* regexp-opt.el (regexp-opt): 
	Clarify the treatment of regexp special characters in STRINGS.

XEmacs Packages source patch:
Diff command:   cvs -q diff -u
Files affected: xemacs-packages/xemacs-base/regexp-opt.el
===================================================================
RCS

Index: xemacs-packages/xemacs-base/regexp-opt.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/regexp-opt.el,v
retrieving revision 1.3
diff -u -r1.3 regexp-opt.el
--- xemacs-packages/xemacs-base/regexp-opt.el	2003/10/29 16:31:46	1.3
+++ xemacs-packages/xemacs-base/regexp-opt.el	2008/01/07 12:27:44
@@ -94,8 +94,12 @@
 ;;;###autoload
 (defun regexp-opt (strings &optional paren)
   "Return a regexp to match a string in STRINGS.
-Each string should be unique in STRINGS and should not contain any regexps,
-quoted or not.  If optional PAREN is non-nil, ensure that the returned regexp
+Each string should be unique in STRINGS.  Regexp special characters in the
+elements of STRINGS will not be treated as special characters; that is to
+say, `regexp-opt' will call `regexp-quote' on the elements of STRINGS before
+constructing the regexp.
+
+If optional PAREN is non-nil, ensure that the returned regexp
 is enclosed by at least one regexp grouping construct.
 The returned regexp is typically more efficient than the equivalent regexp:
 

-- 
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?



More information about the XEmacs-Patches mailing list