From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: problem with elisp Date: Wed, 08 Oct 2008 22:33:50 +0200 Message-ID: References: <87od1u7w3z.fsf@poczta.po.opole.pl> <8763o2onu6.fsf@poczta.po.opole.pl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223498109 23464 80.91.229.12 (8 Oct 2008 20:35:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 20:35:09 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Seweryn Kokot Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 08 22:36:04 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Knfkv-000792-VF for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 22:35:38 +0200 Original-Received: from localhost ([127.0.0.1]:57545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Knfjs-0006VU-5q for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 16:34:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnfjH-0006K9-Jo for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 16:33:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnfjG-0006JZ-4V for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 16:33:55 -0400 Original-Received: from [199.232.76.173] (port=45227 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnfjF-0006JT-S0 for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 16:33:53 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:39352) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KnfjF-0003iU-OZ for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 16:33:53 -0400 Original-Received: from thursday (BAH4242.bah.pppool.de [77.135.66.66]) by dd18200.kasserver.com (Postfix) with ESMTP id 70C7E18027C23; Wed, 8 Oct 2008 22:33:57 +0200 (CEST) In-Reply-To: <8763o2onu6.fsf@poczta.po.opole.pl> (Seweryn Kokot's message of "Wed\, 08 Oct 2008 22\:04\:33 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58570 Archived-At: Seweryn Kokot wrote: > string-temp is changed to 5816MHs and in the end, the last 3 lines do > nothing. > > Any idea how to solve the problem? You can search for words only: (re-search-forward (concat "\\b" (regexp-quote string-b) "\\b")) Or you can give up the temp string and search for both at once like this: (re-search-forward (concat "\\(" (regexp-quote string-a) "\\)\\|\\(" (regexp-quote string-a) "\\)")) and then replace based on which one was found: (if (match-beginning 1) (replace-match string-b) (replace-match string-a)) regards, Nikolaj Schumacher