From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: analog of org-element-at-point for objects? Date: Sun, 9 Mar 2014 21:31:32 -0400 Message-ID: References: <871tyaj12y.fsf@tanger.home> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b111dd9402e5504f43690ba Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMp43-0003pW-Ic for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 21:31:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMp41-0008V7-Q1 for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 21:31:35 -0400 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:47063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMp41-0008V3-Iy for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 21:31:33 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so6598379pab.10 for ; Sun, 09 Mar 2014 18:31:32 -0700 (PDT) In-Reply-To: <871tyaj12y.fsf@tanger.home> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Daimrod Cc: "emacs-orgmode@gnu.org" --047d7b111dd9402e5504f43690ba Content-Type: text/plain; charset=ISO-8859-1 Thanks! That does seem to do what I want. John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Sun, Mar 9, 2014 at 9:26 PM, Daimrod wrote: > John Kitchin writes: > Hi John, > > > Is there an easy way to to get the object at point? I found > > org-element-at-point, but what I need is to determine if point is on a > > link of a particular type, and links appear to be objects rather than > > elements. > > I think that `org-element-context' is what you're looking for. > > > an alternative solution for me would be how do you move point to the > > beginning of a link (if it is on a link)? I found org-next-link and > > org-previous-link, but neither of these move you to the beginning of > > the current link. Then, I could use org-element-link-parser, but that > > only works with point at the beginning of a link. > > > > The reason I was looking into this is here: > http://kitchingroup.cheme.cmu.edu/blog/2014/03/07/Storing-label-links-in-org-mode/ > > > > It just seems there must be a better way than I implemented. thanks! > > Best, > > -- > Daimrod/Greg > > --047d7b111dd9402e5504f43690ba Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks! That does seem to do what I want.

John

--------------------= ---------------
John Kitchin
Associate Professor
Doherty Hall A207= F
Department of Chemical Engineering
Carnegie Mellon University
Pittsbu= rgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Sun, Mar 9, 2014 at 9:26 PM, Daimrod = <daimrod@gmail.com> wrote:
John Kitchin <jkitchin@andrew= .cmu.edu> writes:
Hi John,

> Is there an easy way to to get the object at point? I found
> org-element-at-point, but what I need is to determine if point is on a=
> link of a particular type, and links appear to be objects rather than<= br> > elements.

I think that `org-element-context' is what you're looking for= .

> an alternative solution for me would be how do you move point to the > beginning of a link (if it is on a link)? I found org-next-link and > org-previous-link, but neither of these move you to the beginning of > the current link. Then, I could use org-element-link-parser, but that<= br> > only works with point at the beginning of a link.
>
> The reason I was looking into this is here: http://kitchingroup.cheme.cmu.edu/blog/2014/03/07/Storing-label= -links-in-org-mode/
>
> It just seems there must be a better way than I implemented. thanks!
Best,

--
Daimrod/Greg


--047d7b111dd9402e5504f43690ba--