The byte-compiler ate my baby
This commit is contained in:
parent
7afa8a7e90
commit
1910453e29
6 changed files with 36 additions and 40 deletions
|
@ -3,37 +3,38 @@
|
|||
|
||||
;; REVIEW Refactor me
|
||||
|
||||
(defvar pcomplete-suffix-list)
|
||||
(defvar company-pcomplete-available 'unknown)
|
||||
|
||||
(defun company-pcomplete--prefix ()
|
||||
(let* ((pcomplete-stub)
|
||||
pcomplete-seen
|
||||
pcomplete-norm-func
|
||||
pcomplete-args
|
||||
pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list))
|
||||
(pcomplete-completions)
|
||||
(buffer-substring (pcomplete-begin) (point))))
|
||||
(with-no-warnings
|
||||
(let* ((pcomplete-stub)
|
||||
pcomplete-seen
|
||||
pcomplete-norm-func
|
||||
pcomplete-args
|
||||
pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list))
|
||||
(pcomplete-completions)
|
||||
(buffer-substring (pcomplete-begin) (point)))))
|
||||
|
||||
(defun company-pcomplete--candidates ()
|
||||
(let* ((pcomplete-stub)
|
||||
(pcomplete-show-list t)
|
||||
pcomplete-seen pcomplete-norm-func
|
||||
pcomplete-args pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list)
|
||||
(candidates (pcomplete-completions))
|
||||
(prefix (buffer-substring (pcomplete-begin) (point)))
|
||||
;; Collect all possible completions for the current stub
|
||||
(cnds (all-completions pcomplete-stub candidates))
|
||||
(bnds (completion-boundaries pcomplete-stub candidates nil ""))
|
||||
(skip (- (length pcomplete-stub) (car bnds))))
|
||||
;; Replace the stub at the beginning of each candidate by the prefix
|
||||
(mapcar (lambda (cand)
|
||||
(concat prefix (substring cand skip)))
|
||||
cnds)))
|
||||
(with-no-warnings
|
||||
(let* ((pcomplete-stub)
|
||||
(pcomplete-show-list t)
|
||||
pcomplete-seen pcomplete-norm-func
|
||||
pcomplete-args pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list)
|
||||
(candidates (pcomplete-completions))
|
||||
(prefix (buffer-substring (pcomplete-begin) (point)))
|
||||
;; Collect all possible completions for the current stub
|
||||
(cnds (all-completions pcomplete-stub candidates))
|
||||
(bnds (completion-boundaries pcomplete-stub candidates nil ""))
|
||||
(skip (- (length pcomplete-stub) (car bnds))))
|
||||
;; Replace the stub at the beginning of each candidate by the prefix
|
||||
(mapcar (lambda (cand)
|
||||
(concat prefix (substring cand skip)))
|
||||
cnds))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-pcomplete-available ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue