From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: Link to named block Date: Sun, 19 Oct 2014 14:43:51 +0200 Message-ID: <87vbngrzzs.fsf@tanger.home> 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]:35125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfpqE-0007ZQ-Lc for emacs-orgmode@gnu.org; Sun, 19 Oct 2014 08:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xfpq5-0002bD-D5 for emacs-orgmode@gnu.org; Sun, 19 Oct 2014 08:44:10 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:53370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xfpq5-0002b8-5d for emacs-orgmode@gnu.org; Sun, 19 Oct 2014 08:44:01 -0400 Received: by mail-wg0-f50.google.com with SMTP id a1so3615464wgh.33 for ; Sun, 19 Oct 2014 05:43:59 -0700 (PDT) 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUQ7INAAoJEBNzVHcrZRiUVJkP/1ToTdfh8WM0r00NyjX6cu/q UhiDB75dT50NGmDASFirQHQowvNigniEDNuMq3+TkFYTTbALf6gpELic5e5OqUwO DKlKA0nQOjBWNSXEmZcpJlnPh25Y40i70ykZbq42awiJf/9l9s9SBQ91I7ta2juT zJS74K8z7wuQKkXt5+emm9MssGMMui7RkCwp05nFbWChvL0dC4K6m/vWOu/wNeDT U7inQ2x1y+xwGbJGXDlOOFFFPk27jiqLzc6ocxvzZgq5LjgH+vZhm06jVqGxLV7b L/ILba280SeZOTl/9tslerHCq0YcDidlqk0cQVgGPyQqHNApzl3iNKXEXQOjERoH fY/Y9cCuohGUBk2qnYVwgCby9nRd7Igy90aftDBwZeeDqSbCXegKQacnt6rJQ1g7 qB3xw/y5iew86sgcnnDHgT3mzgDECfmz5FoClVF4oryJYCXP/yFikOfwChjvVtDQ BDsxkndwoBPVWY5hOPwJXspHneqYaIoiBYbYi5DKy1X34ZdJuVQxqUsmami2rqPZ nsbPXV9MDL7hOgjJyjJZ//5PIRiTfbtCfE1P2lSXxyRUV4fJU0Gp6qcr4NaQe27y kzMilXMSFyncKaE2+oCrcA+P5trdc26q4iqSylP4fSdluIjd41h5GTH3D9C7FO/E 8AMJWztmSrXMa1zKZpyu =SREx -----END PGP SIGNATURE----- --=-=-=--