From 73493037c62ff899ac70024ea868d80426a26102 Mon Sep 17 00:00:00 2001 From: Nikolaj Schumacher Date: Sun, 15 Mar 2009 17:02:19 +0100 Subject: [PATCH 1/1] Added OddMuse back-end. --- company-oddmuse.el | 20 ++++++++++++++++++++ company.el | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 company-oddmuse.el diff --git a/company-oddmuse.el b/company-oddmuse.el new file mode 100644 index 000000000..cf41e7b18 --- /dev/null +++ b/company-oddmuse.el @@ -0,0 +1,20 @@ +(require 'company) +(require 'oddmuse) +(eval-when-compile (require 'cl)) + +(defvar company-oddmuse-link-regexp + "\\(\\<[A-Z][[:alnum:]]*\\>\\)\\|\\[\\[\\([[:alnum:]]+\\>\\|\\)") + +(defun company-oddmuse (command &optional arg &rest ignored) + (case command + ('prefix (let ((case-fold-search nil)) + (and (eq major-mode 'oddmuse-mode) + (looking-back company-oddmuse-link-regexp (point-at-bol)) + (or (match-string 1) + (match-string 2))))) + ('candidates (all-completions arg + (oddmuse-make-completion-table oddmuse-wiki))) + )) + +(provide 'company-oddmuse) +;;; company-oddmuse.el ends here diff --git a/company.el b/company.el index b2a4582ad..73f475196 100644 --- a/company.el +++ b/company.el @@ -94,7 +94,7 @@ (function :tag "custom function" nil)))) (defcustom company-backends '(company-elisp company-nxml company-css - company-semantic company-ispell) + company-semantic company-oddmuse company-ispell) "*" :group 'company :type '(repeat (function :tag "function" nil))) -- 2.39.2