From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Link to named block Date: Mon, 20 Oct 2014 11:35:57 +0200 Message-ID: <878ukbaxs2.fsf@bzg.ath.cx> References: <87vbngrzzs.fsf@tanger.home> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg9Nt-0001pf-Qz for emacs-orgmode@gnu.org; Mon, 20 Oct 2014 05:36:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xg9Ng-0008Q0-I0 for emacs-orgmode@gnu.org; Mon, 20 Oct 2014 05:36:13 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:46099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg9Ng-0008Po-BP for emacs-orgmode@gnu.org; Mon, 20 Oct 2014 05:36:00 -0400 Received: by mail-wi0-f171.google.com with SMTP id em10so6567222wid.4 for ; Mon, 20 Oct 2014 02:35:59 -0700 (PDT) In-Reply-To: <87vbngrzzs.fsf@tanger.home> (daimrod@gmail.com's message of "Sun, 19 Oct 2014 14:43:51 +0200") 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 Hi Greg, Daimrod 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 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. Thanks, -- Bastien