From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62951 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-replace-in-string: Avoid inf-loop in XEmacs Date: Thu, 20 Apr 2006 19:06:26 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: References: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145553024 20181 80.91.229.2 (20 Apr 2006 17:10:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Apr 2006 17:10:24 +0000 (UTC) Original-X-From: ding-owner+m11478@lists.math.uh.edu Thu Apr 20 19:10:22 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FWcfE-0007gu-1X for ding-account@gmane.org; Thu, 20 Apr 2006 19:09:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FWcf7-0002L4-00; Thu, 20 Apr 2006 12:09:49 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FWccY-0002Kz-00 for ding@lists.math.uh.edu; Thu, 20 Apr 2006 12:07:10 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FWccT-0000vj-PM for ding@lists.math.uh.edu; Thu, 20 Apr 2006 12:07:10 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FWccS-0003wz-00 for ; Thu, 20 Apr 2006 19:07:04 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FWccH-00077Z-ES for ding@gnus.org; Thu, 20 Apr 2006 19:06:53 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Apr 2006 19:06:53 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Apr 2006 19:06:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 46 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: P05mdcZT&lL[-s2=mw~RsllZ0zZAb?vdE}.s On Thu, Apr 20 2006, Steve Youngs wrote: > * Reiner Steib writes: > > Is it just a wrapper around `replace-in-string' or is it Emacs > > implementation of `replace-regexp-in-string'? Hm... > > This is from SXEmacs (which I ripped from XE 21.5)... > > > (defun replace-regexp-in-string (regexp rep string &optional > fixedcase literal subexp start) > "Replace all matches for REGEXP with REP in STRING. The code is the same as in current Emacs CVS. Some corrections in the doc string and comments have been made in the meantime. [...] > > We should change `gnus-replace-in-string' as follows, I think: > > --- gnus-util.el 20 Apr 2006 12:10:00 +0200 6.104.2.24 > > +++ gnus-util.el 20 Apr 2006 14:52:55 +0200 > > I wondered why this wouldn't apply for me, until I realised it was a > much older version of gnus-util.el that I had. Is it from the v5-10 > branch? Yes, 6.104.2.24 is the v5-10 branch. > > Does shifting down "((fboundp 'replace-in-string) ...)" solve this > > problem too? > > Yes. I've committed the change (v5-10 and trunk). Feel free to adjust the version info on SXEmacs when necessary: ;; Prefer `replace-regexp-in-string' (present in Emacs, XEmacs 21.5, ;; SXEmacs 22.1.4) over `replace-in-string'. The later leads to inf-loops ;; on empty matches: ;; (replace-in-string "foo" "/*$" "/") ;; (replace-in-string "xe" "\\(x\\)?" "") Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/