-
Notifications
You must be signed in to change notification settings - Fork 0
/
icicles-rcodetools.el
35 lines (30 loc) · 1.51 KB
/
icicles-rcodetools.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;;; icicles-rcodetools.el -- accurate completion with icicles
;;; Copyright (c) 2006-2007 rubikitch <[email protected]>
;;;
;;; Use and distribution subject to the terms of the Ruby license.
(require 'icicles)
(require 'rcodetools)
(setq rct-complete-symbol-function 'rct-complete-symbol--icicles)
(icicle-define-command rct-complete-symbol--icicles
"Perform ruby method and class completion on the text around point with icicles.
C-M-RET shows RI documentation on each candidate.
See also `rct-interactive'."
(lambda (result)
(save-excursion
(search-backward pattern)
(setq beg (point)))
(delete-region beg end)
(insert result)) ;/function
"rct-complete: " ;prompt
rct-method-completion-table
nil nil pattern nil nil nil
((end (point)) beg
(icicle-list-join-string "\t")
(icicle-list-use-nth-parts '(1))
(icicle-point-position-in-candidate 'input-end)
pattern klass alist
(icicle-candidate-help-fn
(lambda (result)
(ri (cdr (assoc result alist)))))) ;bindings
(rct-exec-and-eval rct-complete-command-name "--completion-emacs-icicles"))
(provide 'icicles-rcodetools)