emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Link to named block


From: Daimrod
Subject: [O] Link to named block
Date: Sun, 19 Oct 2014 14:43:51 +0200

Hi,

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 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.

WDYT?

Best,

--
Daimrod/Greg

Attachment: signature.asc
Description: PGP signature


reply via email to

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