[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] [PATCH 05/16] New optional argument: Merge user table with def
From: |
David Maus |
Subject: |
[Orgmode] [PATCH 05/16] New optional argument: Merge user table with default table |
Date: |
Sun, 13 Feb 2011 13:01:07 +0100 |
* org.el (org-link-escape): New optional argument. Merge user table
with default table.
---
lisp/org.el | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index cafb673..a29d429 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8554,14 +8554,22 @@ This is the list that is used for internal purposes.")
"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)
+(defun org-link-escape (text &optional table merge)
"Return percent escaped representation of TEXT.
TEXT is a string with the text to escape.
Optional argument TABLE is a list with characters that should be
-escaped. When nil, `org-link-escape-chars' is used."
+escaped. When nil, `org-link-escape-chars' is used.
+If optional argument MERGE is set, merge TABLE into
+`org-link-escape-chars'."
(if (and org-url-encoding-use-url-hexify (not table))
(url-hexify-string text)
- (setq table (or table org-link-escape-chars))
+ (cond
+ ((and table merge)
+ (mapc (lambda (defchr)
+ (unless (member defchr table)
+ (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)
--
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, 2011/02/13
- [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 <=
- [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
- [Orgmode] [PATCH 13/16] Refactor unescaping functions, David Maus, 2011/02/13
- [Orgmode] [PATCH 15/16] Use `org-link-unescape' instead of obsolete unhex string function, David Maus, 2011/02/13