emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Link to named block


From: Daimrod
Subject: Re: [O] Link to named block
Date: Mon, 20 Oct 2014 19:51:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Bastien <address@hidden> writes:

> Hi Greg,

Hi Bastien,

> Daimrod <address@hidden> writes:
>
>> I've made a small function to link to a named block in org files.
>>
>> #+BEGIN_SRC emacs-lisp
>> (defun dmd--org-link-to-named-block ()
>>   "Create an org-link to the named block at point.
>>
>> Blocks are named with #+NAME."
>>   (when (eq major-mode 'org-mode)
>>     (let* ((el (org-element-at-point))
>>            (name (org-element-property :name el)))
>>       (when name
>>         (org-store-link-props
>>          :link name)))))
>> #+END_SRC
>>
>> Do you think it should be added to org? I find it useful to add a link
>> to a figure when I'm exporting to latex.
>
> I'm not sure how to use the function above -- how do you set the link
> itself, not just its properties?

I don't. The link name is enough because named block usually have "nice"
name. For example, given the following named block:

#+NAME: fig:my-fig
[[file:my-fig.png]]

Then link will be [[fig:my-fig]].

>> I tried to add it to `org-store-link` but it's a big function and I
>> wonder why it's not splitted in smaller functions. (e.g.
>> org-help-store-link, org-w3-store-link, org-image-store-link, ...).
>> If you agree, I could split it.
>
> Yes, please go ahead.

noted.

-- 
Daimrod/Greg

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]