summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-06-21 22:55:10 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-06-21 22:55:10 +0200
commit521734d51fa2695257793886cb62d16851185d63 (patch)
tree5febaea0a1bcf079e466c751c1ea6be51056290b
parent112c5ba479d52c3c36de5c7aafd14ab6bc075005 (diff)
downloadorg-mode-521734d51fa2695257793886cb62d16851185d63.tar.gz
Fix link fontificationrelease_9.0.9
* lisp/org.el (org-activate-links): Fix link fontification. Reported-by: John Kitchin <jkitchin@andrew.cmu.edu> <http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00381.html>
-rw-r--r--lisp/org.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el
index b89044c..22b7dbf 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5964,12 +5964,12 @@ This includes angle, plain, and bracket links."
(while (re-search-forward org-any-link-re limit t)
(let* ((start (match-beginning 0))
(end (match-end 0))
- (type (cond ((eq ?< (char-after start)) 'angle)
- ((eq ?\[ (char-after (1+ start))) 'bracket)
- (t 'plain))))
- (when (and (memq type org-highlight-links)
+ (style (cond ((eq ?< (char-after start)) 'angle)
+ ((eq ?\[ (char-after (1+ start))) 'bracket)
+ (t 'plain))))
+ (when (and (memq style org-highlight-links)
;; Do not confuse plain links with tags.
- (not (and (eq type 'plain)
+ (not (and (eq style 'plain)
(let ((face (get-text-property
(max (1- start) (point-min)) 'face)))
(if (consp face) (memq 'org-tag face)
@@ -5978,6 +5978,7 @@ This includes angle, plain, and bracket links."
(goto-char start)
(save-match-data (org-element-link-parser))))
(link (org-element-property :raw-link link-object))
+ (type (org-element-property :type link-object))
(path (org-element-property :path link-object))
(properties ;for link's visible part
(list
@@ -6001,7 +6002,7 @@ This includes angle, plain, and bracket links."
'font-lock-multiline t)))
(org-remove-flyspell-overlays-in start end)
(org-rear-nonsticky-at end)
- (if (not (eq 'bracket type))
+ (if (not (eq 'bracket style))
(add-text-properties start end properties)
;; Handle invisible parts in bracket links.
(remove-text-properties start end '(invisible nil))
@@ -6019,7 +6020,7 @@ This includes angle, plain, and bracket links."
(org-rear-nonsticky-at visible-end)))
(let ((f (org-link-get-parameter type :activate-func)))
(when (functionp f)
- (funcall f start end path (eq type 'bracket))))
+ (funcall f start end path (eq style 'bracket))))
(throw :exit t))))) ;signal success
nil))