From 27915744a28cda571b14679fd9fc92432c51b439 Mon Sep 17 00:00:00 2001 From: David Maus Date: Sun, 21 Nov 2010 11:12:07 +0100 Subject: [PATCH] New optional argument: Merge user table with default table * org.el (org-link-escape): New optional argument. Merge user table with default table. --- lisp/org.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ec817f07c..873cfe19d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8614,14 +8614,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) -- 2.11.4.GIT