org-wikinodes: Fix fontification

* contrib/lisp/org-wikinodes.el (org-wikinodes-add-to-font-lock-keywords):
  Properly install fontification mechanism.  Small refactoring.

Suggested-by: Scott Campbell <scott.campbell@uwaterloo.ca>
<http://permalink.gmane.org/gmane.emacs.orgmode/94683>
This commit is contained in:
Nicolas Goaziou 2015-02-07 22:01:38 +01:00
parent 7e4228a137
commit a9a9af030d
1 changed files with 4 additions and 5 deletions

View File

@ -316,11 +316,10 @@ with working links."
(defun org-wikinodes-add-to-font-lock-keywords ()
"Add wikinode CamelCase highlighting to `org-font-lock-extra-keywords'."
(let ((m (member '(org-activate-plain-links) org-font-lock-extra-keywords)))
(if m
(setcdr m (cons '(org-wikinodes-activate-links) (cdr m)))
(message
"Failed to add wikinodes to `org-font-lock-extra-keywords'."))))
(let ((m (member '(org-activate-plain-links (0 'org-link t))
org-font-lock-extra-keywords)))
(if m (push '(org-wikinodes-activate-links) (cdr m))
(message "Failed to add wikinodes to `org-font-lock-extra-keywords'."))))
(add-hook 'org-font-lock-set-keywords-hook
'org-wikinodes-add-to-font-lock-keywords)