From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: canonical way to go beginning of a link Date: Mon, 04 Jul 2016 14:38:50 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK8lw-00022e-8B for emacs-orgmode@gnu.org; Mon, 04 Jul 2016 14:39:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK8lr-0005oT-9T for emacs-orgmode@gnu.org; Mon, 04 Jul 2016 14:39:07 -0400 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]:34205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK8lr-0005oB-5i for emacs-orgmode@gnu.org; Mon, 04 Jul 2016 14:39:03 -0400 Received: by mail-qk0-x22c.google.com with SMTP id t127so271691447qkf.1 for ; Mon, 04 Jul 2016 11:39:03 -0700 (PDT) Received: from Johns-MacBook-Air.local (c-67-171-67-30.hsd1.pa.comcast.net. [67.171.67.30]) by smtp.gmail.com with ESMTPSA id q126sm1945121qkf.48.2016.07.04.11.38.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 11:38:59 -0700 (PDT) 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" Is there a canonical way to jump to the beginning of a link in org-mode, i.e. the first char? I usually do something this like: (goto-char (org-element-property :begin (org-element-context))) 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? -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu