summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-01-25 13:54:47 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-01-25 13:54:47 +0100
commit9eface25da489cbb7b8c2f4951850b571f74f660 (patch)
treef201703aedb568ee0014ca759af81eb991afcd02
parente92a06aeb16357c3d06c9d599a9f3ea02fff9f5a (diff)
downloadorg-mode-9eface25da489cbb7b8c2f4951850b571f74f660.tar.gz
Fix (wrong-type-argument listp org-link) error
* lisp/org.el (org-activate-plain-links): `face' property doesn't not necessarily is a list. Reported-by: gongzhitaao <zhitaao.gong@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/104444>
-rw-r--r--lisp/org.el25
1 files changed, 10 insertions, 15 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 6753457..7676f60 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5849,25 +5849,20 @@ prompted for."
(defun org-activate-plain-links (limit)
"Add link properties for plain links."
- (let (f hl)
- (when (and (re-search-forward (concat org-plain-link-re) limit t)
- (not (memq 'org-tag
- (get-text-property
- (max (1- (match-beginning 0)) (point-min)) 'face)))
- (not (org-in-src-block-p)))
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (setq f (get-text-property (match-beginning 0) 'face))
- (setq hl (org-match-string-no-properties 0))
- (if (or (eq f 'org-tag)
- (and (listp f) (memq 'org-tag f)))
- nil
+ (when (and (re-search-forward (concat org-plain-link-re) limit t)
+ (not (org-in-src-block-p)))
+ (let ((face (get-text-property (max (1- (match-beginning 0)) (point-min))
+ 'face))
+ (link (org-match-string-no-properties 0)))
+ (when (if (consp face) (memq 'org-tag face) (eq 'org-tag face))
+ (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
(add-text-properties (match-beginning 0) (match-end 0)
(list 'mouse-face 'highlight
'face 'org-link
- 'htmlize-link `(:uri ,hl)
+ 'htmlize-link `(:uri ,link)
'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 0)))
- t)))
+ (org-rear-nonsticky-at (match-end 0))
+ t))))
(defun org-activate-code (limit)
(if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)