From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] Sloppy `org-element-context'? Date: Tue, 29 Apr 2014 23:20:41 +0200 Message-ID: <874n1bq1cm.fsf@gmail.com> References: <874n2jsls9.fsf@gmail.com> <871twteltj.fsf@bzg.ath.cx> <87tx9jlr6z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfFRq-0003w4-HX for emacs-orgmode@gnu.org; Tue, 29 Apr 2014 17:20:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfFRl-0006Pf-P8 for emacs-orgmode@gnu.org; Tue, 29 Apr 2014 17:20:18 -0400 In-Reply-To: <87tx9jlr6z.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 23 Apr 2014 22:35:32 +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: Org Mode List Correcting myself: Nicolas Goaziou writes: > Bastien writes: > >> (defun org-open-links-in-comment-and-properties () >> "Open links in a comment or in a property." >> (interactive) >> (let ((string-ahead (and (looking-at ".+") (match-string 0))) >> (value (org-element-property :value (org-element-at-point)))) >> (with-temp-buffer >> (org-mode) >> (insert value) >> (goto-char (point-min)) >> (search-forward string-ahead) >> (org-open-at-point)))) >> >> which do work right now. > > Indeed. Actually, it will not work in comments (point is X): # Some http://orgmode.org/file.html # and http://orgmode.org/other-fileX.html The code will open the first link, not the second one. Regards, -- Nicolas Goaziou