Skip to content

Commit

Permalink
* Now it is byte compilable
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Brand committed Jan 25, 2015
1 parent a8d93d7 commit 4318ea9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
22 changes: 12 additions & 10 deletions racket-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ http://www.gnu.org/licenses/ for details.")
(set (make-local-variable 'imenu-syntax-alist)
'(("+-*/.<>=?!$%_&~^:" . "w"))))

(when (fboundp 'helm)
(require 'helm)

(defun racket-helm-apropos-init ()
(with-current-buffer (helm-candidate-buffer 'global)
(dolist (elem (racket--eval/sexpr ",apropos"))
(insert (car elem) "\n"))))
(when (require 'helm nil 't)

(when (fboundp 'helm-candidate-buffer)
(defun racket-helm-apropos-init ()
(with-current-buffer (helm-candidate-buffer 'global)
(dolist (elem (racket--eval/sexpr ",apropos"))
(insert (car elem) "\n")))))

(defun racket-helm-apropos-match-part (candidate)
candidate)
Expand All @@ -166,10 +167,11 @@ http://www.gnu.org/licenses/ for details.")
(match-part . racket-helm-apropos-match-part)
(action . racket-helm-apropos-action)))

(defun racket-helm-apropos ()
"Equivalent of helm-apropos but for the racket installed documentation"
(interactive)
(helm :sources 'helm-source-racket-apropos :buffer "*helm racket apropos*")))
(when (fboundp 'helm)
(defun racket-helm-apropos ()
"Equivalent of helm-apropos but for the racket installed documentation"
(interactive)
(helm :sources 'helm-source-racket-apropos :buffer "*helm racket apropos*"))))

;;;###autoload
(define-derived-mode racket-mode prog-mode
Expand Down
16 changes: 4 additions & 12 deletions scribble.rkt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#lang racket/base

(require racket/file
racket/list
racket/list
racket/match
scribble/xref
setup/xref
(only-in xml xml->xexpr element xexpr->string)
(only-in html read-html-as-xml))

(provide scribble-doc/html
scribble-decl-list)
scribble-decl-list)

(define (scribble-decl-list)
(define xref (fix-load-collections-xref))
(define xref (load-collections-xref))
(map entry-words (xref-index xref)))

(module+ test
Expand All @@ -33,16 +33,8 @@
(define-values (path anchor) (binding->path+anchor stx))
(and path anchor (scribble-get-xexpr path anchor)))

(define fix-xref #f)

(define (fix-load-collections-xref)
(when (not fix-xref)
(set! fix-xref (load-collections-xref))
(void (xref-index fix-xref)))
fix-xref)

(define (binding->path+anchor stx)
(define xref (fix-load-collections-xref))
(define xref (load-collections-xref))
(define tag (and (identifier? stx)
(xref-binding->definition-tag xref stx 0)))
(cond [tag (xref-tag->path+anchor xref tag)]
Expand Down

0 comments on commit 4318ea9

Please sign in to comment.