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>
This commit is contained in:
Nicolas Goaziou 2016-01-25 13:54:47 +01:00
parent e92a06aeb1
commit 9eface25da
1 changed files with 10 additions and 15 deletions

View File

@ -5849,25 +5849,20 @@ prompted for."
(defun org-activate-plain-links (limit) (defun org-activate-plain-links (limit)
"Add link properties for plain links." "Add link properties for plain links."
(let (f hl) (when (and (re-search-forward (concat org-plain-link-re) limit t)
(when (and (re-search-forward (concat org-plain-link-re) limit t) (not (org-in-src-block-p)))
(not (memq 'org-tag (let ((face (get-text-property (max (1- (match-beginning 0)) (point-min))
(get-text-property 'face))
(max (1- (match-beginning 0)) (point-min)) 'face))) (link (org-match-string-no-properties 0)))
(not (org-in-src-block-p))) (when (if (consp face) (memq 'org-tag face) (eq 'org-tag face))
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (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
(add-text-properties (match-beginning 0) (match-end 0) (add-text-properties (match-beginning 0) (match-end 0)
(list 'mouse-face 'highlight (list 'mouse-face 'highlight
'face 'org-link 'face 'org-link
'htmlize-link `(:uri ,hl) 'htmlize-link `(:uri ,link)
'keymap org-mouse-map)) 'keymap org-mouse-map))
(org-rear-nonsticky-at (match-end 0))) (org-rear-nonsticky-at (match-end 0))
t))) t))))
(defun org-activate-code (limit) (defun org-activate-code (limit)
(if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t) (if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)