From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: [PATCH] Emacs 22 support Date: Tue, 01 Jun 2010 23:03:06 -0400 Message-ID: <87mxvem905.fsf@gollum.intra.norang.ca> References: <1275433846-10077-1-git-send-email-bernt@norang.ca> <87hblmfhe5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=49643 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJeEf-0006i1-UQ for emacs-orgmode@gnu.org; Tue, 01 Jun 2010 23:03:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJeEe-00054V-GZ for emacs-orgmode@gnu.org; Tue, 01 Jun 2010 23:03:17 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:63681) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJeEe-00054L-Eu for emacs-orgmode@gnu.org; Tue, 01 Jun 2010 23:03:16 -0400 In-Reply-To: <87hblmfhe5.fsf@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Wed\, 02 Jun 2010 01\:43\:46 +0200") 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: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Cc: emacs-orgmode@gnu.org =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > Bernt Hansen writes: > >> * contrib/lisp/org-special-blocks.el: Emacs 22 doesn't have string-match= -p >> --- >> This patch is available at git://git.norang.ca/org-mode.git emacs22 >> >> contrib/lisp/org-special-blocks.el | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/contrib/lisp/org-special-blocks.el >> b/contrib/lisp/org-special-blocks.el >> index af50b30..4a2bc3c 100644 >> --- a/contrib/lisp/org-special-blocks.el >> +++ b/contrib/lisp/org-special-blocks.el >> @@ -51,7 +51,7 @@ seen. This is run after a few special cases are taken = care >> of." >> (when (or htmlp latexp) >> (goto-char (point-min)) >> (while (re-search-forward "^#\\+\\(begin\\|end\\)_\\(.*\\)$" nil t) >> - (unless (string-match-p org-special-blocks-ignore-regexp (match-string= 2)) >> + (unless (string-match org-special-blocks-ignore-regexp (match-string 2= )) >> (replace-match >> (if (equal (downcase (match-string 1)) "begin") >> (concat "ORG-" (match-string 2) "-START") > > I didn't look at the code, but I doubt this is correct. The whole point > of using `string-match-p' is to not affect the match data, so I would > expect this change to possibly break the immediately following > (match-string 1) etc. (depending on the exact regexp of course -- as I > say I didn't actually check it, but in any case this is not a safe > change AFAIK). You could try wrapping the `string-match' form inside > `save-match-data' to prevent that. Thanks for the review. I was just emulating what Carsten did in a similar fix in git commit 8dd4baf without much thought of side effects. I used this change to test a recent post about using org-special-blocks. I don't normally use org-special-blocks in my setup and this change made it work for me for the simple test case on the mailing list. I'll try to post a better patch for this tomorrow. Regards, Bernt