From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: Re: Link to named block Date: Mon, 20 Oct 2014 19:51:19 +0200 Message-ID: <87siiiociw.fsf@tanger.home> References: <87vbngrzzs.fsf@tanger.home> <878ukbaxs2.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgH7S-0001U8-Bq for emacs-orgmode@gnu.org; Mon, 20 Oct 2014 13:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgH7M-0001X7-TQ for emacs-orgmode@gnu.org; Mon, 20 Oct 2014 13:51:46 -0400 In-Reply-To: <878ukbaxs2.fsf@bzg.ath.cx> (Bastien's message of "Mon, 20 Oct 2014 11:35:57 +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: Bastien Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Bastien writes: > Hi Greg, Hi Bastien, > 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 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. =2D-=20 Daimrod/Greg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJURUuXAAoJEBNzVHcrZRiUEAcP/2oDn4s6fioJih9kBXZdQs+N zm0jw/x9ukfImEt5n2i/tnYTyPe5iqWqtOaZ3HFHn79U9fR1KQcz9JedA6h2VVop TfYmQLhy+ceK4RYrvsvj84uB0l2pLc+5mHu/AjFB9uX/PP0fSjaOIK2BjVWnwp6Y wX80CD7OwyKTzucwuRU8QL26BcbcEDhfY1fOJvroyq6kxSjuYs2whPVWEZ3rx4MA mN6UkNYKOEeNK6pd7AuhHLzksV0Kt1ghpnL7nz7Z3YE7XjKCa/f9RDsCk79sRduo 9cwzmhVv+tgqz4y6lfs9AFm0oub/tM8o79Kc8ckxe0Pn58XbgFrV2rrgEHRnDoOG XuUHZpK3EpYgr4nw0yylwt4y3bF9IyoVn0zG/vA7GALuSiktyMzlht+qUfRSFng1 CJ/NamcHa07Bmi5aoiPEmEp/JQVcQzb3R6StTU5kmshnHU6moAxFICvO7pPCFuaE gl8XOjMw8prsF6494qlrl/2nlQQzI9c5WcUAqI5A1x1gBQsYJZoIDv4aHBn+ZnUZ smhVWZaQNiGeoztoKgylnxxKQDNYaRxWscwOOUhZmjn8QgrJCiA9JNzsw8SAImoE qMSdZ42PKSB/pLK4UyFVk9nug4jDO9WcNOrQ1JHbWhPF6TdXcWIgmbzKb+CHWixp D74OT/YBEVRgGj9wvx+S =hgJU -----END PGP SIGNATURE----- --=-=-=--