Skip to content

Instantly share code, notes, and snippets.

@imakado
Created August 10, 2009 06:44
Show Gist options
  • Save imakado/165035 to your computer and use it in GitHub Desktop.
Save imakado/165035 to your computer and use it in GitHub Desktop.
(defun plcmp-ac-candidates ()
(plcmp-ignore-errors
(when (and (eq major-mode 'cperl-mode)
(boundp 'perl-completion-mode)
perl-completion-mode)
;;(plcmp-initialize-variables)
(let ((words (plcmp-ac-make-cands)))
(plcmp-log "plcmp-ac-candidates words: %S" words)
(let ((cands (loop with count = 0
with ret
for w in words
when (and (stringp w)
(string-match (concat "^" ac-target) w)
(not (string= ac-target w)))
do (progn (push w ret)
(incf count)
(when (= count plcmp-ac-candidates-limit)
(return (nreverse ret))))
finally return (nreverse ret))))
(prog1 cands
(plcmp-log "plcmp-ac-candidates return: %s" cands)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment