From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Haustedt, Jens" Subject: Re: canonical way to go beginning of a link Date: Wed, 6 Jul 2016 10:49:46 +0000 Message-ID: <6995BEED87293B45975DBA2355E4A902230BD3AB@HL-EX-MBS1.de.eu.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKkOy-0005jm-5O for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 06:49:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKkOu-0002ml-P1 for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 06:49:55 -0400 Received: from mail.euroimmun.de ([62.159.94.122]:60625 helo=mail2.euroimmun.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKkOu-0002mR-I7 for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 06:49:52 -0400 Received: from hl-ex-arch1.de.eu.local ([192.168.10.56]:36828) by mail2.euroimmun.de with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1bKkOp-0006tl-23 for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 12:49:47 +0200 Received: from MailAppDispatcher (localhost.localdomain [127.0.0.1]) by hl-ex-arch1.de.eu.local (Postfix) with ESMTP id 6F6218C10C for ; Wed, 6 Jul 2016 12:49:47 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by hl-ex-arch1.de.eu.local (Postfix) with ESMTP id 44C1F8C106 for ; Wed, 6 Jul 2016 12:49:47 +0200 (CEST) Received: from hl-ex-arch1.de.eu.local ([127.0.0.1]) by localhost (hl-ex-arch1.de.eu.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OuMWwelijuE1 for ; Wed, 6 Jul 2016 12:49:47 +0200 (CEST) Received: from smtp.euroimmun.de (smtp.euroimmun.de [172.16.222.73]) by hl-ex-arch1.de.eu.local (Postfix) with ESMTP for ; Wed, 6 Jul 2016 12:49:47 +0200 (CEST) Received: from HL-EX-ETS1.de.eu.local (hl-ex-ets1.de.eu.local [192.168.10.55]) by smtp.euroimmun.de (Postfix) with ESMTPS id 37E2E80FF0 for ; Wed, 6 Jul 2016 12:49:47 +0200 (CEST) Content-Language: de-DE List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" > but in things like font-lock it seems slow compared to a > regexp. I have not found a reliable regexp approach though. say > I want to search back for "cite:" with point at the ^ position > below: > some text cite:a-key > ^ > If I run (re-search-backward "cite:") at the point above, it does not go = to the point 2 characters back. > Any ideas? Given this setting: some more text cite:a-key some text cite:a-key ^ When you run (re-search-backward "cite:") at the point above, the result is= as follows: some more text cite:a-key some text cite:a-key ^ This is exactly what I expected it to act. In your example above, the whole search pattern could not be found in ist entirety from the indicated point on, so it could not be found at all and point is not moved. Maybe it is a good idea to move point forward for at least count of chars in search pattern before the search executes? Greets, Jens Haustedt