summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-02-25 18:16:58 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-02-25 18:16:58 +0100
commit7125fa194757081b865e135066644d00ae2bd950 (patch)
treefd15c114760afa5ceb42843f7947e0542ec7a7da
parentd7d0b2725d7bc45198dd0a6a5bafff411a284506 (diff)
parenta0047bcd477c5a5dacfe276d18ace7c5dc5fe2f3 (diff)
downloadorg-mode-7125fa194757081b865e135066644d00ae2bd950.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 4189d42..3e2f1c1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -24923,17 +24923,16 @@ when non-nil, is a regexp matching keywords names."
(when (derived-mode-p 'org-mode)
(org-show-context 'org-goto))))))
-(defun org-link-display-format (link)
- "Replace a link with its the description.
+(defun org-link-display-format (s)
+ "Replace links in string S with their description.
If there is no description, use the link target."
(save-match-data
- (if (string-match org-bracket-link-analytic-regexp link)
- (replace-match (if (match-end 5)
- (match-string 5 link)
- (concat (match-string 1 link)
- (match-string 3 link)))
- nil t link)
- link)))
+ (replace-regexp-in-string
+ org-bracket-link-analytic-regexp
+ (lambda (m)
+ (if (match-end 5) (match-string 5 m)
+ (concat (match-string 1 m) (match-string 3 m))))
+ s nil t)))
(defun org-toggle-link-display ()
"Toggle the literal or descriptive display of links."