From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Bug: Infinite loop when escape replace string contains escape sequence it replaces [6.35trans] Date: Sat, 8 May 2010 07:21:35 +0200 Message-ID: <2E8CCCFE-DFCF-47D2-8FF5-2EE6E9FAF062@gmail.com> References: <8739y3aed3.wl%dmaus@ictsoc.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAcTv-0005LZ-45 for emacs-orgmode@gnu.org; Sat, 08 May 2010 01:21:43 -0400 Received: from [140.186.70.92] (port=37797 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAcTs-0005LH-JJ for emacs-orgmode@gnu.org; Sat, 08 May 2010 01:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAcTr-0008Lx-Ci for emacs-orgmode@gnu.org; Sat, 08 May 2010 01:21:40 -0400 Received: from ey-out-1920.google.com ([74.125.78.147]:27239) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAcTr-0008Lq-6N for emacs-orgmode@gnu.org; Sat, 08 May 2010 01:21:39 -0400 Received: by ey-out-1920.google.com with SMTP id 13so180394eye.34 for ; Fri, 07 May 2010 22:21:38 -0700 (PDT) In-Reply-To: <8739y3aed3.wl%dmaus@ictsoc.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: David Maus Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On May 7, 2010, at 6:03 PM, David Maus wrote: > > Remember to cover the basics, that is, what you expected to happen and > what in fact did happen. You don't know how to make a good report? > See > > http://orgmode.org/manual/Feedback.html#Feedback > > Your bug report will be posted to the Org-mode mailing list. > ------------------------------------------------------------------------ > > Org enters an infinite loop when `org-replace-escapes' is called with > a table containing a replace string that contains the escape sequence > it should be replaced with. > > Example: > ,---- > | (org-replace-escapes "%m" '(("%m" . "87zl0qq1f3.wl%maus.david@gmail.com > "))) > `---- > > I stumpled upon when I tried to store a link to a internet message > whose message id contained the sequence "%m" (perfectly valid for a > message id) while using "%m" as message description. > > Attached patch fixes this by > > 1. detecting such 'self reference' and replacing the offending > sequence in the replace string by a string with a text property > that contains the original sequence > > 2. replacing occurences of substrings with this text property by the > original sequence. > > HTH > -- David > > Emacs : GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.2) > of 2009-11-02 on raven, modified by Debian > Package: Org-mode version 6.35trans > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de > repl.diff>_______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten