did you mean cadr?
suggest.el is an Emacs package for discovering elisp functions based on examples. See my blog post: Example Driven Development.
suggest.el knows many string functions:
;; Inputs (one per line):
"foo bar"
;; Desired output:
"Foo Bar"
;; Suggestions:
(capitalize "foo bar") ;=> "Foo Bar"
suggest.el can also help you find tricky dash.el functions:
;; Inputs (one per line):
(list 'a 'b 'c 'd)
'c
;; Desired output:
2
;; Suggestions:
(-elem-index 'c (list 'a 'b 'c 'd)) ;=> 2
suggest.el is particularly handy for path manipulation, using both built-in functions as well as f.el:
;; Inputs (one per line):
"/foo/bar/baz.txt"
;; Desired output:
"baz.txt"
;; Suggestions:
(file-name-nondirectory "/foo/bar/baz.txt") ;=> "baz.txt"
(f-filename "/foo/bar/baz.txt") ;=> "baz.txt"
It can even suggest calling functions with apply
:
;; Inputs (one per line):
'(1 2 3 4 5)
;; Desired output:
15
;; Suggestions:
(-sum '(1 2 3 4 5)) ;=> 15
(apply #'+ '(1 2 3 4 5)) ;=> 15
suggest.el tries your inputs (in any order) against every function in
suggest-functions
.
suggest-functions
is a carefully chosen function list: they're all
pure functions with a small number of arguments using only simple data
types. We only include functions that users could 'stumble upon' with
the right set of inputs.
This project was inspired by the Finder in Smalltalk, which does something similar. There's a great demo video here.
There are some other niche tools that take other approaches. For example, cant for Python tries every function in scope (without a safety whitelist) to find functionality.
GPLv3.