Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (53 sloc) 2.09 KB
;;; hippie-expand-slime.el --- Hook slime's completion into hippie-expand
;; Author: Steve Purcell <>
;; URL:
;; Version: DEV
;;; Commentary:
;; Usage:
;; (require 'hippie-expand-slime)
;; (add-hook 'slime-mode-hook 'set-up-slime-hippie-expand)
;; (add-hook 'slime-repl-mode-hook 'set-up-slime-hippie-expand))
;;; Code:
(defun try-expand-slime-with-fn (old complete-fn)
"Completion function for `hippie-expand' which uses one of
slime's completion functions."
(if (not old)
(he-init-string (slime-symbol-start-pos) (slime-symbol-end-pos))
(if (not (equal he-search-string ""))
(setq he-expand-list
(sort (car (funcall complete-fn he-search-string))
(setq he-expand-list ()))))
(while (and he-expand-list
(he-string-member (car he-expand-list) he-tried-table))
(setq he-expand-list (cdr he-expand-list)))
(if (null he-expand-list)
(if old (he-reset-string))
(he-substitute-string (car he-expand-list))
(setq he-tried-table (cons (car he-expand-list) (cdr he-tried-table)))
(setq he-expand-list (cdr he-expand-list))
(defun try-expand-slime (old)
"Simple slime completion function for `hippie-expand'."
(try-expand-slime-with-fn old 'slime-simple-completions))
(defun try-expand-slime-fuzzy (old)
"Fuzzy slime completion function for `hippie-expand'."
(try-expand-slime-with-fn old 'slime-fuzzy-completions))
(defun set-up-slime-hippie-expand (&optional fuzzy)
"Add an optionally-fuzzy slime completion function to the front of
`hippie-expand-try-functions-list' for the current buffer."
(set (make-local-variable 'hippie-expand-try-functions-list) hippie-expand-try-functions-list)
(add-to-list 'hippie-expand-try-functions-list
(if fuzzy
(provide 'hippie-expand-slime)
;;; hippie-expand-slime.el ends here
Jump to Line
Something went wrong with that request. Please try again.