emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: org-context at the beginning of a link
Date: Fri, 21 Nov 2014 08:31:51 -0800	[thread overview]
Message-ID: <m2h9xsjz0o.fsf@polytechnique.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 398 bytes --]

Hello,

I'm using a function that relies on `org-element-link-parser'. According
to the documentation, the point needs to be at the element of the link
for it to work. I wrote a small function that takes me to the beginning
of a link, but it fails when the point is already at the beginning of
the link. Here is a reproducible recipe showing the problem.

Open this attached tiny org file: 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: link.org --]
[-- Type: text/x-org, Size: 36 bytes --]

Start

[[file:link.org][link]]

End

[-- Attachment #1.3: Type: text/plain, Size: 385 bytes --]


Put the point on the 'i' of "link", for instance by (goto-char 26).

Look up the context: (org-context). I get ((:link 8 31))

Go to the beginning of the link: (goto-char 8)

Look up the context: (org-context). I get ((:link nil 31))

Is there a reason why the context is different at the beginning of the
link?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

             reply	other threads:[~2014-11-21 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 16:31 Alan Schmitt [this message]
2014-11-21 22:37 ` org-context at the beginning of a link Nicolas Goaziou
2014-11-22 15:23   ` Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2h9xsjz0o.fsf@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).