From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Goaziou Newsgroups: gmane.emacs.bugs Subject: bug#16751: 24.3.50; Export during Org export to HTML Date: Fri, 28 Mar 2014 19:36:12 +0100 Message-ID: <8761myqig3.fsf@gmail.com> References: <86fvnmoxyp.fsf@somewhere.org> <86txbwlkeh.fsf@somewhere.org> <83ha7w75sc.fsf@gnu.org> <86wqgk7npj.fsf@somewhere.org> <86mwhf4jpo.fsf@somewhere.org> <834n3n17vg.fsf@gnu.org> <87ob1vnml6.fsf@bzg.ath.cx> <83ob1vytf5.fsf@gnu.org> <83eh2muobu.fsf@gnu.org> <87pplgdkz3.fsf__35463.6971526363$1395389941$gmane$org@bzg.ath.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1396031785 12208 80.91.229.3 (28 Mar 2014 18:36:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2014 18:36:25 +0000 (UTC) Cc: sva-news@mygooglest.com, 16751@debbugs.gnu.org To: Bastien Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 28 19:36:34 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WTbdp-0004ro-B6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 19:36:33 +0100 Original-Received: from localhost ([::1]:35503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTbdo-0006yD-If for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 14:36:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTbda-0006oB-Um for bug-gnu-emacs@gnu.org; Fri, 28 Mar 2014 14:36:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTbdV-00012j-TV for bug-gnu-emacs@gnu.org; Fri, 28 Mar 2014 14:36:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTbdK-00010K-Lw; Fri, 28 Mar 2014 14:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WTbdJ-0003ho-Vw; Fri, 28 Mar 2014 14:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Fri, 28 Mar 2014 18:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16751 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: Original-Received: via spool by 16751-submit@debbugs.gnu.org id=B16751.139603175614233 (code B ref 16751); Fri, 28 Mar 2014 18:36:01 +0000 Original-Received: (at 16751) by debbugs.gnu.org; 28 Mar 2014 18:35:56 +0000 Original-Received: from localhost ([127.0.0.1]:55110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTbdC-0003hS-DA for submit@debbugs.gnu.org; Fri, 28 Mar 2014 14:35:55 -0400 Original-Received: from mail-wi0-f175.google.com ([209.85.212.175]:50426) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTbd4-0003hD-SP for 16751@debbugs.gnu.org; Fri, 28 Mar 2014 14:35:52 -0400 Original-Received: by mail-wi0-f175.google.com with SMTP id cc10so1062874wib.14 for <16751@debbugs.gnu.org>; Fri, 28 Mar 2014 11:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; bh=LHKhBxYa6C+CRnqGqOmxWi4bpuEpDnDroooJ7ZjIMVA=; b=vTToakxXwECoQvjVwtmGdHoF74uJNGCC5QhdfGJDY+VokfyhIUfrVuQgDVME1i/K1h yId5FGVllEDe+H0/ikR4w8zPjbo9NVcYbR96+/kpF1bhsKWgLGsMNXtaVD6KaRdXXTc8 /UDkyBy5NKaqUI7RcWY+hXv1waxrIOAOYT5nVJuJOtJMHiNqus6ihuXN0oERMJu1BeW3 GWx9b0cGvRX7rlQv6ACSIVfjuQn30xGtOpAV9FGrvso02d7xt8610DdC9l2zAxHjcNlV W5ViAqUw5Fpzf9F3VQmu+a3C8PwvGeF7z2B0YBl6KjAJO1m772UMlKxIyha5R6qRA1zP uW0Q== X-Received: by 10.194.109.227 with SMTP id hv3mr269267wjb.10.1396031745910; Fri, 28 Mar 2014 11:35:45 -0700 (PDT) Original-Received: from selenimh ([91.224.148.150]) by mx.google.com with ESMTPSA id f3sm9433780wiv.2.2014.03.28.11.35.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Mar 2014 11:35:44 -0700 (PDT) In-Reply-To: <87pplgdkz3.fsf__35463.6971526363$1395389941$gmane$org@bzg.ath.cx> (Bastien's message of "Fri, 21 Mar 2014 09:17:20 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87494 Archived-At: --=-=-= Content-Type: text/plain Hello, Bastien writes: > If someone wants to work on this, help is welcome. > Let's keep the bug open in the meantime. Unless I'm mistaken, the following patch should fix the issue. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Make-Org-links-compatible-with-URI-syntax.patch >From 4d62387fe035d9aa3d1dc96d12d40c53dca2afe5 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 28 Mar 2014 19:24:38 +0100 Subject: [PATCH] Make Org links compatible with URI syntax * lisp/org.el (org-make-link-regexps): Allow optional double slashes after type. Small refactoring. * testing/lisp/test-org-element.el (test-org-element/link-parser): Update test. This patch allows to write both [[file:/file.org]] and [[file:///file.org]]. See bug#16751. --- lisp/org.el | 43 ++++++++++++++++++---------------------- testing/lisp/test-org-element.el | 6 ++---- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index bb83eb7..53f142e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5658,34 +5658,29 @@ stacked delimiters is N. Escaping delimiters is not possible." "Update the link regular expressions. This should be called after the variable `org-link-types' has changed." (setq org-link-types-re - (concat - "\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):") + (concat "\\`" (regexp-opt org-link-types t) ":\\(?://\\)") org-link-re-with-space - (concat - "?") + (concat "?") org-link-re-with-space2 - (concat - "?") + (concat "?") org-link-re-with-space3 - (concat - "") + (concat "<" (regexp-opt org-link-types t) ":\\(?://\\)?" + "\\([^" org-non-link-chars " ]" + "[^" org-non-link-chars "]*" + "\\)>") org-plain-link-re (concat - "\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):" + "\\<" (regexp-opt org-link-types t) ":\\(?://\\)?" (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)")) ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)") org-bracket-link-regexp @@ -5693,7 +5688,7 @@ This should be called after the variable `org-link-types' has changed." org-bracket-link-analytic-regexp (concat "\\[\\[" - "\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?" + "\\(" (regexp-opt org-link-types t) ":\\(?://\\)?\\)?" "\\([^]]+\\)" "\\]" "\\(\\[" "\\([^]]+\\)" "\\]\\)?" @@ -5701,7 +5696,7 @@ This should be called after the variable `org-link-types' has changed." org-bracket-link-analytic-regexp++ (concat "\\[\\[" - "\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?" + "\\(" (regexp-opt (cons "coderef" org-link-types) t) ":\\(?://\\)?\\)?" "\\([^]]+\\)" "\\]" "\\(\\[" "\\([^]]+\\)" "\\]\\)?" diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index def1659..72eea22 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -1362,12 +1362,10 @@ e^{i\\pi}+1=0 ;; ... with expansion. (should (equal - "//orgmode.org/worg" + "orgmode.org/worg" (org-test-with-temp-text "[[Org:worg]]" (let ((org-link-abbrev-alist '(("Org" . "http://orgmode.org/")))) - (org-element-property - :path - (org-element-map (org-element-parse-buffer) 'link 'identity nil t)))))) + (org-element-property :path (org-element-context)))))) ;; ... with translation. (should (equal -- 1.9.1 --=-=-=--