From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: analog of org-element-at-point for objects? Date: Sun, 9 Mar 2014 20:25:48 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b2e43e62dda1304f435a5b8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMo2S-0008Ja-Hc for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 20:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMo2Q-00085b-CP for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 20:25:52 -0400 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]:51962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMo2Q-00085U-3h for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 20:25:50 -0400 Received: by mail-pd0-f176.google.com with SMTP id r10so6310399pdi.21 for ; Sun, 09 Mar 2014 17:25:48 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --047d7b2e43e62dda1304f435a5b8 Content-Type: text/plain; charset=ISO-8859-1 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. 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! 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 --047d7b2e43e62dda1304f435a5b8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Is there an easy way to to get the object a= t point? I found org-element-at-point, but what I need is to determine if p= oint is on a link of a particular type, and links appear to be objects rath= er than elements.

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 curre= nt link. Then, I could use org-element-link-parser, but that only works wit= h point at the beginning of a link.

The reason I was looking into this is here: h= ttp://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. than= ks!


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.e= du

--047d7b2e43e62dda1304f435a5b8-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: Re: analog of org-element-at-point for objects? Date: Mon, 10 Mar 2014 10:26:29 +0900 Message-ID: <871tyaj12y.fsf@tanger.home> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMozG-0002cD-8S for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 21:26:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMozF-0007OD-50 for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 21:26:38 -0400 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]:36492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMozE-0007O9-Te for emacs-orgmode@gnu.org; Sun, 09 Mar 2014 21:26:37 -0400 Received: by mail-pb0-f47.google.com with SMTP id up15so6571487pbc.20 for ; Sun, 09 Mar 2014 18:26:35 -0700 (PDT) In-Reply-To: (John Kitchin's message of "Sun, 9 Mar 2014 20:25:48 -0400") 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: emacs-orgmode@gnu.org 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 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--