From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [PATCH 03/16] New format of percent escape table Date: Sun, 13 Feb 2011 13:01:05 +0100 Message-ID: <1297598478-9925-4-git-send-email-dmaus@ictsoc.de> References: <87d3mwvqwq.fsf@gnu.org> Return-path: Received: from [140.186.70.92] (port=43767 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoaeF-0003id-BM for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 07:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoaeD-0006wO-6I for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 07:01:50 -0500 Received: from mail.app1.xlhost.de ([213.202.242.114]:48893 helo=mysql1.xlhost.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoaeC-0006w4-OG for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 07:01:49 -0500 In-Reply-To: <87d3mwvqwq.fsf@gnu.org> 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: emacs-orgmode@gnu.org, bastien.guerry@wikimedia.fr Cc: David Maus * org.el (org-link-escape-chars, org-link-escape-chars-browser): New format of percent escape table. (org-link-escape): Use new table format. Just a plain list with the chars that should be escaped. --- lisp/org.el | 27 +++++---------------------- 1 files changed, 5 insertions(+), 22 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9aeeeda..7d38907 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8543,32 +8543,15 @@ according to FMT (default from `org-email-link-description-format')." "]")) (defconst org-link-escape-chars - '((?\ . "%20") - (?\[ . "%5B") - (?\] . "%5D") - (?\340 . "%E0") ; `a - (?\342 . "%E2") ; ^a - (?\347 . "%E7") ; ,c - (?\350 . "%E8") ; `e - (?\351 . "%E9") ; 'e - (?\352 . "%EA") ; ^e - (?\356 . "%EE") ; ^i - (?\364 . "%F4") ; ^o - (?\371 . "%F9") ; `u - (?\373 . "%FB") ; ^u - (?\; . "%3B") -;; (?? . "%3F") - (?= . "%3D") - (?+ . "%2B") - ) - "Association list of escapes for some characters problematic in links. + '(?\ ?\[ ?\] ?\; ?\= ?\+) + "List of characters that should be escaped in link. This is the list that is used for internal purposes.") (defvar org-url-encoding-use-url-hexify nil) (defconst org-link-escape-chars-browser - '((?\ . "%20")) ; 32 for the SPC char - "Association list of escapes for some characters problematic in links. + '(?\ ) + "List of escapes for characters that are problematic in links. This is the list that is used before handing over to the browser.") (defun org-link-escape (text &optional table) @@ -8578,7 +8561,7 @@ This is the list that is used before handing over to the browser.") (setq table (or table org-link-escape-chars)) (mapconcat (lambda (char) - (if (or (assoc char table) + (if (or (member char table) (< char 32) (> char 126)) (mapconcat (lambda (sequence) (format "%%%.2X" sequence)) -- 1.7.2.3