From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: requested feature Date: Mon, 15 Nov 2010 19:02:54 +0100 Message-ID: <87ipzyea7l.wl%dmaus@ictsoc.de> References: <87k4kfvh0y.wl%dmaus@ictsoc.de> <87zktahbre.fsf@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============1358647557==" Return-path: Received: from [140.186.70.92] (port=46392 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PI3OX-0002cs-NY for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 13:03:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PI3OO-0004zs-DV for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 13:03:04 -0500 Received: from mailout110.xlhost.de ([213.202.242.110]:35873 helo=mysql1.xlhost.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PI3OO-0004zM-8e for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 13:03:00 -0500 In-Reply-To: <87zktahbre.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Paul Mead Cc: Marvin Doyley , emacs-orgmode@gnu.org, David Maus --===============1358647557== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Mon_Nov_15_19:02:54_2010-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Mon_Nov_15_19:02:54_2010-1 Content-Type: text/plain; charset=US-ASCII At Mon, 15 Nov 2010 15:01:09 +0000, Paul Mead wrote: > > > This looks pretty interesting to me, but how would you change this so > that it used the whole heading text, not just one word? It's basically the same, only difference is finding the headline text and making the headline text link-safe: (defun dmj:turn-headline-into-org-mode-link () "Replace word at point by an Org mode link." (interactive) (when (org-at-heading-p) (let ((hl-text (nth 4 (org-heading-components)))) (unless (or (null hl-text) (org-string-match-p "^[ \t]*:[^:]+:$" hl-text)) (beginning-of-line) (search-forward hl-text (point-at-eol)) (replace-string hl-text (format "[[file:%s.org][%s]]" (org-link-escape hl-text) (org-link-escape hl-text '((?\] . "%5D") (?\[ . "%5B")))) nil (- (point) (length hl-text)) (point)))))) Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Mon_Nov_15_19:02:54_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkzhdc4ACgkQma24O1pEeObX8gD/aNUS1ZMBc3yRZloI+N5Y1lBF J2blxc4ViqPoUK0ZiqgA/0IhokrTUvDDzE8zWkXV3h+QBBwzIJnZ7+NNbRA83EO+ =M3v5 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Mon_Nov_15_19:02:54_2010-1-- --===============1358647557== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1358647557==--