File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 36
36
[(uq cmd)
37
37
(eq? 'unquote (syntax-e #'uq ))
38
38
(case (syntax-e #'cmd )
39
+ [(apropos) (elisp-println (scribble-decl-list))]
39
40
[(run) (put/stop (rerun (~a (read))))]
40
41
[(top) (put/stop (rerun #f ))]
41
42
[(def) (def (read))]
Original file line number Diff line number Diff line change @@ -138,6 +138,32 @@ http://www.gnu.org/licenses/ for details.")
138
138
(set (make-local-variable 'imenu-syntax-alist )
139
139
'((" +-*/.<>=?!$%_&~^:" . " w" ))))
140
140
141
+ (require 'helm )
142
+
143
+ (defun helm-racket-apropos-init ()
144
+ (with-current-buffer (helm-candidate-buffer 'global )
145
+ (dolist (elem (racket--eval/sexpr " ,apropos" ))
146
+ (insert (car elem) " \n " ))))
147
+
148
+ (defun helm-racket-apropos-match-part (candidate )
149
+ candidate)
150
+
151
+ (defun helm-racket-apropos-action (candidate )
152
+ (racket--do-describe candidate t ))
153
+
154
+ (defvar helm-source-racket-apropos
155
+ '((name . " Search throught racket defining symbol" )
156
+ (init . helm-racket-apropos-init)
157
+ (candidates-in-buffer)
158
+ (get-line . buffer-substring)
159
+ (match-part . helm-racket-apropos-match-part)
160
+ (action . helm-racket-apropos-action)))
161
+
162
+ (defun helm-racket-apropos ()
163
+ " Equivalent of helm-apropos but for the racket installed documentation"
164
+ (interactive )
165
+ (helm :sources 'helm-source-racket-apropos :buffer " *helm racket apropos*" ))
166
+
141
167
;;;### autoload
142
168
(define-derived-mode racket-mode prog-mode
143
169
" Racket"
Original file line number Diff line number Diff line change 1
1
#lang racket/base
2
2
3
3
(require racket/file
4
+ racket/list
4
5
racket/match
5
6
scribble/xref
6
7
setup/xref
7
8
(only-in xml xml->xexpr element xexpr->string)
8
9
(only-in html read-html-as-xml))
9
10
10
- (provide scribble-doc/html)
11
+ (provide scribble-doc/html
12
+ scribble-decl-list)
13
+
14
+ (define (scribble-decl-list)
15
+ (define xref (fix-load-collections-xref))
16
+ (map entry-words (xref-index xref)))
11
17
12
18
(module+ test
13
19
(require rackunit))
27
33
(define-values (path anchor) (binding->path+anchor stx))
28
34
(and path anchor (scribble-get-xexpr path anchor)))
29
35
36
+ (define fix-xref #f )
37
+
38
+ (define (fix-load-collections-xref)
39
+ (when (not fix-xref)
40
+ (set! fix-xref (load-collections-xref))
41
+ (void (xref-index fix-xref)))
42
+ fix-xref)
43
+
30
44
(define (binding->path+anchor stx)
31
- (define xref (load-collections-xref))
45
+ (define xref (fix- load-collections-xref))
32
46
(define tag (and (identifier? stx)
33
47
(xref-binding->definition-tag xref stx 0 )))
34
48
(cond [tag (xref-tag->path+anchor xref tag )]
You can’t perform that action at this time.
0 commit comments