emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: intra links and worg
Date: Thu, 06 Feb 2014 17:31:37 +0100	[thread overview]
Message-ID: <87ob2ki4nq.fsf@bzg.ath.cx> (raw)
In-Reply-To: <m2d2j0e703.fsf@polytechnique.org> (Alan Schmitt's message of	"Thu, 06 Feb 2014 13:54:36 +0100")

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

Hi Alan,

if you can, please test this quick patch.

All tests pass fine but it's not the definitive patch as there
are other issues in this areas we need to check first.  But
tests will help, as always.

Thanks!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-org-escape-chars-in-links.patch --]
[-- Type: text/x-diff, Size: 1246 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index 27aeccb..50fa5ce 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9834,17 +9834,18 @@ If optional argument MERGE is set, merge TABLE into
 	      (setq table (cons defchr table)))) org-link-escape-chars))
    ((null table)
     (setq table org-link-escape-chars)))
-  (mapconcat
-   (lambda (char)
-     (if (or (member char table)
-	     (and (or (< char 32) (= char ?\%) (> char 126))
-		  org-url-hexify-p))
-	 (mapconcat (lambda (sequence-element)
-		      (format "%%%.2X" sequence-element))
-		    (or (encode-coding-char char 'utf-8)
-			(error "Unable to percent escape character: %s"
-			       (char-to-string char))) "")
-       (char-to-string char))) text ""))
+  (if (string-match "^\*[[:alnum:]]+" text) text
+    (mapconcat
+     (lambda (char)
+       (if (or (member char table)
+	       (and (or (< char 32) (= char ?\%) (> char 126))
+		    org-url-hexify-p))
+	   (mapconcat (lambda (sequence-element)
+			(format "%%%.2X" sequence-element))
+		      (or (encode-coding-char char 'utf-8)
+			  (error "Unable to percent escape character: %s"
+				 (char-to-string char))) "")
+	 (char-to-string char))) text "")))
 
 (defun org-link-escape-browser (text)
   (if (org-string-match-p

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  reply	other threads:[~2014-02-06 16:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 12:54 intra links and worg Alan Schmitt
2014-02-06 16:31 ` Bastien [this message]
2014-02-06 18:30   ` Alan Schmitt
2014-02-06 21:42     ` Bastien
2014-02-07 10:47       ` Alan Schmitt
2014-05-26 14:07         ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ob2ki4nq.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).