From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: unlinking links Date: Thu, 06 Nov 2014 20:30:08 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmYNU-000599-BQ for emacs-orgmode@gnu.org; Thu, 06 Nov 2014 20:30:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmYNP-0005ne-Kt for emacs-orgmode@gnu.org; Thu, 06 Nov 2014 20:30:16 -0500 Received: from mail-qa0-x22e.google.com ([2607:f8b0:400d:c00::22e]:61848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmYNP-0005nV-GX for emacs-orgmode@gnu.org; Thu, 06 Nov 2014 20:30:11 -0500 Received: by mail-qa0-f46.google.com with SMTP id n8so1661650qaq.5 for ; Thu, 06 Nov 2014 17:30:10 -0800 (PST) In-Reply-To: (Adam Spiers's message of "Thu, 6 Nov 2014 18:57:19 +0100") 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: Adam Spiers Cc: org-mode mailing list Adam Spiers writes: Try this: (defun unlinkify () "replace an org-link with the path, or description." (interactive) (let ((eop (org-element-context))) (when (eq 'link (car eop)) (message "%s" eop) (let* ((start (org-element-property :begin eop)) (end (org-element-property :end eop)) (contents-begin (org-element-property :contents-begin eop)) (contents-end (org-element-property :contents-end eop)) (path (org-element-property :path eop)) (desc (and contents-begin contents-end (buffer-substring contents-begin contents-end)))) (setf (buffer-substring start end) (or desc path)))))) > Hi all, > > Is it just me or is there no quick way to remove the link from some > hyperlinked text? If so, please consider this a feature request ;-) > > Regards, > Adam > -- ----------------------------------- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu