]> code.delx.au - gnu-emacs-elpa/blob - company-oddmuse.el
Added OddMuse back-end.
[gnu-emacs-elpa] / company-oddmuse.el
1 (require 'company)
2 (require 'oddmuse)
3 (eval-when-compile (require 'cl))
4
5 (defvar company-oddmuse-link-regexp
6 "\\(\\<[A-Z][[:alnum:]]*\\>\\)\\|\\[\\[\\([[:alnum:]]+\\>\\|\\)")
7
8 (defun company-oddmuse (command &optional arg &rest ignored)
9 (case command
10 ('prefix (let ((case-fold-search nil))
11 (and (eq major-mode 'oddmuse-mode)
12 (looking-back company-oddmuse-link-regexp (point-at-bol))
13 (or (match-string 1)
14 (match-string 2)))))
15 ('candidates (all-completions arg
16 (oddmuse-make-completion-table oddmuse-wiki)))
17 ))
18
19 (provide 'company-oddmuse)
20 ;;; company-oddmuse.el ends here