[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] [PATCH 03/16] New format of percent escape table
From: |
David Maus |
Subject: |
[Orgmode] [PATCH 03/16] New format of percent escape table |
Date: |
Sun, 13 Feb 2011 13:01:05 +0100 |
* 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
- Re: [Orgmode] Improve percent escaping links in Org mode (pull request / OK to push), Bastien, 2011/02/12
- [Orgmode] [PATCH 01/16] Decode single byte sequence if decoding unicode failed., David Maus, 2011/02/13
- [Orgmode] [PATCH 02/16] New unicode aware percent encoding algorithm, David Maus, 2011/02/13
- [Orgmode] [PATCH 03/16] New format of percent escape table,
David Maus <=
- [Orgmode] [PATCH 04/16] Fixup doc string, David Maus, 2011/02/13
- [Orgmode] [PATCH 05/16] New optional argument: Merge user table with default table, David Maus, 2011/02/13
- [Orgmode] [PATCH 06/16] Inline function to properly decode utf8 characters in Emacs 22, David Maus, 2011/02/13
- [Orgmode] [PATCH 08/16] Declare obsolete & alias to respective org-link-unescape-* functions, David Maus, 2011/02/13
- [Orgmode] [PATCH 09/16] Remove obsolete argument in call to org-link-unescape, David Maus, 2011/02/13
- [Orgmode] [PATCH 07/16] Unescape functions moved and renamed from org-protocol.el, David Maus, 2011/02/13
- [Orgmode] [PATCH 10/16] Use new percent escape character table format, David Maus, 2011/02/13
- [Orgmode] [PATCH 11/16] Add percent sign to list of escape chars, David Maus, 2011/02/13
- [Orgmode] [PATCH 12/16] Rename lambda argument, David Maus, 2011/02/13
- [Orgmode] [PATCH 14/16] Always percent escape the percent sign, David Maus, 2011/02/13