From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62947 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: gnus-replace-in-string: Avoid inf-loop in XEmacs (was: New completion mode) Date: Thu, 20 Apr 2006 15:07:24 +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 1145538737 30419 80.91.229.2 (20 Apr 2006 13:12:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Apr 2006 13:12:17 +0000 (UTC) Original-X-From: ding-owner+m11474@lists.math.uh.edu Thu Apr 20 15:12:15 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 1FWYxD-0001CN-1A for ding-account@gmane.org; Thu, 20 Apr 2006 15:12:15 +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 1FWYx8-0001pw-00; Thu, 20 Apr 2006 08:12:10 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FWYwQ-0001pr-00 for ding@lists.math.uh.edu; Thu, 20 Apr 2006 08:11:26 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1FWYwL-0002oS-81 for ding@lists.math.uh.edu; Thu, 20 Apr 2006 08:11:26 -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 1FWYwK-00018z-00 for ; Thu, 20 Apr 2006 15:11:20 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FWYw3-0000y4-Vs for ding@gnus.org; Thu, 20 Apr 2006 15:11:05 +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 15:11:03 +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 15:11:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 77 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: 'bg&jY[8V'W&:=~6w"|>}#4/T;w~36ei4NNMyKRR.a$n=$|sWFPF1y]a\>6kc\*#GN]UDM| Ywv,vbL^XF1nIp\:F=$Ei2o&mEe:%N~,:3]vtQ~s9u$9izmX$IF@VgGl7/,^dbuM<3|AO2}.%|%?kZ 2Y=@\U!~cll^=8Z9ihKq%wmUe1Ky(#kl3T'>Qk0Ia3mCBsTk?E(,X Mail-Copies-To: nobody User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:BOhR8AxSnhR0yzsa1oHxWikGSC0= X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62947 Archived-At: On Mon, Apr 17 2006, Steve Youngs wrote: [ from ] > * Reiner Steib writes: [...] > > - In `message-put-addresses-in-ecomplete' you should use > > `gnus-replace-in-string' instead of `replace-regexp-in-string' for > > compatibility with XEmacs. > > Only needed for XEmacs 21.4. XEmacs 21.5 and SXEmacs has > `replace-regexp-in-string'. Is it just a wrapper around `replace-in-string' or is it Emacs implementation of `replace-regexp-in-string'? Hm... ,---- | ELISP> emacs-version | "21.5 (beta21) \"corn\" (+CVS-20050720) XEmacs Lucid" | ELISP> (replace-regexp-in-string "/*$" "/" "foo") | "foo/" | ELISP> (replace-in-string "foo" "/*$" "/") | *** Eval error *** Quit during evaluation (inf-loop -> C-g) `---- We should change `gnus-replace-in-string' as follows, I think: --8<---------------cut here---------------start------------->8--- --- gnus-util.el 20 Apr 2006 12:10:00 +0200 6.104.2.24 +++ gnus-util.el 20 Apr 2006 14:52:55 +0200 @@ -61,8 +61,6 @@ (eval-and-compile (cond - ((fboundp 'replace-in-string) - (defalias 'gnus-replace-in-string 'replace-in-string)) ((fboundp 'replace-regexp-in-string) (defun gnus-replace-in-string (string regexp newtext &optional literal) "Replace all matches for REGEXP with NEWTEXT in STRING. @@ -71,6 +69,8 @@ This is a compatibility function for different Emacsen." (replace-regexp-in-string regexp newtext string nil literal))) + ((fboundp 'replace-in-string) + (defalias 'gnus-replace-in-string 'replace-in-string)) (t (defun gnus-replace-in-string (string regexp newtext &optional literal) "Replace all matches for REGEXP with NEWTEXT in STRING. --8<---------------cut here---------------end--------------->8--- On Thu, Apr 20 2006, Steve Youngs wrote: > * Katsumi Yamaoka writes: [...] > > The regexp used in `message-put-addresses-in-ecomplete' causes > > an infloop in XEmacs. The test case is: > > > (gnus-replace-in-string "yamaoka@jpl.org" "^ +\\| *$" "") > > > It might be due to an XEmacs bug. It's a bug in XEmacs, see . > > Though it seems to be solved by replacing the regexp with "^ > > +\\| +$". > > This fixed the problem I was seeing in SXEmacs too. Does shifting down "((fboundp 'replace-in-string) ...)" solve this problem too? Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/